Renovate: Branch automerges too early on Bitbucket when using unpublishSafe

Created on 11 Dec 2019  路  6Comments  路  Source: renovatebot/renovate

What Renovate type are you using?

Self-hosted

Describe the bug

I have the same issue as #4622 (except I run on Bitbucket Server instead of Cloud). The fix from that issue partially works (i.e. 0 statuses -> pending).

However, when using unpublishSafe the status count contains one successful status thus triggering the bug anyway:

    {
       "dateAdded": 1575995659773,
       "description": "Packages cannot be unpublished",
       "key": "renovate/unpublish-safe",
       "name": null,
       "state": "SUCCESSFUL",
       "url": "https://renovatebot.com"
   }

Did you see anything helpful in debug logs?

With unpublishSafe:

{"commitStatus":{"successful":1,"inProgress":0,"failed":0},"msg":"branch status check result"}
{"msg":"Automerging branch"}

Without unpublishSafe:

{"commitStatus":{"successful":0,"inProgress":0,"failed":0},"msg":"branch status check result"}
{"branchStatus":"pending","branchName":"renovate/html-validate-2.x","msg":"getBranchStatus() result"}
{"msg":"Branch is configured for branch automerge, branch status) is: pending"}

To Reproduce

Bitbucket Server, configure renovate, enable unpublishSafe.

Additional context

Not sure if it is the best solution but maybe test for 1 build instead of 0 when unpublishSafe is enabled?

good first issue bitbucket bug

Most helpful comment

Hi @rarkins ,if this isn't assigned already, I would love to take a look at it 馃檪

All 6 comments

What is your full config?

{
  extends: ["config:js-lib"],
  rebaseStalePrs: true,
  prHourlyLimit: 2,
  prCommitsPerRunLimit: 2,
  semanticCommits: false,
  commitMessagePrefix: "Chore:",
  commitMessageSuffix: "(refs ...)",
  automerge: true,
  automergeType: "branch",
  unpublishSafe: true,
  prCreation: "not-pending",
  major: { automerge: false }
}

So this is a branch automerge that's happening? And I'm assuming it's for some packages that are > 24 hours old?

Yes. And because the real builds hasn't run yet it sometimes causes the master branch to get builds failures due to the automerged dependencies.

I guess we could consider filtering out renovate/ statuses from https://github.com/renovatebot/renovate/blob/427fb1ce67cf05330ff071b20969709fe1211d42/lib/platform/bitbucket/index.ts#L386-L420

If Renovate statuses are the only ones passing then we should classify the branch as pending. But if a Renovate status fails then that should still mark the branch as failed.

Hi @rarkins ,if this isn't assigned already, I would love to take a look at it 馃檪

Was this page helpful?
0 / 5 - 0 ratings