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.
- {faas_gitops-0.3.0/src/faas_gitops.egg-info → faas_gitops-0.3.1}/PKG-INFO +1 -1
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/pyproject.toml +1 -1
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/app.py +1 -1
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/parser.py +1 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/layout.py +0 -1
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/deploy_functions.py +5 -11
- {faas_gitops-0.3.0 → faas_gitops-0.3.1/src/faas_gitops.egg-info}/PKG-INFO +1 -1
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_deploy_functions.py +6 -5
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/MANIFEST.in +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/setup.cfg +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/__init__.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/__init__.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/bizy_function_provider.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/bizy_template_provider.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/adapters/git_cli_gateway.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/__init__.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/cli/presenters.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/config.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/filtering.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/infra/__init__.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/infra/yaml_utils.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/models.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/__init__.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/faas_function.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/faas_template.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/protocols/git_gateway.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/__init__.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/apply_function_changes.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/apply_template_changes.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/detect_drift.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/detect_function_drift.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/detect_template_drift.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/render_definitions.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/sync_functions.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops/usecases/sync_templates.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/SOURCES.txt +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/dependency_links.txt +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/entry_points.txt +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/requires.txt +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/src/faas_gitops.egg-info/top_level.txt +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_apply_function_changes.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_apply_template_changes.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_detect_drift.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_detect_function_drift.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_git_cli_gateway.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_render_definitions.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_sync_functions.py +0 -0
- {faas_gitops-0.3.0 → faas_gitops-0.3.1}/tests/test_sync_templates.py +0 -0
|
@@ -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
|
)
|
|
@@ -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
|
-
"""
|
|
13
|
+
"""Deploy applied functions to all their active deployments.
|
|
16
14
|
|
|
17
|
-
For each applied function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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:
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|