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

Backport fails randomly due to "no-branch-exception" #103

Closed
raubel opened this issue Apr 13, 2023 · 9 comments · Fixed by #121
Closed

Backport fails randomly due to "no-branch-exception" #103

raubel opened this issue Apr 13, 2023 · 9 comments · Fixed by #121

Comments

@raubel
Copy link

raubel commented Apr 13, 2023

Hi,

We use this tool a lot in my company, thanks for it!
However, sometimes, the backport fails for the following reason:

Error: There are no branches to backport to. Aborting

We didn't manage to understand the context of this failure (we even tried to keep branches after merge but we still have the issue).

Do you know why it happens? Is there any fix/workaround to make it fully reliable?
Thank you for any help.

@sarod
Copy link

sarod commented Apr 21, 2023

Adding a bit more information on top of @raubel.

The version used is sqren/[email protected]
Here is an example log produced by the execution when the error occurs.;

{
  assignees: [ '<user>' ],
  branchLabelMapping: { '^backport-to-(.+)$': '$1' },
  pullNumber: 1808,
  repo: { owner: '<org>', repo: '<repo>' },
  repoForkOwner: '<org>'
}
Result {
  "status": "aborted",
  "commits": [
    {
      "author": {
        "name": "<author>",
        "email": "<email>"
      },
      "sourceCommit": {
        "committedDate": "2023-04-12T16:48:28Z",
        "message": "Message for 6ac19318fca8c2148751fbd0a0edee5f26df87cb",
        "sha": "6ac19318fca8c2148751fbd0a0edee5f26df87cb"
      },
      "sourcePullRequest": {
        "labels": [
          "auto-backport",
          "backport-to-V2023_2"
        ],
        "number": 1808,
        "url": "https://github.com/<org>/<repo>/pull/1808",
        "mergeCommit": {
          "message": "Message for 0c16cacf9aed1ec7ed8142fa5a9b0018d023b5f5",
          "sha": "0c16cacf9aed1ec7ed8142fa5a9b0018d023b5f5"
        }
      },
      "sourceBranch": "master",
      "suggestedTargetBranches": [
        "V2023_2"
      ],
      "targetPullRequestStates": [
        {
          "branch": "V2023_2",
          "label": "backport-to-V2023_2",
          "labelRegex": "^backport-to-(.+)$",
          "isSourceBranch": false,
          "state": "NOT_CREATED"
        }
      ]
    },
    {
      "author": {
        "name": "<author>",
        "email": "<email>"
      },
      "sourceCommit": {
        "committedDate": "2023-04-12T16:48:28Z",
        "message": "Message for 0c16cacf9aed1ec7ed8142fa5a9b0018d023b5f5",
        "sha": "0c16cacf9aed1ec7ed8142fa5a9b0018d023b5f5"
      },
      "sourcePullRequest": {
        "labels": [
          "auto-backport",
          "backport-to-V2023_2"
        ],
        "number": 1808,
        "url": "https://github.com/<org>/<repo>/pull/1808",
        "mergeCommit": {
          "message": "Message for 0c16cacf9aed1ec7ed8142fa5a9b0018d023b5f5",
          "sha": "0c16cacf9aed1ec7ed8142fa5a9b0018d023b5f5"
        }
      },
      "sourceBranch": "master",
      "suggestedTargetBranches": [
        "V2023_2"
      ],
      "targetPullRequestStates": [
        {
          "branch": "V2023_2",
          "label": "backport-to-V2023_2",
          "labelRegex": "^backport-to-(.+)$",
          "isSourceBranch": false,
          "state": "NOT_CREATED"
        }
      ]
    }
  ],
  "error": {
    "name": "BackportError",
    "errorContext": {
      "code": "no-branches-exception"
    }
  },
  "errorMessage": "There are no branches to backport to. Aborting."
}

@sqren is there any additional logs we could enable to understand the error better?

@s0undt3ch
Copy link

We have also hit this issue frequently

@sorenlouv
Copy link
Owner

sorenlouv commented Aug 29, 2023

Hi there,

Sorry for the slow reply!

I recently released a new version of the github action (9.2.1). Can you please try that out and let me know how it goes? It has some additional logging that might shed some light on this.

Thanks!

@raubel
Copy link
Author

raubel commented Sep 5, 2023

Thanks @sqren, we now use version 9.3.0.
We'll let you know when it happens again (with the logs).

@laeubi
Copy link

laeubi commented Nov 3, 2023

I think this happens when there are more than one commit:

https://github.com/eclipse-tycho/tycho/actions/runs/6747800057/job/18344749747

Still happens on 9.3.0 ...

@laeubi
Copy link

laeubi commented Nov 3, 2023

By the way if I go to the branch and cherry pick the both commits independently it works without a problem see:

@laeubi
Copy link

laeubi commented Feb 9, 2024

@sorenlouv can you give some feedback about the problem when backporting PRs that contain more than one commit?

We heavily use that action but having only ever one commit is sometimes limiting ...

@jchappelow
Copy link

Can backport be bumped to v9.5 or latest so the action gets the fix from sorenlouv/backport#493? Thanks! This is a nice action to have.

@sorenlouv
Copy link
Owner

Fixed in #121 via sorenlouv/backport#493

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

Successfully merging a pull request may close this issue.

6 participants