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:
+45
-39
@@ -95,42 +95,46 @@ pipeline validates them against `schemas/contract.schema.json`.
|
||||
|
||||
A minimal deployment:
|
||||
|
||||
[`examples/simple.yaml`](examples/simple.yaml)
|
||||
[`examples/simple.yml`](examples/simple.yml)
|
||||
```yaml
|
||||
# Simple RDS postgres instance
|
||||
uses: acdl/pipelines/deploy.yaml@v1.6
|
||||
module: rds
|
||||
environment: dev
|
||||
inputs:
|
||||
engine: postgres
|
||||
engine_version: "16.4"
|
||||
instance_class: db.t3.micro
|
||||
allocated_storage: 20
|
||||
db_name: my_app_db
|
||||
username: db_admin
|
||||
region: us-east-1
|
||||
id: rds
|
||||
infrastructure:
|
||||
rds:
|
||||
inputs:
|
||||
allocated_storage: 20
|
||||
db_name: my_app_db
|
||||
engine: postgres
|
||||
engine_version: '16.4'
|
||||
instance_class: db.t3.micro
|
||||
region: us-east-1
|
||||
username: db_admin
|
||||
version: 1.0.0
|
||||
name: rds-instance
|
||||
```
|
||||
|
||||
### Complex
|
||||
|
||||
A production deployment with optional inputs:
|
||||
|
||||
[`examples/complex.yaml`](examples/complex.yaml)
|
||||
[`examples/complex.yml`](examples/complex.yml)
|
||||
```yaml
|
||||
# Complex RDS postgres with multi-AZ + encryption
|
||||
uses: acdl/pipelines/deploy.yaml@v1.6
|
||||
module: rds
|
||||
environment: dev
|
||||
inputs:
|
||||
engine: postgres
|
||||
engine_version: "16.4"
|
||||
instance_class: db.r6g.large
|
||||
allocated_storage: 100
|
||||
db_name: my_production_db
|
||||
username: db_admin
|
||||
multi_az: true
|
||||
storage_encrypted: true
|
||||
region: us-east-1
|
||||
id: rds
|
||||
infrastructure:
|
||||
rds:
|
||||
inputs:
|
||||
allocated_storage: 100
|
||||
db_name: my_production_db
|
||||
engine: postgres
|
||||
engine_version: '16.4'
|
||||
instance_class: db.r6g.large
|
||||
multi_az: true
|
||||
region: us-east-1
|
||||
storage_encrypted: true
|
||||
username: db_admin
|
||||
version: 1.0.0
|
||||
name: rds-instance
|
||||
```
|
||||
|
||||
### Multi-engine variation
|
||||
@@ -140,25 +144,27 @@ the `engine_version` must match.
|
||||
|
||||
#### PostgreSQL
|
||||
|
||||
[`examples/simple.yaml`](examples/simple.yaml) — postgres 16.4
|
||||
[`examples/simple.yml`](examples/simple.yml) — postgres 16.4
|
||||
|
||||
#### MySQL
|
||||
|
||||
[`examples/mysql.yaml`](examples/mysql.yaml) — mysql 8.4
|
||||
[`examples/mysql.yml`](examples/mysql.yml) — mysql 8.4
|
||||
|
||||
```yaml
|
||||
# RDS mysql variation
|
||||
uses: acdl/pipelines/deploy.yaml@v1.6
|
||||
module: rds
|
||||
environment: dev
|
||||
inputs:
|
||||
engine: mysql
|
||||
engine_version: "8.4"
|
||||
instance_class: db.t3.micro
|
||||
allocated_storage: 20
|
||||
db_name: my_mysql_db
|
||||
username: db_admin
|
||||
region: us-east-1
|
||||
id: rds
|
||||
infrastructure:
|
||||
rds:
|
||||
inputs:
|
||||
allocated_storage: 20
|
||||
db_name: my_mysql_db
|
||||
engine: mysql
|
||||
engine_version: '8.4'
|
||||
instance_class: db.t3.micro
|
||||
region: us-east-1
|
||||
username: db_admin
|
||||
version: 1.0.0
|
||||
name: rds-instance
|
||||
```
|
||||
|
||||
## Versioning
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# Complex RDS postgres with multi-AZ + encryption
|
||||
uses: acdl/pipelines/deploy.yaml@v1.6
|
||||
module: rds
|
||||
environment: dev
|
||||
inputs:
|
||||
engine: postgres
|
||||
engine_version: "16.4"
|
||||
instance_class: db.r6g.large
|
||||
allocated_storage: 100
|
||||
db_name: my_production_db
|
||||
username: db_admin
|
||||
multi_az: true
|
||||
storage_encrypted: true
|
||||
region: us-east-1
|
||||
@@ -0,0 +1,17 @@
|
||||
# Complex RDS postgres with multi-AZ + encryption
|
||||
environment: dev
|
||||
id: rds
|
||||
infrastructure:
|
||||
rds:
|
||||
inputs:
|
||||
allocated_storage: 100
|
||||
db_name: my_production_db
|
||||
engine: postgres
|
||||
engine_version: '16.4'
|
||||
instance_class: db.r6g.large
|
||||
multi_az: true
|
||||
region: us-east-1
|
||||
storage_encrypted: true
|
||||
username: db_admin
|
||||
version: 1.0.0
|
||||
name: rds-instance
|
||||
@@ -1,12 +0,0 @@
|
||||
# RDS mysql variation
|
||||
uses: acdl/pipelines/deploy.yaml@v1.6
|
||||
module: rds
|
||||
environment: dev
|
||||
inputs:
|
||||
engine: mysql
|
||||
engine_version: "8.4"
|
||||
instance_class: db.t3.micro
|
||||
allocated_storage: 20
|
||||
db_name: my_mysql_db
|
||||
username: db_admin
|
||||
region: us-east-1
|
||||
@@ -0,0 +1,15 @@
|
||||
# RDS mysql variation
|
||||
environment: dev
|
||||
id: rds
|
||||
infrastructure:
|
||||
rds:
|
||||
inputs:
|
||||
allocated_storage: 20
|
||||
db_name: my_mysql_db
|
||||
engine: mysql
|
||||
engine_version: '8.4'
|
||||
instance_class: db.t3.micro
|
||||
region: us-east-1
|
||||
username: db_admin
|
||||
version: 1.0.0
|
||||
name: rds-instance
|
||||
@@ -1,12 +0,0 @@
|
||||
# Simple RDS postgres instance
|
||||
uses: acdl/pipelines/deploy.yaml@v1.6
|
||||
module: rds
|
||||
environment: dev
|
||||
inputs:
|
||||
engine: postgres
|
||||
engine_version: "16.4"
|
||||
instance_class: db.t3.micro
|
||||
allocated_storage: 20
|
||||
db_name: my_app_db
|
||||
username: db_admin
|
||||
region: us-east-1
|
||||
@@ -0,0 +1,15 @@
|
||||
# Simple RDS postgres instance
|
||||
environment: dev
|
||||
id: rds
|
||||
infrastructure:
|
||||
rds:
|
||||
inputs:
|
||||
allocated_storage: 20
|
||||
db_name: my_app_db
|
||||
engine: postgres
|
||||
engine_version: '16.4'
|
||||
instance_class: db.t3.micro
|
||||
region: us-east-1
|
||||
username: db_admin
|
||||
version: 1.0.0
|
||||
name: rds-instance
|
||||
Reference in New Issue
Block a user