Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Dec 29, 2024
1 parent 74137a8 commit b93ee7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/modules/platform/gerrit/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { REPOSITORY_ARCHIVED } from '../../../constants/error-messages';
import { logger } from '../../../logger';
import { GerritHttp } from '../../../util/http/gerrit';
import { regEx } from '../../../util/regex';
import { getQueryString } from '../../../util/url';
import type {
GerritAccountInfo,
GerritBranchInfo,
Expand Down Expand Up @@ -77,8 +78,9 @@ class GerritClient {
extraOptions?: string[],
): Promise<GerritChange> {
const options = [...this.requestDetails, ...(extraOptions ?? [])];
const queryString = getQueryString({ o: options });
const changes = await this.gerritHttp.getJson<GerritChange>(
`a/changes/${changeNumber}?` + options.map((det) => `o=${det}`).join('&'),
`a/changes/${changeNumber}?${queryString}`,
);
return changes.body;
}
Expand Down Expand Up @@ -203,7 +205,7 @@ class GerritClient {
const reviewLabel = change?.labels?.['Code-Review'];
return (
reviewLabel === undefined ||
Boolean(reviewLabel.all?.some((label) => label.value === 2))
reviewLabel.all?.some((label) => label.value === 2) === true
);
}

Expand Down
1 change: 0 additions & 1 deletion lib/workers/repository/update/pr/automerge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ describe('workers/repository/update/pr/automerge', () => {
config.autoApprove = true;
config.automerge = true;
config.pruneBranchAfterAutomerge = true;
platform.approvePrForAutomerge.mockResolvedValueOnce();
platform.getBranchStatus.mockResolvedValueOnce('green');
platform.mergePr.mockResolvedValueOnce(true);
const res = await prAutomerge.checkAutoMerge(pr, config);
Expand Down

0 comments on commit b93ee7a

Please sign in to comment.