Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case(5): Rebase and merge #365

Merged
merged 2 commits into from
Feb 25, 2024
Merged

case(5): Rebase and merge #365

merged 2 commits into from
Feb 25, 2024

Conversation

backport-action
Copy link
Collaborator

Adds some changed lines

@backport-action backport-action added should_copy Should be copied when backported backport case5-backport-target Backport a pull request to case5-backport-target labels Feb 25, 2024
@backport-action backport-action merged commit bdaf6a1 into main Feb 25, 2024
@backport-action backport-action deleted the case5-new-changes branch February 25, 2024 13:08
Copy link
Contributor

Successfully created backport PR for case5-backport-target:

@korthout
Copy link
Owner

korthout commented Feb 25, 2024

This is an attempt to use korthout/backport-action#405 to backport this PR to backport-action/backport-action-test@case5-backport-target

@korthout
Copy link
Owner

/backport

@korthout
Copy link
Owner

My own experimental input was wrongly formatted 😅 Let's retry:

/backport

Copy link
Contributor

Git push to origin failed for case5-backport-target with exitcode 1

@korthout
Copy link
Owner

korthout commented Feb 25, 2024

✅ Correctly fetched commits from origin:

Fetching all the commits from the pull request: 3
git fetch --depth=3 origin refs/pull/365/head
From https://github.com/korthout/backport-action-test
 * branch            refs/pull/365/head -> FETCH_HEAD

✅ Correctly determined commits to cherry-pick using origin (even using rebase method):

Retrieving the commits from pull request 365
PR was merged using a rebase
git fetch --depth=3 origin +bdaf6a136[35](https://github.com/korthout/backport-action-test/actions/runs/8038306262/job/21954065235#step:3:36)2a76cd456f664ebe6484aa7ac8b3e:refs/remotes/origin/bdaf6a1[36](https://github.com/korthout/backport-action-test/actions/runs/8038306262/job/21954065235#step:3:37)352a76cd456f664ebe6484aa7ac8b3e
From https://github.com/korthout/backport-action-test
 * [new ref]         bdaf6a136352a76cd456f664ebe6484aa7ac8b3e -> origin/bdaf6a136352a76cd456f664ebe6484aa7ac8b3e
git log --pretty=format:"%H" --reverse bdaf6a136352a76cd456f664ebe6484aa7ac8b3e~2..bdaf6a136352a76cd456f664ebe6484aa7ac8b3e
Found commits to backport: 2d7cfa9973fcb1d815178d698d8df19e678b6544,bdaf6a136352a76cd456f664ebe6484aa7ac8b3e
Checking the merged pull request for merge commits
git rev-list --merges 2d7cfa9973fcb1d815178d698d8df19e678b6544^..bdaf6a136352a76cd456f664ebe6484aa7ac8b3e
Encountered 0 merge commits
Will cherry-pick the following commits: 2d7cfa9973fcb1d815178d698d8df19e678b65[44](https://github.com/korthout/backport-action-test/actions/runs/8038306262/job/21954065235#step:3:45),bdaf6a136352a76cd456f664ebe6484aa7ac8b3e

✅ Correctly determined that target branch exists on upstream repository named target:

git remote add target https://github.com/backport-action/backport-action-test.git
Backporting to target branch 'case5-backport-target...'
git fetch --depth=1 target case5-backport-target
From https://github.com/backport-action/backport-action-test
 * branch            case5-backport-target -> FETCH_HEAD
 * [new branch]      case5-backport-target -> target/case5-backport-target

✅ Correctly switched to target branch from upstream repository:

Start backport to backport-365-to-case5-backport-target
git switch -c backport-365-to-case5-backport-target target/case5-backport-target
Switched to a new branch 'backport-365-to-case5-backport-target'

❌ Failed to push because of permissions:

git cherry-pick -x 2d7cfa9973fcb1d815178d698d8df19e678b6544 bdaf6a136352a76cd456f664ebe6484aa7ac8b3e
Push branch to origin
git push --set-upstream target backport-365-to-case5-backport-target
To https://github.com/backport-action/backport-action-test.git
 ! [remote rejected] backport-365-to-case5-backport-target -> backport-365-to-case5-backport-target (permission denied)
error: failed to push some refs to 'https://github.com/backport-action/backport-action-test.git'
Git push to origin failed for case5-backport-target with exitcode 1
Create comment: Git push to origin failed for case5-backport-target with exitcode 1

This makes sense, because the default GITHUB_TOKEN is used to clone the repository, push commits and create eh pull request.

Copy link
Contributor

Git push to origin failed for case5-backport-target with exitcode 1

@korthout
Copy link
Owner

Write access should now be provided using a token for the checkout action. Let's retry

/backport

Copy link
Contributor

Resource not accessible by integration

@korthout
Copy link
Owner

This failed because the PR creation failed. Note we should clarify the error message. I've now added a token to the backport-action as well. Let's retry:

/backport

@korthout
Copy link
Owner

Git push to origin failed for case5-backport-target with exitcode 1

@korthout
Copy link
Owner

It failed because the target branch was already pushed to it. Note that we should gracefully handle this case in the future or clarify the error message.

The target branch is now removed. Let's retry

/backport

@korthout
Copy link
Owner

Successfully created backport PR for case5-backport-target:

@korthout
Copy link
Owner

Git push to origin failed for case5-backport-target with exitcode 1

@korthout
Copy link
Owner

That worked. Let's retry with a different PAT.

/backport

@backport-action
Copy link
Collaborator Author

Successfully created backport PR for case5-backport-target:

@backport-action
Copy link
Collaborator Author

Git push to origin failed for case5-backport-target with exitcode 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport case5-backport-target Backport a pull request to case5-backport-target should_copy Should be copied when backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants