pipeline-discipline
Skill: Pipeline Discipline
Tool-agnostic (GitHub Actions, GitLab CI, Jenkins — from memory-long §stack). Complements ops-dev instructions (always-on rules); this is the deep-dive.
Pipeline structure (canonical stages)
validate (lint/format/types, fast-fail) → build/plan (artifacts or IaC plan) → gate (tests, security scan, human approval where required) → apply/deploy → verify (smoke, health). Each stage fails the pipeline honestly — no continue-on-error on gates.
Credentials
- Short-lived identity over static secrets — OIDC/workload identity federation wherever the platform supports it; static keys are the fallback, not the default.
- Job permissions declared explicitly and least-privilege (
contents: readunless proven otherwise). - Secrets scoped to the environment that needs them; production secrets never available to PR-triggered runs from forks.
Debugging methodology (in order)
Pipeline auth failures are almost always one of, in this order: ① missing job permissions declaration · ② wrong role/identity ARN or audience · ③ trust condition not matching the repo/branch pattern (verify the exact sub claim format) · ④ backend/state store unreachable or under-permissioned. Check the boring things first — read the error, not the vibes.