Skip to content
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
1 change: 0 additions & 1 deletion lib/modules/platform/gerrit/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ describe('modules/platform/gerrit/client', () => {
'footer:Renovate-Branch=dependency-xyz',
{ branchName: 'dependency-xyz' },
],
['hashtag:sourceBranch-dependency-xyz', { branchName: 'dependency-xyz' }], // for backwards compatibility
['label:Code-Review=-2', { branchName: 'dependency-xyz', label: '-2' }],
[
'branch:otherTarget',
Expand Down
11 changes: 1 addition & 10 deletions lib/modules/platform/gerrit/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,7 @@ class GerritClient {
const filterState = mapPrStateToGerritFilter(searchConfig.state);
const filters = ['owner:self', 'project:' + repository, filterState];
if (searchConfig.branchName) {
filters.push(
...[
'(',
`footer:Renovate-Branch=${searchConfig.branchName}`,
// for backwards compatibility
'OR',
`hashtag:sourceBranch-${searchConfig.branchName}`,
')',
],
);
filters.push(`footer:Renovate-Branch=${searchConfig.branchName}`);
}
if (searchConfig.targetBranch) {
filters.push(`branch:${searchConfig.targetBranch}`);
Expand Down
6 changes: 0 additions & 6 deletions lib/modules/platform/gerrit/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ Support for Gerrit is currently _experimental_, meaning that it _might_ still ha

Renovate stores its metadata in the _commit message footer_.

Previously Renovate stored metadata in Gerrit's _hashtags_.
To keep backwards compatibility, Renovate still reads metadata from hashtags.
But Renovate _always_ puts its metadata in the _commit message footer_!
When the Renovate maintainers mark Gerrit support as stable, the maintainers will remove the "read metadata from hashtags" feature.
This means changes without metadata in the commit message footer will be "forgotten" by Renovate.

## Authentication

<figure markdown>
Expand Down
4 changes: 0 additions & 4 deletions lib/modules/platform/gerrit/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ export type GerritReviewersType = 'REVIEWER' | 'CC' | 'REMOVED';

export interface GerritChange {
branch: string;
/**
* for backwards compatibility
*/
hashtags?: string[];
change_id: string;
subject: string;
status: GerritChangeStatus;
Expand Down
41 changes: 0 additions & 41 deletions lib/modules/platform/gerrit/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,47 +184,6 @@ describe('modules/platform/gerrit/utils', () => {
});
expect(utils.extractSourceBranch(change)).toBe('renovate/dependency-1.x');
});

// for backwards compatibility
it('no commit message but with hashtags', () => {
const change = partial<GerritChange>({
hashtags: ['sourceBranch-renovate/dependency-1.x'],
});
expect(utils.extractSourceBranch(change)).toBe('renovate/dependency-1.x');
});

// for backwards compatibility
it('commit message with no footer but with hashtags', () => {
const change = partial<GerritChange>({
hashtags: ['sourceBranch-renovate/dependency-1.x'],
current_revision: 'abc',
revisions: {
abc: partial<GerritRevisionInfo>({
commit: {
message: 'some message...',
},
}),
},
});
expect(utils.extractSourceBranch(change)).toBe('renovate/dependency-1.x');
});

// for backwards compatibility
it('prefers the footer over the hashtags', () => {
const change = partial<GerritChange>({
hashtags: ['sourceBranch-renovate/dependency-1.x'],
current_revision: 'abc',
revisions: {
abc: partial<GerritRevisionInfo>({
commit: {
message:
'Some change\n\nRenovate-Branch: renovate/dependency-2.x\nChange-Id: ...',
},
}),
},
});
expect(utils.extractSourceBranch(change)).toBe('renovate/dependency-2.x');
});
});

describe('findPullRequestBody()', () => {
Expand Down
5 changes: 0 additions & 5 deletions lib/modules/platform/gerrit/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ export function extractSourceBranch(change: GerritChange): string | undefined {
}
}

// for backwards compatibility
sourceBranch ??= change.hashtags
?.find((tag) => tag.startsWith('sourceBranch-'))
?.replace('sourceBranch-', '');

return sourceBranch ?? undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
"@types/json-dup-key-validator": "1.0.2",
"@types/linkify-markdown": "1.0.3",
"@types/lodash": "4.17.16",
"@types/luxon": "3.6.0",
"@types/luxon": "3.6.1",
"@types/markdown-it": "14.1.2",
"@types/markdown-table": "2.0.0",
"@types/marshal": "0.5.3",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading