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

Backports opened against wrong parent PR #502

Open
JoeSzymanskiFAN opened this issue May 8, 2024 · 4 comments
Open

Backports opened against wrong parent PR #502

JoeSzymanskiFAN opened this issue May 8, 2024 · 4 comments

Comments

@JoeSzymanskiFAN
Copy link

I've run into a strange scenario every once in a while that I haven't been able to track down.

Rarely, we will have the backport script run and one backport PRs that have the correct commits, but are associated with the wrong parent PR.

For example, PR 1234 will merge, which kicks off the script. It runs with a command similar to:

backport --repo "repo" \
                --accessToken "${GITHUB_TOKEN}" \
                --pullNumber 1234 \
                --noFork \
                --nonInteractive \
                --commitConflicts \
                --label "automated backport" \
                --source-branch "sourceBranch" \
                --target-branch "targetBranch"

the output of the backport job correctly lists the commits from PR 1234, but incorrectly lists the source PR as something different, say 2345 (which is a still-open PR).

Any debugging suggestions would be helpful. I haven't been able to track down why this mismatch is occurring, and it's been causing some confusion when it happens.

@JoeSzymanskiFAN
Copy link
Author

We are still hitting this on a somewhat regular occasion. In some cases, the calculated "source pull request" is one that hasn't even merged yet. In some cases, the actual commit that is cherry-picked is from a third PR unrelated to the other two.

I haven't been able to replicate locally, as it works as expected each time. I'm not sure if there is some git state that I am getting stuck in causing this issue.

Any input on how we can debug or resolve this would be greatly appreciated.

@sorenlouv
Copy link
Owner

sorenlouv commented Aug 31, 2024

Hey, sorry for the slow reply. I would like to look into this problem and will need a bit to work with. Next time this happens can you try getting the relevant logs?
The logs are places in your homefolder: ~/backport/backport.debug.log).

If you have jq installed you can get the logs from a specific data:

 cat .backport/backport.debug.log |  jq 'select(.timestamp >= "2024-08-30")'

@JoeSzymanskiFAN
Copy link
Author

We don't currently have access to those logs. I will make some changes to store those so that we can provide them if the issue occurs again I the future.

@JoeSzymanskiFAN
Copy link
Author

We hit one variation of this recently and were able to get the logs.

In this case, the backport was made against "PR A" from branch release/v4.8 into branch release/v4.9. The backport was able to pull the correct commit, but the "sourcePullRequest" was incorrect, leading to the tool commenting on the wrong parent PR (and the link in the backport PR pointing to the wrong PR despite having text indicating it was pointing to the correct parent PR).

In addition, the incorrect PR that was listed as the source PR had not merged at the time that this tool ran.

backport.debug.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants