Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Automerge Enabled, but does not merge #639

Closed
nadar opened this issue May 6, 2020 · 12 comments
Closed

Automerge Enabled, but does not merge #639

nadar opened this issue May 6, 2020 · 12 comments

Comments

@nadar
Copy link

nadar commented May 6, 2020

Hi, we are using this awesome renovate bot system to update our websites dependencies. What makes me curious is that it generates Pull Requests and says "Automerge: Enabled" but the bot does not merge automatically (also not in second run (3rd, etc.)) - also we have the option on GitLab to Approve Merge Request, which we did, but i does not merge either. Any help? Or is this a known config behavior?

image

This is the .renovaterc config we use:

{
   "extends":[
      ":pinVersions",
      ":separateMultipleMajorReleases",
      ":combinePatchMinorReleases",
      ":ignoreModulesAndTests",
      ":automergePatch",
      ":automergeMinor",
      ":pinSkipCi",
      "group:allNonMajor"
   ],
   "assignees":[
      "elnadar"
   ]
}
@rarkins rarkins transferred this issue from renovatebot/renovate May 6, 2020
@rarkins
Copy link
Collaborator

rarkins commented May 6, 2020

Do you have any tests running? Renovate by default won't merge unless at least one test has passed.

@nadar
Copy link
Author

nadar commented May 7, 2020

There is a CI Pipeline configured, which runs successful:

image

@nadar
Copy link
Author

nadar commented May 7, 2020

This Merge Request triggered those Pipelines:

image

which both have been successful.

@viceice
Copy link
Member

viceice commented May 7, 2020

@nadar can you please provide the debug logs. There should be a hint, why automerge isn't done

@nadar
Copy link
Author

nadar commented May 7, 2020

Output with logLevel "info":

INFO: Repository started (repository=_THE_REPO)
"renovateVersion": "19.231.8"
INFO: Dependency extraction complete (repository=_THE_REPO)
"baseBranch": "master",
"stats": {
"managers": {
"composer": {"fileCount": 1, "depCount": 17},
"docker-compose": {"fileCount": 1, "depCount": 3},
"dockerfile": {"fileCount": 1, "depCount": 1},
"gitlabci-include": {"fileCount": 1, "depCount": 1}
},
"total": {"fileCount": 4, "depCount": 22}
},
"durationMs": 1667
INFO: Package releases lookups complete (repository=_THE_REPO)
"durationMs": 3106
INFO: Repository finished (repository=_THE_REPO)

i switched now to logLevel trace. Will post the same with "trace" level in a few minutes.

@viceice
Copy link
Member

viceice commented May 7, 2020

oh no, debug is enough, trace will flood

@nadar
Copy link
Author

nadar commented May 7, 2020

@viceice its a 1040 lines long logfile. Is there a certain part you are looking for?

I was searching for "automerge":

DEBUG: Checking if we can automerge branch (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: mergeStatus=no automerge (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Ensuring PR (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: There are 0 errors and 0 warnings (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: getBranchPr(renovate/luyadev-luya-bootstrap4-1.0.x) (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Got res with 1 results (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: getPr(27) (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: getBranchStatus(renovate/luyadev-luya-bootstrap4-1.0.x) (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Got res with 2 results (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Found existing PR (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: getBranchStatus(renovate/luyadev-luya-bootstrap4-1.0.x) (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Got res with 2 results (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Processing existing PR (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: getBranchStatus(renovate/luyadev-luya-bootstrap4-1.0.x) (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Got res with 2 results (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: getBranchStatus() result (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
"branchStatus": "green",
"branchName": "renovate/luyadev-luya-bootstrap4-1.0.x"
DEBUG: Merge Request #27 does not need updating (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Checking #27 for automerge (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
"automerge": true,
"automergeType": "pr",
"automergeComment": "automergeComment"
DEBUG: PR is configured for automerge (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: getBranchStatus(renovate/luyadev-luya-bootstrap4-1.0.x) (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Got res with 2 results (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: Automerging #27 (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: No permissions to merge PR (repository=__MY__REPO__, branch=renovate/luyadev-luya-bootstrap4-1.0.x)
DEBUG: processBranch with 1 upgrades (repository=__MY__REPO__, dependencies=tecnickcom/tcpdf, branch=renovate/tecnickcom-tcpdf-6.2.x)
DEBUG: Setting baseBranch to master (repository=__MY__REPO__, branch=renovate/tecnickcom-tcpdf-6.2.x)
DEBUG: Setting baseBranch to master (repository=__MY__REPO__, branch=renovate/tecnickcom-tcpdf-6.2.x)
DEBUG: latest commit (repository=__MY__REPO__, branch=renovate/tecnickcom-tcpdf-6.2.x)
"branchName": "master",

@nadar
Copy link
Author

nadar commented May 7, 2020

No permissions to merge PR

😱 Thanks for the help @viceice

Maybe it helps someone else googling for this topic:

Ensure the renovate access token has write_repository permission on GitLab.

@nadar nadar closed this as completed May 7, 2020
@viceice
Copy link
Member

viceice commented May 7, 2020

@rarkins Maybe we should throw an automerge failure if we have no permission to merge? Or at lease add a comment

@nadar
Copy link
Author

nadar commented May 7, 2020

Instead of Automerge: enable i would suggest Automerge: enable but no permissions to merge. Or a comment would be good to.

ps: I updated my token and its not yet auto merged, need to debug once more.

@rarkins
Copy link
Collaborator

rarkins commented May 7, 2020

I think adding a MR comment would work best.

FWIW I'm not sure how Renovate could create the branch in the first place if write_repository wasn't enabled. Perhaps it got the permission from elsewhere? If so then it's not the solution, so reopening.

@rarkins rarkins reopened this May 7, 2020
@nadar
Copy link
Author

nadar commented May 7, 2020

I found another permission "hole" (:smile:), make sure the user within this group has either write permission for the given repository or role "Maintainer" within the group. Otherwise this user is not able to merge. This fixes the problem.

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

No branches or pull requests

3 participants