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(gitlab): filter issues for ignorePrAuthor #28996

Merged
merged 2 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2060,9 +2060,12 @@ Applicable for Composer only for now.
## ignorePrAuthor

This is usually needed if someone needs to migrate bot accounts, including from the Mend Renovate App to self-hosted.
An additional use case is for GitLab users of project or group access tokens who need to rotate them.

If `ignorePrAuthor` is configured to true, it means Renovate will fetch the entire list of repository PRs instead of optimizing to fetch only those PRs which it created itself.
You should only want to enable this if you are changing the bot account (e.g. from `@old-bot` to `@new-bot`) and want `@new-bot` to find and update any existing PRs created by `@old-bot`.
It's recommended to revert this setting once that transition period is over and all old PRs are resolved.

Setting this field to `true` in GitLab will also mean that all Issues will be fetched instead of only those by the bot itself.

## ignorePresets

Expand Down
9 changes: 6 additions & 3 deletions lib/modules/platform/gitlab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1069,11 +1069,14 @@ export async function setBranchStatus({

export async function getIssueList(): Promise<GitlabIssue[]> {
if (!config.issueList) {
const query = getQueryString({
const searchParams: Record<string, string> = {
per_page: '100',
scope: 'created_by_me',
state: 'opened',
});
};
if (!config.ignorePrAuthor) {
searchParams.scope = 'created_by_me';
}
const query = getQueryString(searchParams);
const res = await gitlabApi.getJson<
{ iid: number; title: string; labels: string[] }[]
>(`projects/${config.repository}/issues?${query}`, {
Expand Down