361fe600a9
Extend the modules-lifecycle pipeline with L2 composition modules (static-assets, microservice) per REQ-128: - pipelines/modules-lifecycle.yml: added l2-lifecycle-apply/modify/destroy stages + l2_modules matrix entry - .gitea/workflows/modules-lifecycle.yml + .github/workflows/modules-lifecycle.yml: added l2-lifecycle job (byte-identical), matrix over [static-assets, microservice], needs ci-vpc-apply, has apply/modify/destroy steps. ci-vpc-destroy now needs both [lifecycle, l2-lifecycle]. - schemas/modules-lifecycle-pipeline.schema.json: added l2_modules to matrix - scripts/run_l2_lifecycle_test.sh + run_l2_lifecycle_destroy.sh: L2 wrappers that set ACDL_REMOTE_STATE_KEY=spike/ci-vpc/terraform.tfstate so the microservice composition's terraform_remote_state reads from the CI VPC - adapters/terraform/adapter.py: parameterized remote_state key via ACDL_REMOTE_STATE_KEY env var (default: platform/terraform.tfstate) - modules/l2/static-assets/examples/complex.yml: fixed bucket_name to match simple (my-static-site) so terraform modifies in-place (adds CDN + WAF) - modules/l2/microservice/examples/complex.yml: fixed bucket_name to match simple (my-microservice-demo), added desired_count:2 (modify variant) - tests/test_pipeline_contract.py: 7 new L2 tests (l2 job exists, matrix lists both modules, apply/modify/destroy steps, needs ci-vpc-apply, ci-vpc-destroy needs both, contract matrix lists l2_modules) - pipelines/README.md: updated stages for L2 Regression: 485 passed, 5 deselected. Gitea + GitHub workflows byte-identical. ---ci--- project: acdl phase: P61 milestone: v1.11 status: execute ---/ci---
2.9 KiB
2.9 KiB
ACDL Pipelines
Overview
ACDL uses declarative pipeline contracts (YAML) as the single source of truth. Both Gitea and GitHub workflows implement the same contract (byte-identical). The shell runner (scripts/run_ci.sh) mirrors the CI pipeline locally so that every stage that runs in CI can be reproduced on a developer machine without a forge.
Existing Pipelines
| Pipeline | File | Stages | Triggers |
|---|---|---|---|
| ACDL CI | ci.yml |
lint, test, check-only |
push/PR to main |
| ACDL Deploy | contract.yml |
validate-contract, resolve-stack, terraform-plan, checkov, confidence, apply, publish-outputs, deploy-uptime, comment-outputs |
push/PR to main (consumer repos via workflow_call) |
| ACDL Modules Lifecycle | modules-lifecycle.yml |
platform-vpc-apply, lifecycle-apply, lifecycle-modify, lifecycle-destroy, l2-lifecycle-apply, l2-lifecycle-modify, l2-lifecycle-destroy, platform-vpc-destroy |
PR to main + workflow_dispatch |
How to Write a Pipeline
- YAML structure:
name,environment,triggers(withpushandpull_requestbranch arrays),runner,python_version, and astages[]list. - Each stage is an object with
name,command,required(boolean), and optionalinstall(pip install command) +description(human-readable summary). - Validate the resulting YAML against
schemas/pipeline.schema.json(CI) orschemas/deploy-pipeline.schema.json(deploy).
How to Wire a Pipeline
- Create byte-identical workflow YAMLs in
.gitea/workflows/<name>.ymland.github/workflows/<name>.yml. - Both workflows must implement the same stages, commands, triggers, and runner declared in the contract.
scripts/run_ci.shmirrorsci.ymllocally so the same stages run without a forge.- Consumer repos reference the deploy pipeline via
uses: acdl/.github/workflows/deploy.yml@vX.Y.
Dependencies
scripts/run_ci.sh— local CI mirror that runs theci.ymlstages.scripts/run_platform.sh— platform pipeline runner that implements thecontract.ymlstages.- Workflow YAMLs in
.gitea/workflows/and.github/workflows/. - Schemas in
schemas/(pipeline.schema.json,deploy-pipeline.schema.json).
How to Test Pipelines
tests/test_pipeline_contract.py— validates each pipeline YAML against its schema, asserts workflow conformance (byte-identical Gitea/GitHub workflows with the same stages/commands/triggers), and testsscripts/run_ci.shexecution against the contract.
Adding a New Pipeline
- Create
pipelines/<name>.ymlusing the structure above. - Create or extend the schema in
schemas/for the new pipeline shape. - Create byte-identical workflow YAMLs in
.gitea/workflows/<name>.ymland.github/workflows/<name>.yml. - Extend
scripts/run_ci.shif a local mirror of the new pipeline is needed. - Write or extend tests in
tests/test_pipeline_contract.pyto assert schema validity and workflow conformance.