Repository navigation
fix(ci): change detection compares a pull request with current main, not its stale base - #5145
Closed
miguel-heygen wants to merge 2 commits into
Closed
miguel-heygen wants to merge 2 commits into
miguel-heygen wants to merge 2 commits into
Conversation
dorny/paths-filter with token "" diffs pull_request.base.sha..merge with two dots; base.sha goes stale as main moves, so a PR behind main counted main's newer commits as its own and ran unrelated gates. Pass the merge commit's first parent as base on pull requests.
miguel-heygen
added a commit
that referenced
this pull request
Oct 7, 2026
…mmit echo "sha=$(git rev-parse HEAD^1)" exited 0 when rev-parse failed, and on a non-merge checkout HEAD^1 would be the PR's previous commit, silently skipping gates. Verify HEAD^2 exists and assign the SHA so a failure stops the step.
Edit accuracy: accurate 2059 (base branch 2059), smooth 1518 of thoseThe gate passes. Quarantined, measured but not gated (0) |
Collaborator
Author
|
Folded into #5151, which carries this change with the timeline overscan fix that makes the Studio gate pass. |
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.
What
A pull request that is behind
mainruns gates for code it never touched. #5139 changes only docs, registry and scripts files, yet its CI run ran "Studio: timeline viewport gate", which then failed on a 0.1 ms timing difference.With this change, change detection on a pull request compares the PR's merge commit with the current tip of
main, so only the PR's own files count.Why
The five workflows that gate jobs on changed paths use
dorny/paths-filterwithtoken: "". For apull_requestevent, that action diffspull_request.base.sha..HEADwith two dots (src/main.tsandsrc/git.tsat the pinned ceb8a2b).HEADis the merge commitrefs/pull/N/merge, which contains currentmain.base.shais where the PR's base stood when GitHub last recorded it, which goes stale asmainmoves. Every commit that landed onmainsince then is counted as the PR's change.For #5139 at the time of its run:
git diff --name-only e6daed3df0 refs/pull/5139/mergelistspackages/studio/**andpackages/core/**files.git diff --name-only refs/pull/5139/merge^1 refs/pull/5139/mergelists none.How
ci.yml,player-perf.yml,preview-regression.yml,regression.ymlandwindows-render.yml, a step before the filter readsgit rev-parse HEAD^1on pull requests. The merge commit's first parent is the current tip ofmain.base. Withtoken: "", the action usesbaseahead ofbase.shafor pull requests.catalog-previews.ymlalready uses for its changed-items diff.baseempty, so they behave exactly as before.Test plan
base.shastayed at a commit 52packages/files behind its base branch, even after a new push. Player perf, regression and preview-regression each loggedUsing base '<merge^1>' instead of the pull request base,Detected 1 changed files, and their filter as false. Under the old rule, the same merge commit diffs 60 files.Using base '0ca99b30…'(the merge commit's first parent) andDetected 5 changed files: the five workflows.mainskips the Studio jobs. Before merge this cannot be shown onmain, because thestudiofilter lists.github/workflows/ci.yml, so any PR carrying this change runs it.ci.yml, which several filters list, so it runs those gates itself.