Skip to content

ci(infra): a failed detect turns terraform plan red instead of skipping it (#676) - #1376

Merged
athvin merged 1 commit into
mainfrom
ci/676-infra-detect-fails-closed
Nov 29, 2026
Merged

athvin merged 1 commit into
mainfrom
ci/676-infra-detect-fails-closed

Conversation

@athvin

@athvin athvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #676

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

infra.yml's terraform plan gate now also runs when detect infra changes did not succeed, and carries detect's result as a gate leg, so a failed classification turns that required context red instead of skipping it.

Why

A failed detect emptied its outputs, so validate, helpers, plan and the gate all skipped, and branch protection read the three required Terraform contexts as satisfied: an infra PR that planned and validated nothing, shown green. Rust and frontend got the same fix in ce3fd01; infra was the remaining hole.

Proof

make check exit 0. New InfraPlanGate in scripts/ci/test_ci_selection.py: the job admits a failed detect and lists it as a leg; detect=failure|cancelled|"" with plan skipped is never green; a fork PR (detect=success, plan skipped) and a real success still pass, a failed leg fails. Regenerated required-checks.md.

Risk & rollback

Only changes when the gate job runs. On a non-infra PR detect succeeds with infra=false, so the gate still skips as before. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:24d16c2e-fec6-49d8-9797-060338df4848 on brians-MacBook-Pro · 2026-11-29T02:26:32Z

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not: — 86cb03b, rust 46213856822 + frontend 46213856726 success
  • images built, or correctly never ran because nothing that goes into
    an image changed: — n/a — workflow and a CI test only
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion: — n/a — nothing deploys from infra.yml's gate
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change: — infra 46213856763 success on main: the push run carried detect as a gate leg and passed; devcontainer success
  • the board card reached Done through the automation rather than by
    hand, and the issue closed: — infra.yml: a failed detect infra changes leaves all three Terraform required contexts skipped, so an unverified infra PR reads CLEAN #676 CLOSED by ci(infra): a failed detect turns terraform plan red instead of skipping it (#676) #1376 via automation
  • follow-ups are open for everything deferred here — numbers: — none
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned: — every required aggregate gate now treats a failed detect as red; rust, frontend and infra all follow the same shape

Specific to this change

Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Files

Validate and helpers still skip on a failed detect; one red required context is enough to block the merge, which is the same shape rust.yml uses.

🤖 Generated with Claude Code

…ping it (#676)

When `detect infra changes` failed, its outputs were empty, so validate,
helpers, plan and the plan gate all reported skipped, and branch
protection read three skipped required Terraform contexts as satisfied:
an infra PR that validated and planned nothing, shown green.

The plan gate now also runs when detect did not succeed, and carries
detect's result as a leg, so gate-all-legs fails it. A fork PR (detect
succeeds, plan skips itself for lack of an id-token) still passes, as
does any PR that touches no infra (detect succeeds, infra false, gate
skipped). test_ci_selection's InfraPlanGate pins all three shapes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

terraform plan

631298d · run log and full plans

env add change destroy
state-backend (plan only) 0 0 0
core 0 0 0
dev 0 0 0
prod 0 0 0

Planned with -refresh=false, so this is the config-versus-state diff and
not out-of-band drift. That is a security choice, not a speed one: a refreshing
plan reads secret values, and the plan role is assumable from any PR branch —
which can edit the workflow it runs under. Drift is caught at apply time, which
refreshes fully.

@athvin
athvin merged commit 86cb03b into main Nov 29, 2026
50 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 29, 2026 02:01 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — 6105e93a Deployed Nov 29, 2026 by athvin via remove closed PR previews #132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

infra.yml: a failed detect infra changes leaves all three Terraform required contexts skipped, so an unverified infra PR reads CLEAN

2 participants