Skip to content

Commit

Permalink
feat(maven)!: use hunt strategy for registries
Browse files Browse the repository at this point in the history
Switch from "merge" strategy to "hunt" strategy to match with how Maven works.

Closes #22744

BREAKING CHANGE: Maven datasource no longer checks all registries and instead stops when it finds a package in one registry.
  • Loading branch information
rarkins committed Sep 22, 2023
1 parent 3d7cf23 commit 3ee8cd4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
21 changes: 0 additions & 21 deletions lib/modules/datasource/maven/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,27 +277,6 @@ describe('modules/datasource/maven/index', () => {
expect(res).toMatchSnapshot();
});

it('collects releases from all registry urls', async () => {
mockGenericPackage({ html: null });
mockGenericPackage({
base: baseUrlCustom,
meta: Fixtures.get('metadata-extra.xml'),
latest: '3.0.0',
jars: { '3.0.0': 200 },
snapshots: [],
});

const res = await get('org.example:package', baseUrl, baseUrlCustom);

expect(res?.releases).toMatchObject([
{ version: '0.0.1' },
{ version: '1.0.0' },
{ version: '1.0.3-SNAPSHOT' },
{ version: '2.0.0' },
{ version: '3.0.0' },
]);
});

it('falls back to next registry url', async () => {
mockGenericPackage({ html: null });
httpMock
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/maven/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class MavenDatasource extends Datasource {

override readonly defaultVersioning: string = mavenVersioning.id;

override readonly registryStrategy: RegistryStrategy = 'merge';
override readonly registryStrategy: RegistryStrategy = 'hunt';

constructor(id = MavenDatasource.id) {
super(id);
Expand Down

0 comments on commit 3ee8cd4

Please sign in to comment.