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

No target branches found for this PR error #475

Closed
jumaffre opened this issue Sep 5, 2023 · 7 comments
Closed

No target branches found for this PR error #475

jumaffre opened this issue Sep 5, 2023 · 7 comments

Comments

@jumaffre
Copy link

jumaffre commented Sep 5, 2023

First, thank you very much for this tool/GHA, which has been saving us many manual operations backporting commits to release branches 💯

We've started seeing the following error in our GitHub Actions pipeline:

Run sqren/backport-github-action@main
Initiate backport
{"optionsFromGithub":{"authenticatedUsername":"ccf-bot","sourceBranch":"main","isRepoPrivate":false,"repoOwner":"microsoft","repoName":"ccf","targetBranchChoices":["release/3.x","release/4.x"],"branchLabelMapping":{"^(.+)-todo$":"release/$1"},"autoMerge":true,"autoMergeMethod":"squash","prTitle":"[{{targetBranch}}] Cherry pick: {{commitMessages}}","prDescription":"Backports the following commits to `{{targetBranch}}`:\n{{commitMessages}}","sourcePRLabels":["backported"],"targetPRLabels":["$1-backport"],"autoAssign":false,"publishStatusCommentOnSuccess":false,"publishStatusCommentOnFailure":true,"publishStatusCommentOnAbort":true},"actionOptions":{"accessToken":"***","assignees":["jumaffre"],"gitHostname":"github.com","githubActionRunId":6073[5](https://github.com/microsoft/CCF/actions/runs/6073526987/job/16475609988#step:5:6)2[6](https://github.com/microsoft/CCF/actions/runs/6073526987/job/16475609988#step:5:7)987,"githubApiBaseUrlV3":"https://api.github.com/","githubApiBaseUrlV4":"https://api.github.com/graphql","interactive":false,"publishStatusCommentOnFailure":true,"pullNumber":560[7](https://github.com/microsoft/CCF/actions/runs/6073526987/job/16475609988#step:5:8),"repoForkOwner":"microsoft","repoName":"CCF","repoOwner":"microsoft","reviewers":[]}}
{"commits":[{"author":{"name":"Julien Maffre","email":"42961061+jumaffre@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-09-04T12:39:07Z","message":"Update `llhttp` from `6.0.9` to `9.0.1` (#5607)","sha":"25b6efc252da177492e4b9c8063ced70fe6c8989","branchLabelMapping":{"^(.+)-todo$":"release/$1"}},"sourcePullRequest":{"labels":["auto-backport","4.x-todo"],"title":"Update `llhttp` from `6.0.9` to `9.0.1`","number":5607,"url":"https://github.com/microsoft/CCF/pull/5607","mergeCommit":{"message":"Update `llhttp` from `6.0.9` to `9.0.1` (#5607)","sha":"25b6efc252da177492e4b9c[8](https://github.com/microsoft/CCF/actions/runs/6073526987/job/16475609988#step:5:9)063ced70fe6c8989"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"release/4.x","label":"4.x-todo","branchLabelMappingKey":"^(.+)-todo$","isSourceBranch":false,"state":"NOT_CREATED"}]}]}
Error: Backport failure: No target branches found for this PR. Aborting.
Error: No target branches found for this PR. Aborting.

This used to work fine before (last successful run 2 weeks ago) and we haven't updated our .backportrc.json apart from the breaking change in the template engine.

I also can't find anything obvious in the commit history on this repo that could have caused this issue. Do you know what could have caused this?

@sorenlouv
Copy link
Owner

Hi there,

Thanks for the kind words.

What version are you using and did the problem start occuring after you upgraded?

@sorenlouv
Copy link
Owner

... ah, I see you are on the main branch. Will take a look

@achamayou
Copy link

@sqren it looks like the action is now trying to backport to a hypothetical "foo" branch: microsoft/CCF#5618 (comment)

Echoing what @jumaffre has already said, we are very grateful, backport is a huge time saver for us!

@sorenlouv
Copy link
Owner

I am not 100% sure why this is happening. I have a theory that because the backport action runs immediately after the pull request is merged, the Github API doesn't always reflect the true state yet, which leads the backport tool into an invalid state. Or, it could just be a bug on my end 🤷

Either way, I recently added a check to prevent the action from starting, if there are no branches to backport to. I've reverted that in https://github.com/sqren/backport-github-action/pull/110/files#diff-69c9100f2a3041c22e8fddf77d13fd7eb1aa42a8a200aa35a81ea589c135e66a and hope that solves the problem.

Let me know if this comes up again!

@sorenlouv
Copy link
Owner

sorenlouv commented Sep 5, 2023

@sqren it looks like the action is now trying to backport to a hypothetical "foo" branch: microsoft/CCF#5618 (comment)

My bad! Talk about testing in production 😱 I was trying to repro your problem, and that caused the noise on the PR (I've deleted the comments)

@achamayou
Copy link

@sqren it looks like the action is now trying to backport to a hypothetical "foo" branch: microsoft/CCF#5618 (comment)

My bad! Talk about testing in production 😱 I was trying to repro your problem, and that caused the noise on the PR (I've deleted the comments)

No harm done :) Thank you for looking into this and adding the check, the action is working as expected now as far as I can tell: microsoft/CCF#5618 (comment) (there's a merge conflict, but that's unrelated).

@jumaffre
Copy link
Author

jumaffre commented Sep 8, 2023

Closing this issue as our backport pipeline is now working. Thank you @sqren!

@jumaffre jumaffre closed this as completed Sep 8, 2023
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

3 participants