Skip to content

ci: skip validation entirely when Update Branch did not touch PR .cs files#221

Merged
fahadadeel merged 1 commit into
release/26.3.0from
fix/validate-pr-incremental
Apr 10, 2026
Merged

ci: skip validation entirely when Update Branch did not touch PR .cs files#221
fahadadeel merged 1 commit into
release/26.3.0from
fix/validate-pr-incremental

Conversation

@agent-aspose-pdf-examples
Copy link
Copy Markdown
Collaborator

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 .cs file the PR owns.

Two new filters on top of #207

  1. Incremental filter — if HEAD is 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.

  2. Environment tripwire — if the merge brought in changes to **/*.csproj, .github/workflows/validate-pr.yml, index.json, or global.json, force a full revalidation because the build environment may have changed.

Decision matrix

Scenario Behaviour
Normal PR push Validates all PR-owned .cs files (unchanged)
Update branch — no env change, no .cs touched Skip (fastest)
Update branch — PR .cs files rebuilt by merge Validate only that subset
Update branch — csproj / workflow / index.json / global.json changed Full revalidation of all PR-owned files

Why this is safe

Test plan

  • Merge into release/26.3.0 and click Update branch on an open PR — CI should finish in under 30s.
  • Open a new PR that modifies a .cs file — CI should validate that file as before.
  • Bump NUGET_VERSION in index.json on release/26.3.0, then click Update branch on an open PR — CI should force full revalidation.

… 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.
@fahadadeel fahadadeel merged commit 8bdd6c5 into release/26.3.0 Apr 10, 2026
1 check passed
@fahadadeel fahadadeel deleted the fix/validate-pr-incremental branch May 8, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants