refactor(P57): contract surface redesign + rename + .yml repo-wide
Contract surface redesign: - New top-level fields: id (3-6 char acronym → stack.name), name (full → stack.title), infrastructure (map keyed by module name, replaces module:) - Drop uses: field (dead reference; version pin lives in CI workflow uses: line) - Drop top-level module/inputs (now nested under infrastructure map) - Per-module optional version (defaults to latest published from registry) - Multi-module contracts: one file deploys N modules in one pipeline run, resource IDs namespaced with module name to avoid collisions - stack.schema.json: add optional title field for display name Rename: - pipelines/deploy.yaml → pipelines/contract.yml (declarative spec, not a pipeline) - pipelines/ci.yaml → pipelines/ci.yml - All 44 .yaml files → .yml repo-wide (contracts, module examples, kyverno policies) - .acdl/contract.yaml → .acdl/contract.yml Resolver (core/contract_resolver.py): - Rewrite resolve() to loop infrastructure map, default version to latest, merge module fragments into one stack with namespaced resource IDs - _latest_version() picks highest non-deprecated from registry - _namespace_resources() prefixes IDs + rewrites ref: expressions for multi-module - Single-module path: unprefixed IDs (backward compatible) Verification: - 494 tests pass (0 contract-shape failures) - Local E2E passes (contract → resolver → adapter → local ECS HTTP 200 → outbox) ---ci--- project: acdl phase: 57 milestone: v1.10.2 status: execute ---/ci---
This commit is contained in:
@@ -40,35 +40,35 @@ def test_deploy_workflow_passes_env_flag_to_run_platform():
|
||||
|
||||
def test_resolver_environment_override_changes_env():
|
||||
"""D-088: environment_override changes the resolved environment."""
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yaml"),
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yml"),
|
||||
environment_override="qa")
|
||||
s3 = [r for r in stack["resources"] if r["type"] == "aws:s3:bucket"][0]
|
||||
assert "qa" in s3["inputs"]["bucket_name"]
|
||||
|
||||
|
||||
def test_resolver_environment_override_prod():
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yaml"),
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yml"),
|
||||
environment_override="prod")
|
||||
s3 = [r for r in stack["resources"] if r["type"] == "aws:s3:bucket"][0]
|
||||
assert "prod" in s3["inputs"]["bucket_name"]
|
||||
|
||||
|
||||
def test_resolver_environment_override_dr():
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yaml"),
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yml"),
|
||||
environment_override="dr")
|
||||
s3 = [r for r in stack["resources"] if r["type"] == "aws:s3:bucket"][0]
|
||||
assert "dr" in s3["inputs"]["bucket_name"]
|
||||
|
||||
|
||||
def test_resolver_no_override_uses_contract_env():
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yaml"))
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yml"))
|
||||
s3 = [r for r in stack["resources"] if r["type"] == "aws:s3:bucket"][0]
|
||||
assert "dev" in s3["inputs"]["bucket_name"]
|
||||
|
||||
|
||||
def test_resolver_override_none_uses_contract_env():
|
||||
"""Passing environment_override=None uses the contract's environment."""
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yaml"),
|
||||
stack = resolve(str(ROOT / "contracts" / "static-assets.yml"),
|
||||
environment_override=None)
|
||||
s3 = [r for r in stack["resources"] if r["type"] == "aws:s3:bucket"][0]
|
||||
assert "dev" in s3["inputs"]["bucket_name"]
|
||||
|
||||
Reference in New Issue
Block a user