MAINT: Run CI on release branches - #2510
Open
varunj-msft wants to merge 1 commit into
Open
Conversation
Behnam (behnam-o)
approved these changes
Aug 28, 2026
Behnam (behnam-o)
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thank you! just a little comment on the precommit hook update
| # `git cherry-pick` does not run pre-commit, so the staged check above rarely fires here | ||
| # either: review is the remaining control. | ||
| if _on_release_branch(): | ||
| return False |
Contributor
There was a problem hiding this comment.
Could we avoid skipping both history checks on release branches? In CI the staged index is clean, so this effectively removes automated immutability enforcement. For release PRs, we could compare against origin/${GITHUB_BASE_REF} instead of origin/main; for pushes/merge queue, HEAD~1..HEAD should remain applicable. This avoids false positives from divergence while still detecting modified or deleted revisions.
varunj-msft
force-pushed
the
varunj-msft/v1.1.0-Release-CI-Fixes
branch
4 times, most recently
from
August 28, 2026 18:32
ea467ce to
d409429
Compare
The workflows never ran on release branches. `build_and_test`, `diff_cover`, `docker_build` and `frontend_tests` filtered pull requests on `release/**`, but release branches are named `releases/vx.y.z`, so the filter matched nothing, and their push triggers listed only `main`. Only `docs.yml` used the correct pattern, which is why it was the sole workflow to run on past release branches. They now match `docs.yml`. `diff_cover` keeps its pull request trigger limited to `main`, because diff coverage compares against `origin/main` and a release branch differs from it by the whole release. It gains the manual trigger the other three already have. The pre-commit step now declares `shell: bash`, because it grew a shell conditional and the Windows runner defaults to PowerShell. A pull request into a release branch is compared against that branch rather than against `main`, because everything the release branch already carries is not part of the change under review. Only the push and merge queue paths, which carry no base branch to compare against, skip the history comparison. Running these workflows on release branches exposed two problems that were previously invisible. The alembic revision immutability check compares the branch against `origin/main`, and a release branch cut from an earlier tag carries cherry-picked commits that legitimately edit already-released revisions, so the check reported them as violations; it now skips that comparison on release branches while still checking staged changes. The concurrency groups keyed on `github.head_ref`, which is empty for a push, so every push formed its own group and nothing was ever superseded, defeating the stated intent of the block; they now fall back to `github.ref`. The memory models guide stated the immutability rule without qualification, so it now records the release branch exception alongside it.
varunj-msft
force-pushed
the
varunj-msft/v1.1.0-Release-CI-Fixes
branch
from
August 28, 2026 18:42
d409429 to
6568580
Compare
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.
Description
The
build_and_test,diff_cover,docker_buildandfrontend_testsworkflows filtered pull requests onrelease/**, but release branches are namedreleases/vx.y.z, so the filter never matched anything, and their push triggers listed onlymain. Onlydocs.ymlused the correct pattern, which is why it was the sole workflow to run on past release branches:releases/v1.0.1andreleases/v1.0.0each have exactly two Actions runs, bothbuild-book. The four workflows now matchdocs.yml—releases/v*on push,releases/**on pull request.diff_coverkeeps its pull request trigger limited tomain, because diff coverage compares againstorigin/mainand a release branch differs from it by the whole release. It gains the manual trigger the other three already had.Running these workflows on release branches exposed two problems that were previously invisible:
origin/main. A release branch cut from an earlier tag carries cherry-picked commits that legitimately edit already-released revisions, so the check reported intentional work as violations. It now skips history comparison on release branches while still checking staged changes.github.head_ref, which is empty for a push, so every push formed its own group and nothing was ever superseded. They now fall back togithub.ref. Note this also changesmain: back-to-back pushes now cancel the earlier run, which is what the block's own comment always claimed it did.Tests and Documentation
Adds
tests/unit/build_scripts/test_enforce_alembic_revision_immutability.pywith 19 tests covering push, pull request, merge queue and tag refs, the localgit rev-parsefallback, branch names that only look like release branches, and that staged violations still fail on a release branch.pytest tests/unit/build_scripts/passes 266 tests.doc/contributing/11_memory_models.mdstated the revision immutability rule without qualification, so it now records the release branch exception alongside it.No notebooks are affected, so JupyText was not run.