Skip to content

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

Done

Description

@athvin

The merge bus refuses a candidate whose detect jobs failed, because skipped is only trustworthy when the job that decided to skip succeeded. Nothing protects a human doing the same thing.

The hole

Every expensive job gates on needs.detect.outputs.*. When a detect job fails, its dependents report skipped, and branch protection accepts skipped as satisfied. A PR can therefore show all twelve required contexts satisfied with not one of them having run, and mergeStateStatus: CLEAN.

Observed on #473 (2026-11-05): two Rust files changed, all three detect jobs failed in the Actions-minutes outage, every required context skipped, PR reported CLEAN. It was mergeable by hand with nothing compiled or tested. Re-running CI turned it genuinely red.

This also defeats the aggregator gates: test and DuckLake + extensions e2e carry if: !cancelled() && needs.detect.outputs.code == 'true', so with detect failed the gate is skipped before its fail-closed case can run. The aggregator pattern assumes detect succeeds.

What exists today

Only the bus checks it, and only for its own candidates. The query is documented in the ci-and-supply-chain skill:

gh api repos/:owner/:repo/commits/<head_sha>/check-runs --paginate \
  --jq '[.check_runs[]|select(.name|startswith("detect"))|select(.conclusion=="failure")]|length'

Options

  • Make the detect jobs fail the gate rather than skip it. The cleanest fix, but it cannot be done by making the detect contexts required: there are three of them under two names, and a required context that legitimately does not report blocks every PR forever — the trap the plan (<env>) episode already cost. An aggregator that treats an empty needs.detect.outputs.* as failure is the shape to look at.
  • Or accept it and make the check cheap to run by hand, e.g. a one-line alias, and say so in the skill's "merging" section.

Not urgent — it needs a CI outage to arise, and outages are visible. But it is a false green of exactly the class this repo keeps engineering against, and right now the only thing that catches it is a tool nobody is obliged to use.


Product context (2026-11-26)

Why this matters for the API product: Merge-gate trust. A PR that compiled and tested nothing must not be mergeable, and that includes infra changes to the platform the API runs on.

Current state: Mostly fixed for rust and frontend, still open for infra.

  • Fixed in ce3fd01 (2026-11-09): the aggregators now run with if: always() and call scripts/ci/gate-selection.sh. Its line 5 fails when DETECT_RESULT != success. That covers test (rust.yml:835-853), DuckLake + extensions e2e (rust.yml:1173-1193) and playwright functional tier (frontend.yml:306-325). A failed rust or frontend detect now turns a required context red. That closes the fix(engine): a correction pass records the mode RUN_MODES declares #473 shape.
  • Still open: infra.yml's terraform plan gate is if: !cancelled() && needs.detect.outputs.infra == 'true' (infra.yml:413). Its validate and helpers jobs gate the same way (:185, :258). If detect infra changes fails, all three required Terraform contexts skip and count as satisfied. plan-gate uses gate-all-legs.sh, which never looks at detect.
  • Original body now wrong: "only the bus checks it" is out of date. The merge bus was removed in a4cb602 (2026-11-20). The manual check now lives in land-pr (SKILL.md:67, references/polling.md:26-30), which is what the "make it cheap by hand" option asked for.
  • Other required jobs (fmt + clippy + docs, cargo-deny, entities, the frontend lint and audit jobs, postgres.js) still skip on a failed detect. They are covered only because a sibling aggregator in the same workflow now fails.

Definition of done:

  1. With detect infra changes forced to fail on an infra-only PR, terraform plan (or another required infra context) concludes failure, and a fork PR still passes.
  2. Add a test case for that in scripts/ci/test_ci_selection.py or an equivalent.

Size: ~0.25 engineer-weeks.

Activity

  1. added
    ci-backlog
    on Nov 6, 2026
  2. changed the title [-]a hand-merge can still land a PR whose CI verified nothing[/-] [+]infra.yml: a failed `detect infra changes` leaves all three Terraform required contexts skipped, so an unverified infra PR reads CLEAN[/+] on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci-backlog

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions