Fix missing merged PR lists for mainline releases#589
Open
IanButterworth wants to merge 1 commit into
Open
Conversation
When a release commit on the default branch was also reachable from other branches (e.g. feature branches created off main after the commit, or long-lived branches that had merged main), branches_of_commit returned those branches and the changelog took the backport path. PRs were then filtered to ones merged into those branches via _pulls_on_branches, which matches nothing since PRs merge into the default branch, so the "Merged pull requests" section came out empty while "Closed issues" (which use a date-only filter) still appeared. This is why the problem was intermittent: it depended on which branches happened to contain the release commit when TagBot ran. branches_of_commit now returns an empty list whenever the default branch contains the commit: a commit reachable from the default branch is a mainline release regardless of what other branches also contain it. Genuine backports (commit not on the default branch) are unaffected. Also document in DEVGUIDE.md that `poetry run pytest` can run against a stale installed copy of tagbot instead of the local sources; use `poetry run python -m pytest` or `make pytest`. Fixes #574 Co-Authored-By: Claude <claude@users.noreply.github.com>
219cce3 to
81a1daa
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.
Fixes #574
claude:
When a release commit on the default branch was also reachable from other branches (e.g. feature branches created off main after the commit, or long-lived branches that had merged main), branches_of_commit returned those branches and the changelog took the backport path. PRs were then filtered to ones merged into those branches via _pulls_on_branches, which matches nothing since PRs merge into the default branch, so the "Merged pull requests" section came out empty while "Closed issues" (which use a date-only filter) still appeared. This is why the problem was intermittent: it depended on which branches happened to contain the release commit when TagBot ran.
branches_of_commit now returns an empty list whenever the default branch contains the commit: a commit reachable from the default branch is a mainline release regardless of what other branches also contain it. Genuine backports (commit not on the default branch) are unaffected.
Also document in DEVGUIDE.md that
poetry run pytestcan run against a stale installed copy of tagbot instead of the local sources; usepoetry run python -m pytestormake pytest.