fix(ci): stop trusting refs/pull/N/merge for triggered-integration-test - #67
Merged
nerdalert merged 1 commit intoAug 16, 2026
Conversation
resolve-source's "Verify PR merge checkout" step compares the checked-out merge commit's parents against a live-resolved base_sha (fixed in praxis-proxy#62), but the checked-out commit itself still came from GitHub's refs/pull/<n>/merge -- a commit GitHub computes and caches asynchronously. Per GitHub's own changelog ("Changes to test merge commit generation for pull requests", 2026-02-19), that ref is only regenerated on a push to the PR branch, a merge-base change, or a 12h max-age timer, and viewing the PR no longer forces a refresh. Live reproduction against PR praxis-proxy#63 right after praxis-proxy#62 merged: the ref stayed stale for 49+ minutes, including after an explicit mergeable recheck, which would fail "Verify PR merge checkout" with a "base changed" error for a transient, unrelated-to-the-PR reason (see grid#66). Stop depending on that ref. resolve-source already resolves head_sha (PR API) and base_sha (live refs/heads/main) as pinned commit SHAs -- construct the merge locally from those two SHAs with `git merge --no-ff` instead, in both resolve-source (to fail fast on real conflicts before the 120-minute glb-e2e job) and glb-e2e's checkout (to get the actual tested tree). Pinning author/committer identity and date makes the merge commit fully deterministic, so both jobs independently arrive at the identical SHA despite running on separate runners with no shared git state -- verified live: two independent fresh-clone reconstructions of PR praxis-proxy#63's merge (base 7ebabdb.., head 50720c9..) produced the exact same commit SHA (6df4a70a..). fetch-depth changes from 2 to 0 (full clone) for the shared checkout step, since `git merge` needs enough history to find the true merge-base between base_sha and head_sha, which a shallow clone cannot guarantee for a PR that is many commits behind main. Fixes grid#66 Signed-off-by: Jordi Gil <jgil@redhat.com>
nerdalert
approved these changes
Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #66
Problem
resolve-source's "Verify PR merge checkout" step compares the checked-out merge commit's parents against a live-resolvedbase_sha(fixed in #62), but the checked-out commit itself still came from GitHub'srefs/pull/<n>/merge-- a commit GitHub computes and caches asynchronously.Per GitHub's own changelog, Changes to test merge commit generation for pull requests (2026-02-19), that ref is only regenerated on a push to the PR branch, a merge-base change, or a 12h max-age timer -- and viewing the PR page no longer forces a refresh.
Live reproduction against PR #63, right after #62 merged:
refs/pull/63/mergestayed stale for 49+ minutes (including after an explicitmergeablerecheck that returnedtrue), which would fail "Verify PR merge checkout" with a "base changed" error for a transient, unrelated-to-the-PR reason. Full writeup and evidence in #66.Fix
Stop depending on
refs/pull/N/mergeentirely.resolve-sourcealready resolveshead_sha(PR API) andbase_sha(liverefs/heads/main) as two pinned commit SHAs -- construct the merge locally from those withgit merge --no-ffinstead, in both:resolve-source's "Resolve source" step, to fail fast on a real conflict before the 120-minuteglb-e2ejob runs, andglb-e2e's new "Reconstruct PR merge" step, to get the actual tested tree.Pinning author/committer identity and date (new
MERGE_COMMIT_*workflow-level env vars) makes the merge commit fully deterministic, so both jobs -- running on separate, stateless runners -- independently arrive at the identical SHA.fetch-depthfor the shared checkout moves from2to0(full clone) sincegit mergeneeds enough history to find the true merge-base, which a shallow clone can't guarantee for a PR that's many commits behind main.The
checkout_shaoutput is new:actions/checkout'sref:now targets a real, always-fetchable commit (base_shafor a PR,main's tip otherwise) instead of a merge SHA that may not exist as a GitHub-side object yet;tested_shakeeps its existing meaning (the commit actually under test) and every downstream consumer (image provenance labels, the demo's own re-check, the summary table) is unchanged.Validation
No permission to dispatch this workflow on either
praxis-proxy/grid(not an admin) or a fork (GitHub doesn't registerworkflow_dispatch-only workflows added post-fork without manual UI activation) -- same platform constraint noted on #62/#65.Instead, validated the exact logic live against production data:
actionlint(which also runsshellcheckon the embedded scripts) is clean.resolve-source's new "Resolve source" logic in one directory, andglb-e2e's new "Checkout Grid at base revision" + "Reconstruct PR merge" logic in a separate, unrelated fresh clone (no shared git state, mirroring two independent GitHub Actions runners), both against real PR fix(crdt): cap distinct origin site-slots per tenant_spend counter #63 (base_sha=7ebabdbc..,head_sha=50720c9d..):