Skip to content

Conversation

@zmiklank
Copy link

What this PR does / why we need it:

It adds command that helps with backporting commit to multiple branches

@openshift-ci openshift-ci bot requested review from bentito and bryan-cox October 22, 2025 12:52
@openshift-ci
Copy link

openshift-ci bot commented Oct 22, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zmiklank
Once this PR has been reviewed and has the lgtm label, please assign enxebre for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zmiklank zmiklank marked this pull request as draft October 22, 2025 12:53
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 22, 2025
@@ -0,0 +1,63 @@
You are helping backport a commit to multiple branches.

# Arguments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please follow ## conventions in the ref implementation https://github.com/openshift-eng/ai-helpers?tab=readme-ov-file#plugin-development

Copy link
Author

@zmiklank zmiklank Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @enxebre thanks for looking into this!
I have updated the file based on your feedback.

- Pulls latest changes to ensure it's up to date: `git pull`
- **If the branch doesn't track a remote branch:**
- Skips pulling and informs the user the branch is local-only
- **If `--new-branch` flag is set:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is --new-branch an opt-in flag instead of default builtin behaviour? when wouldn't I want it to create a new branch if it doesn't exist yet?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example if you would want to cherry pick second commit to the same branch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I'm not following. Every time you want to cherrypick a specific commit the command would just reuse/create a local branch named backport-<commit-short-hash>-to-<branch> as builtin behaviour. In that workflow how is an opt-in flag helpful? do you have a concrete workflow example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants