Repository navigation
Label the original PR once a backport lands - #74
Draft
aiolibsbot wants to merge 1 commit into
Draft
aiolibsbot wants to merge 1 commit into
aiolibsbot wants to merge 1 commit into
Conversation
Nothing on a merged pull request distinguishes a backport that the App created from one that it gave up on -- the `backport-X` label stays put either way. Maintainers looking for the branches that still need a hand have to open every labeled PR and read its check runs. Add two independent, off-by-default repo config options: `backported_label_prefix` labels the original PR with `<prefix><branch_id>` once the backport PR exists, and `delete_backport_label_on_success` drops the label that triggered the run. Setting both leaves `backport-X` on exactly the pull requests that still need manual work. Both prefixes are configurable, so a repo can pick a completion prefix that extends the trigger one -- `backport`/`backported` does, the defaults do not. There, the label added on success would read as another backport request and the App would trigger itself, so label recognition moves into `is_backport_label()` which rules that out. Writing the labels is best-effort: the backport PR already exists by the time it runs, and a failing label write must not report the backport as failed. Refs sanitizers#12
This was referenced Sep 16, 2026
This branch has not been deployed
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.
What
Two off-by-default repo config options that update the original PR's labels once a backport PR is created:
backported_label_prefixadds<prefix><branch_id>,delete_backport_label_on_successremoves the triggeringbackport-<branch_id>.Why
Refs #12. A merged PR looks identical whether the backport landed or the cherry-pick conflicted — the
backport-Xlabel stays either way, so finding the ones that still need a human means opening each and reading its check runs. Setting both options leavesbackport-Xon exactly the PRs that need manual work.How
patchback/labels.py. Both prefixes are configurable, so a repo can pick a completion prefix that extends the trigger one —backport/backporteddoes, the defaultsbackport-/backported-do not. Where it does, the success label would read as a fresh backport request and the App would trigger itself;is_backport_label()rules that out.patchback/labels_api.pyfollows the existing*_api.pywrapper pattern.remove_label()percent-encodes the label into the path —backport-stable/2.0would otherwise become extra path segments.pull_requests: writealready covers PR labels.''/False) keep today's behaviour byte-for-byte.Testing
18 tests in
tests/test_labels.pyandtests/test_labels_api.py, covering prefix collision, the feature-off path, and path escaping. They are stdlib-only and run under barepytest tests/; wiring them into CI depends on thetests.ymlworkflow from #72.Quality Report
Changes: 6 files changed, 292 insertions(+), 10 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan