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

Renovate removes GitLab approval rules independently of automerge option #31354

Open
viceice opened this issue Sep 12, 2024 Discussed in #31353 · 1 comment
Open

Renovate removes GitLab approval rules independently of automerge option #31354

viceice opened this issue Sep 12, 2024 Discussed in #31353 · 1 comment
Labels
core:automerge Relating to Renovate's automerge capabilities platform:gitlab GitLab Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality

Comments

@viceice
Copy link
Member

viceice commented Sep 12, 2024

Discussed in #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 #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.

@viceice viceice added type:bug Bug fix of existing functionality priority-2-high Bugs impacting wide number of users or very important features platform:gitlab GitLab Platform core:automerge Relating to Renovate's automerge capabilities labels Sep 12, 2024
rarkins added a commit that referenced this issue Oct 1, 2024
Fixes #31354

Move the logic for ignoring approvals from the `tryPrAutomerge` function into the `createPr` function.

* Update the `createPr` function to call `ignoreApprovals` only for merge requests with `automerge` enabled.
* Add tests in `lib/config/migrate-validate.spec.ts` to verify that approval rules are not removed for merge requests without `automerge` enabled.
* Add tests in `lib/config/presets/gitlab/index.spec.ts` to verify that approval rules are removed for merge requests with `automerge` enabled and not removed for merge requests without `automerge` enabled.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/renovatebot/renovate/issues/31354?shareId=XXXX-XXXX-XXXX-XXXX).
@tom-mi

This comment was marked as off-topic.

@rarkins rarkins added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others and removed priority-2-high Bugs impacting wide number of users or very important features labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core:automerge Relating to Renovate's automerge capabilities platform:gitlab GitLab Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants