Renovate: [GitLab] prConcurrentLimit does not work

Created on 29 May 2019  ·  11Comments  ·  Source: renovatebot/renovate

What Renovate type are you using?

I'm using renovate as a dependency in a package.json and run the CLI from there as a script.

Describe the bug

I set prConcurrentLimit to 2 for example. But Renovate opens in one repository 3, in an other repository 111 and in an other repository 55 merge requests and so on.

Did you see anything helpful in debug logs?

I can see that renovate first creates the merge requests and after that it shows following in the logs:

DEBUG: Enforcing prConcurrentLimit (2) (repository=me/test)
DEBUG: 35 PRs are currently open (repository=me/test)
DEBUG: PR concurrent limit remaining: -33 (repository=me/test)

To Reproduce

That's my main problem because we are running on a company internal GitLab self hosted instance so I can't give you a repository to reproduce. Just logs if you need.

Expected behavior

It should just create 2 merge requests (or any number given to prConcurrentLimit)

Screenshots

I just could send you an screenshot with 111 open merge requests 😁

Additional context

This is my renovate configuration file:

"use strict";

module.exports = {
  extends: ["group:monorepos"],
  endpoint: "https://gitlab.foo.bar/api/v4/",
  platform: "gitlab",
  requireConfig: false,
  gitAuthor: "Mario <[email protected]>",
  onboarding: false,
  enabledManagers: ["npm"],
  semanticCommits: false,
  automerge: false,
  rebaseStalePrs: false,
  labels: ["renovate"],
  updateNotScheduled: true,
  lockFileMaintenance: { enabled: true },
  commitMessagePrefix: "⬆️ ",
  prConcurrentLimit: 2,
  trustLevel: "high",
  logLevel: "debug",
  repositories: ["my/first-project", "my/second-project"]
};

and I'm using renovate v17.16.5 at the moment

Most helpful comment

the pr limits actually apply to branch creation and not PR creation

Ah! That was it. It works now. Awesome! 🎉 👍

  1. I let Renovate run on the repositories without any restrictions ➡️ hundreds of merge requests were created
  2. I deleted every merge request
  3. I set the prConcurrentLimit to 2 and let Renovate run once again
  4. hundreds of merge requests were created again because the branches were still there, but not the merge requests

So this is really confusing to be honest 😅 Maybe this should be documented somewhere on your already good documentation. What do you think?

All 11 comments

Do you have a log from when it created the extra? It’s too late after to enforce limits so the log given doesn’t help me understand

I tested against gitlab.com just now and the prConcurrentLimit setting seems to work fine. Example log message when PR#3 is attempted:

 INFO: Processing 3 branches: renovate/chalk-2.x, renovate/renovate-17.x, renovate/rollback-left-pad-1.x
DEBUG: Enforcing prConcurrentLimit (2)
DEBUG: 0 PRs are currently open
DEBUG: PR concurrent limit remaining: 2
...
 INFO: Reached PR creation limit - skipping branch creation

Unless you can reproduce it using gitlab.com - including logs - I don't think there's any bug here. Please always retain your logs if you are in the early stages of using Renovate.

According to your log, Renovate is correctly detecting what the limit is.

FYI:

  • The concurrent limit is per-repo and not pr-bot
  • Renovate will not close PRs after you add the limit. The limit only impacts when it creates them (i.e. see log above).

I created a gist for you where you can see the complete debug log from renovate ☺️ As you can see on line 10919 it says that 3 PRs are currently open and that the remaining ones are -1. Unfortunately renovate created this 3 PRs immediately before it showed this message.

The concurrent limit is per-repo and not pr-bot

Yes, I already know that. Thanks 👍

Renovate will not close PRs after you add the limit

Same here. All of our repos didn't had any open merge requests.

It really does not look like Renovate created those 3 in the same run. I’m reading from mobile but can’t see anything. On what line of the gist did it create PRs?

here, here and here

In this test repository it creates 3 instead of 2. In other repositories even more.

Thank you for linking but on mobile it doesn’t work for me. Can you give line numbers instead?

11507
11587
11738

Although it’s a bit confusing, the pr limits actually apply to branch creation and not PR creation. By default they’re created at the same time but there are also configuration options that let you separate branch and PR creation times.

Line 11456 shows that the branch already existed. Do you know why branches were created on previous runs but not PRs?

the pr limits actually apply to branch creation and not PR creation

Ah! That was it. It works now. Awesome! 🎉 👍

  1. I let Renovate run on the repositories without any restrictions ➡️ hundreds of merge requests were created
  2. I deleted every merge request
  3. I set the prConcurrentLimit to 2 and let Renovate run once again
  4. hundreds of merge requests were created again because the branches were still there, but not the merge requests

So this is really confusing to be honest 😅 Maybe this should be documented somewhere on your already good documentation. What do you think?

Of you had used “config:base” preset it limits to 2 per hour and 20 concurrent so could have saved some pain.

I’ve been thinking whether to rename or redesign the feature now that branch and PR creation are potentially separate. But maybe in the meantime some better docs would help..

👍
Thank you for your help!

Was this page helpful?
0 / 5 - 0 ratings