Files
open-design/e2e
lefarcenandGitHub 211ec5df5a ci: make the Nix hash check advisory on PRs, enforce it only at merge time (#4896)
* ci: make the Nix hash check advisory on PRs, enforce it only at merge time

A stale nix/pnpm-deps.nix hash is the routine, self-healing consequence of any
pnpm-lock.yaml change: the nix_validation job already regenerates the hash and
hands it to autofix.atom.yml, which pushes the refresh back to the PR branch.

Failing the job on pull_request turned that transient, auto-fixed drift into a
red check that flipped the PR to BLOCKED and read as a real CI failure to the
review bot — the same deadlock the needs-validation gate already documents. The
contributor then waited on the autofix round-trip every time the lockfile moved.

Now nix_validation stays green on pull_request (the autofix still self-heals the
hash in the background) and the hash is enforced as a hard gate only at merge
time: merge_group and manual full runs fail closed, so a genuinely broken Nix
build can never reach main. The Validate workspace gate ignores a red Nix job on
PRs (both the blanket failure scan and the required-jobs check) and keeps
requiring it everywhere else.

* test(e2e): cover the Nix-advisory-on-PR Validate workspace gate

Extract the two jq programs the `validate` job runs (the blanket failure scan
and the required-jobs scan) straight out of ci.yml and feed representative
`needs` JSON through the real `jq`, so the cross-workflow gate behavior is
asserted rather than reviewed by eye:

- pull_request + failed nix_validation -> gate passes (advisory),
- merge_group / workflow_dispatch full + failed nix_validation -> gate fails
  closed,
- pull_request + another failed required job -> gate still fails (the PR
  exception is scoped to nix_validation only).

A future edit that makes Nix advisory on merge_group, or stops ignoring it on
PRs, now fails this test instead of slipping through YAML review.
2026-06-29 13:33:08 +00:00
..