github_sync: smarter target branch selection #6
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.
Implement "sticky" target branch: if a series has an associated open
PR without merge-conflict, then do not consider other target branches.
The config allows for multiple target branches to be associated with
the same tag, for example:
"tag_to_branch_mapping": {
"tag": ["target1", "target2"]
}
Whenever a series is being synced, KPD tries to apply it to each
target branch in order, stopping at the first successful apply. Then
it opens/updates a tracking PR, and closes all other PRs for this
series.
This works fine most of the time. However, this logic may lead to
series suddenly switching branches. Example scenario:
indication that something happened
What should've happened in this case is pr1 labeled as
"merge-conflict" and target2 not tried.
The "stickiness" is implemented by checking existing PRs when
determining the list of target branches to apply the series to.