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

fix(config): Remove usePlatformAutomerge restriction with gitLabIgnoreApprovals #29972

Merged
merged 4 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ Example:

Ignore the default project level approval(s), so that Renovate bot can automerge its merge requests, without needing approval(s).
Under the hood, it creates a MR-level approval rule where `approvals_required` is set to `0`.
This option works only when `automerge=true`, `automergeType=pr` or `automergeType=branch`, and `platformAutomerge=true`.
This option works only when `automerge=true` and either `automergeType=pr` or `automergeType=branch`.
Also, approval rules overriding should not be [prevented in GitLab settings](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/settings.html#prevent-editing-approval-rules-in-merge-requests).

## goGetDirs
Expand Down
14 changes: 7 additions & 7 deletions lib/modules/platform/gitlab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,12 @@ async function tryPrAutomerge(
pr: number,
platformOptions: PlatformPrOptions | undefined,
): Promise<void> {
if (platformOptions?.usePlatformAutomerge) {
try {
if (platformOptions?.gitLabIgnoreApprovals) {
await ignoreApprovals(pr);
}
try {
if (platformOptions?.gitLabIgnoreApprovals) {
await ignoreApprovals(pr);
}

if (platformOptions?.usePlatformAutomerge) {
// https://docs.gitlab.com/ee/api/merge_requests.html#merge-status
const desiredDetailedMergeStatus = [
'mergeable',
Expand Down Expand Up @@ -730,9 +730,9 @@ async function tryPrAutomerge(
}
await setTimeout(mergeDelay * attempt ** 2); // exponential backoff
}
} catch (err) /* istanbul ignore next */ {
logger.debug({ err }, 'Automerge on PR creation failed');
}
} catch (err) /* istanbul ignore next */ {
logger.debug({ err }, 'Automerge on PR creation failed');
}
}

Expand Down