faas-gitops 0.3.0__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {faas_gitops-0.3.0/src/faas_gitops.egg-info → faas_gitops-0.3.1}/PKG-INFO +1 -1
  2. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/pyproject.toml +1 -1
  3. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/app.py +1 -1
  4. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/parser.py +1 -0
  5. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/layout.py +0 -1
  6. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/deploy_functions.py +5 -11
  7. {faas_gitops-0.3.0 → faas_gitops-0.3.1/src/faas_gitops.egg-info}/PKG-INFO +1 -1
  8. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_deploy_functions.py +6 -5
  9. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/MANIFEST.in +0 -0
  10. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/setup.cfg +0 -0
  11. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/__init__.py +0 -0
  12. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/__init__.py +0 -0
  13. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/bizy_function_provider.py +0 -0
  14. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/bizy_template_provider.py +0 -0
  15. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/git_cli_gateway.py +0 -0
  16. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/__init__.py +0 -0
  17. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/presenters.py +0 -0
  18. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/config.py +0 -0
  19. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/filtering.py +0 -0
  20. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/infra/__init__.py +0 -0
  21. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/infra/yaml_utils.py +0 -0
  22. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/models.py +0 -0
  23. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/__init__.py +0 -0
  24. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/faas_function.py +0 -0
  25. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/faas_template.py +0 -0
  26. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/git_gateway.py +0 -0
  27. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/__init__.py +0 -0
  28. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/apply_function_changes.py +0 -0
  29. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/apply_template_changes.py +0 -0
  30. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/detect_drift.py +0 -0
  31. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/detect_function_drift.py +0 -0
  32. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/detect_template_drift.py +0 -0
  33. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/render_definitions.py +0 -0
  34. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/sync_functions.py +0 -0
  35. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/sync_templates.py +0 -0
  36. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/SOURCES.txt +0 -0
  37. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/dependency_links.txt +0 -0
  38. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/entry_points.txt +0 -0
  39. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/requires.txt +0 -0
  40. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/top_level.txt +0 -0
  41. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_apply_function_changes.py +0 -0
  42. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_apply_template_changes.py +0 -0
  43. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_detect_drift.py +0 -0
  44. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_detect_function_drift.py +0 -0
  45. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_git_cli_gateway.py +0 -0
  46. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_render_definitions.py +0 -0
  47. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_sync_functions.py +0 -0
  48. {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_sync_templates.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: faas-gitops
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Declarative GitOps for FaaS
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: aiofiles>=23.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "faas-gitops"
7
- version = "0.3.0"
7
+ version = "0.3.1"
8
8
  description = "Declarative GitOps for FaaS"
9
9
  requires-python = ">=3.12"
10
10
  dependencies = [
@@ -100,7 +100,7 @@ async def async_main() -> int:
100
100
  result = await ApplyFunctionChanges(BizyFunctionProvider(faas), settings).run(
101
101
  repo_path, dry_run=dry_run, repo_slug=repo_slug,
102
102
  )
103
- if not dry_run and result.applied_versions:
103
+ if not dry_run and getattr(args, "auto_deploy", False) and result.applied_versions:
104
104
  deploy_result = await DeployFunctions(BizyFunctionProvider(faas), settings).run(
105
105
  result.applied_versions, repo_path
106
106
  )
@@ -36,6 +36,7 @@ def build_parser(settings: Settings) -> argparse.ArgumentParser:
36
36
 
37
37
  p = sub.add_parser("apply-function-changes")
38
38
  p.add_argument("--dry-run", action="store_true")
39
+ p.add_argument("--auto-deploy", action="store_true")
39
40
  _add_repo(p)
40
41
 
41
42
  return parser
@@ -10,4 +10,3 @@ FUNCTION_BASE = "base.yaml"
10
10
  FUNCTION_DEFINITION = "definition.yaml"
11
11
  FUNCTION_FILES = (FUNCTION_META, FUNCTION_BASE, FUNCTION_DEFINITION)
12
12
  FUNCTION_RENDERED = "rendered.yaml"
13
- AUTO_DEPLOY_TAGS = ("bizytrd_auto_deploy",)
@@ -5,19 +5,17 @@ from pathlib import Path
5
5
  from loguru import logger
6
6
 
7
7
  from faas_gitops.config import Settings
8
- from faas_gitops.layout import AUTO_DEPLOY_TAGS, FUNCTION_DIR, FUNCTION_META
9
8
  from faas_gitops.models import DeployResult
10
9
  from faas_gitops.protocols.faas_function import FaaSFunctionProvider
11
- from faas_gitops.usecases.sync_functions import read_function_from_dir
12
10
 
13
11
 
14
12
  class DeployFunctions:
15
- """Auto-deploy drifted functions tagged with AUTO_DEPLOY_TAG.
13
+ """Deploy applied functions to all their active deployments.
16
14
 
17
- For each applied function whose meta.yaml tags include AUTO_DEPLOY_TAG,
18
- deploys the pushed version to every non-terminated deployment.
19
- Skips deployments already at the target version (idempotency guard).
20
- Fire-and-forget: triggers deploy without waiting for readiness.
15
+ For each applied function, deploys the pushed version to every
16
+ non-terminated deployment. Skips deployments already at the target
17
+ version (idempotency guard). Fire-and-forget: triggers deploy without
18
+ waiting for readiness.
21
19
  """
22
20
 
23
21
  def __init__(self, provider: FaaSFunctionProvider, settings: Settings) -> None:
@@ -28,10 +26,6 @@ class DeployFunctions:
28
26
  result = DeployResult()
29
27
  for fid, version in applied_versions.items():
30
28
  try:
31
- parts = await read_function_from_dir(repo_path / FUNCTION_DIR / fid)
32
- tags = parts.meta.get("tags") or []
33
- if not set(AUTO_DEPLOY_TAGS) & set(tags):
34
- continue
35
29
  deployments = await self._provider.list_deployments(fid)
36
30
  active = [d for d in deployments if d.get("status") != "terminated"]
37
31
  if not active:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: faas-gitops
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Declarative GitOps for FaaS
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: aiofiles>=23.0
@@ -26,15 +26,16 @@ _META_WITHOUT_TAG = "functionName: f2\ntags:\n- other\n"
26
26
 
27
27
  class TestDeployFunctions:
28
28
  @pytest.mark.asyncio
29
- async def test_no_tag_skipped(self) -> None:
29
+ async def test_deploys_regardless_of_tags(self) -> None:
30
30
  repo = _make_repo(("fn1", _META_WITHOUT_TAG))
31
31
  provider = MagicMock()
32
- provider.list_deployments = AsyncMock()
32
+ provider.list_deployments = AsyncMock(return_value=[
33
+ {"id": "dep1", "status": "ready", "definition_version": 3},
34
+ ])
33
35
  provider.deploy_version = AsyncMock()
34
36
  result = await DeployFunctions(provider, Settings()).run({"fn1": "5"}, repo)
35
- assert result.deployed == []
36
- assert result.skipped == []
37
- provider.list_deployments.assert_not_called()
37
+ assert "fn1/dep1" in result.deployed
38
+ provider.deploy_version.assert_called_once_with("fn1", "dep1", "5")
38
39
 
39
40
  @pytest.mark.asyncio
40
41
  async def test_tag_with_active_dep_gets_deployed(self) -> None:
File without changes
File without changes