Repository navigation
ci: accept API break approvals only after the published release (stable/9) - #474
Merged
Merged
Conversation
git log tag..HEAD also lists commits from histories that diverged before the published tag. After a stable branch reset, a labelled merge there could approve dropping API that only the published release had. --ancestry-path keeps only descendants of the tag; the manual override still covers an intentional rollback. Closes #471
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change restricting approval candidates to descendants of the published release tag.
No open issues 🎉
What changed in this PR
Tightens the stable/9 API compatibility gate so api-break-approved labels count only on merges that descend from the published release tag. This prevents approvals from unrelated history after a branch reset; the manual rollback override remains unchanged.
Changes:
- Adds
--ancestry-pathto the approval candidate search. - Adds a regression test for diverged release history and updates the gate’s Git fake to require the flag.
| File | Description |
|---|---|
| tests/acceptance/test_api_compat.py | Tests exclusion of merges outside the published history and updates the Git fake. |
| scripts/api-break-approvals.sh | Restricts approval candidates to descendants of the published tag. |
Review effort: Balanced
git log --ancestry-path tag..HEAD still accepts a labelled merge when a reset release branch reaches the published tag only through a second parent: every later merge descends from the tag, though none was made on the line it was released from. Require the tag on HEAD's first-parent history and list only first-parent commits after it; otherwise only the manual override can approve the release.
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.
Relates to #471 (backport to stable/9)
Adds
--ancestry-pathto the commit list inscripts/api-break-approvals.sh, so anapi-break-approvedlabel counts only on merges that descend from the published tag. A labelled merge on a history that diverged before the release (after a stable branch reset) can no longer approve dropping API only the published release had. The manualapi_break_approvedoverride still covers an intentional rollback. Same fix as camunda/orchestration-cluster-api-java#130.New regression
test_approval_search_ignores_merges_outside_the_published_historyretags the baseline onto a sibling commit; it failed before the change (approved#1) and passes after. The gate test fake now requires the flag.test_api_compat.py, ruff, shellcheck and the branch type checker pass.