CI/CD — Runway — Guidelines
Rules every ION service follows when it writes workflows, IaC, or merges PRs. See architecture.md for the model.
MUST / SHOULD / MUST-NOT. Deviations require an ADR.
Repository & branching
- MUST live in the Ontinue Anvil mono-repo. MUST-NOT create a standalone repo for a new ION service without a CPE-approved exception.
- MUST use GitHub Flow (trunk-based): feature branch → PR →
main. MUST-NOT use long-lived release branches / GitFlow. - MUST own a
CODEOWNERSentry for your service folder pointing to the owning team. - SHOULD keep service folder layout to
api/,app/,docs/,infra/per CPE guidance.
PR merge gate
- MUST pass all CPE-owned required PR checks: Secret Validation, PR Label, PR Title, CodeQL, TFSEC, OSS License / dependency-review, Linter.
- MUST use CPE’s reusable workflows for these checks (
lib-validate-*,validate-pr-title.yml). MUST-NOT roll your own PR-check implementations — CPE will not support them. - MUST carry exactly one semver PR label
(
Major/minor/patch/re-release, ordeletetfmodulefor TF-module removals). - MUST use a conventional-commit-style PR title.
- MUST obtain CODEOWNERS approval from every team whose files the PR touches.
Service workflows
- MUST author these workflows per service:
<service>-pr.yml— PR-time validation.<service>.yml— push-to-maindeploy throughapa → bta → gma.<service>-tag.yml(or<service>-release.yml) — prod promotion.
- MUST consume CPE reusable workflows and shared
lib-*workflows where applicable. - SHOULD name workflows and jobs consistently across services so audit and telemetry queries work across the fleet.
- MUST-NOT duplicate CPE reusable-workflow logic in-line.
Environments & promotion
- MUST map every service × env pair to a GitHub environment
named
<service_short>-<env_long>. - MUST deploy to
bta/gma/prdonly from workflows running onmain. PR deploys land only in Alpha. - MUST register env reviewers and protection rules declaratively
in
service-map.json. MUST-NOT hand-edit the live GitHub environment inbta/gma/prd. - MUST promote via signed tag (or GitHub release) for prod. MUST-NOT deploy prod on push-to-main.
- SHOULD add a custom protection rule (Automation Account runbook) for prod when the service has change-freeze windows, upstream-health dependencies, or deployment quotas.
Azure authentication
- MUST use WIF (
azure/login@v3) for every pipeline Azure operation. MUST-NOT useclient-secretin Actions. - MUST use per-env federated credentials (
ION_<ENV>_AZURE_CLIENT_ID). MUST-NOT share a client-id across environments. - MUST narrow the federated-credential subject pattern to the specific repo + environment + branch. MUST-NOT use a wildcard subject that would let another repo mint tokens.
IaC
- MUST ship all Azure resource changes via IaC (Terraform primary; ARM/Bicep sanctioned as fallback where Terraform coverage is missing).
- MUST-NOT apply
terraform applyfrom a laptop againstbta/gma/prd. - MUST-NOT make portal changes to
bta/gma/prd. - MUST consume
tf-modules/for foundational resources. SHOULD contribute back totf-modules/when you build a reusable shape. - MUST store Terraform state in the platform-provisioned Azure Storage backend, one state per service per env.
- MUST treat TFSEC findings as merge-blocking; fix or exempt with ADR, don’t ignore.
- SHOULD avoid ARM/Bicep unless Terraform provider coverage is documented as missing. Track migration when Terraform catches up.
Artifacts
- MUST publish artifacts (NuGet, npm, PyPI, Docker, ZIP, Terraform modules) to JFrog Artifactory via CPE reusable workflows.
- MUST rely on the semver PR label for versioning; MUST-NOT hand-compute versions.
- MUST promote artifacts across Alpha → Beta → Gamma → Prod registries — MUST-NOT rebuild binaries per env.
- MUST copy Docker images from Artifactory to the per-env ACR
before deploy (
lib-docker-acr-copy.yml). - SHOULD enable JFrog X-Ray scanning on every publish; treat
vulnerabilities per the SLA in
runway-vulnerability-management.yml.
Secrets
- MUST-NOT store service credentials as GitHub Actions secrets for Azure operations — use WIF.
- MAY store scoped Artifactory tokens as GitHub Actions secrets. Rotate on the platform-team schedule.
- MUST-NOT log secret material.
masksensitive outputs.
Runners
- MUST use GitHub-hosted runners with VNet NIC (
<env>-linux/<env>-windows) for jobs that need private-endpoint reachability. - MUST use the
<env>-linux-staticvariants when a stable egress IP is required for third-party allowlisting. - MUST-NOT self-host runners in the ION spoke.
- SHOULD keep runner-consumed workflow steps small; move heavy build to build-only runners (public GH-hosted) when Azure access isn’t required.
Observability
- MUST ship pipeline run signals (workflow duration, failure rates, deploy frequency) to observability where CPE provides the hook.
- MUST capture deployment records (env, version, subject) as part of the audit chain.
- SHOULD alert on unusual patterns (spike in prod deploys, cancelled runs, WIF token issuance from unexpected subject).
Change control
- MUST treat detected Azure resource drift as a defect (§ 25). Reconcile via PR immediately or revert.
- MUST-NOT disable required PR checks to unblock a merge.
- MUST-NOT grant standing write access on ION Prod GitHub environments to individuals outside a small, named list.
Anti-patterns
- Long-lived client secrets in GitHub Actions secrets for Azure auth.
- PATs used to deploy to Azure or Artifactory.
- Portal edits to Function App / Cosmos / SQL / APIM policy in
bta/gma/prd. - Continuous-deployment straight to prod on push-to-main.
- Custom PR-check implementations that shadow CPE’s contract.
- Multiple
<service>.ymlvariants that mix PR and push flows. - Hand-written Azure resource blocks that duplicate a
tf-modules/module. - Sharing a Terraform state file across environments.
- Federated-credential subject patterns broader than needed.
- Building artifacts per environment instead of promoting.
Related
- architecture.md
- implementation
- ADR: 0024
- Principles: § 15, § 22, § 25