ci: skip validation entirely when Update Branch did not touch PR .cs files#221
Merged
Merged
Conversation
… files Extends the merge-base filter (PR #207) with two more optimizations that trigger when a PR is updated via "Update branch": 1. Incremental filter: if HEAD is a merge commit, intersect PR-owned files with files actually touched by the merge (HEAD^1..HEAD). If the intersection is empty, skip the build step entirely. 2. Environment tripwire: if the merge brought in changes to csproj, workflow yml, index.json, or global.json, force a full revalidation because the build environment may have changed. Net effect: clicking "Update branch" on an already-passing PR now finishes in ~20 seconds (checkout + detect = skip) instead of rebuilding every .cs file the PR owns.
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.
Summary
Extends the merge-base filter from #207 so that clicking Update branch on an already-passing PR finishes in ~20 seconds instead of rebuilding every
.csfile the PR owns.Two new filters on top of #207
Incremental filter — if
HEADis a merge commit (i.e. the user clicked Update branch), intersect PR-owned files with files actually touched by the merge (HEAD^1..HEAD). If the intersection is empty, skip the build step entirely.Environment tripwire — if the merge brought in changes to
**/*.csproj,.github/workflows/validate-pr.yml,index.json, orglobal.json, force a full revalidation because the build environment may have changed.Decision matrix
.csfiles (unchanged).cstouched.csfiles rebuilt by mergeWhy this is safe
.csfiles are never validated..csfile.Test plan
release/26.3.0and click Update branch on an open PR — CI should finish in under 30s..csfile — CI should validate that file as before.NUGET_VERSIONinindex.jsononrelease/26.3.0, then click Update branch on an open PR — CI should force full revalidation.