renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.41k stars 2.28k forks source link

Renovate removes GitLab approval rules independently of automerge option #31354

Open viceice opened 1 month ago

viceice commented 1 month ago

Discussed in https://github.com/renovatebot/renovate/discussions/31353

Originally posted by **nc-igad** September 12, 2024 ### What would you like help with? I think I found a bug ### How are you running Renovate? Self-hosted ### If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate. GitLab ### Please tell us more about your question or problem Hi! We recently upgraded our renovate version. After the upgrade, we saw that renovate started removing the approval rules on all merge requests independently of the value of `automerge`. The issue occurs starting from v37.421.7, I think this was introduced by this code change https://github.com/renovatebot/renovate/pull/29972. **Example project configuration** The renovate.json file of the project looks similar to this: ``` { "platformAutomerge": true, "gitLabIgnoreApprovals": true, "automergeType": "pr", "packageRules": [ { "matchPackageNames": ["/azure/"], "automerge": true, } ] } ``` **Expected behavior** Renovate removes the approval rules on the new merge requests for azure packages only as automerge is enabled for them. All other merge requests are created with the projects default approval rules. **Actual behavior** Renovate creates the new merge requests and removes the approval rules on all of them.
tom-mi commented 2 weeks ago

I think I have a similar issue (not sure if it is related though), using a glob rather than a regex. I want to disable automerge for a specific package prefix & tried configs like this:

{
  automerge: false,
  "packageRules": [
    {
      "matchPackageNames": [
        "!@foo-bar/**"
      ],
      "automerge": true
    }
  ]
}

and this:

{
  automerge: true,
  "packageRules": [
    {
      "matchPackageNames": [
        "@foo-bar/**"
      ],
      "automerge": false
    }
  ]
}

and neither had the expected result (the setting in the packageRules was always ignored).