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(datasource/maven): make cache key extractedVersion specific #32658

Merged
merged 3 commits into from
Nov 21, 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
15 changes: 15 additions & 0 deletions lib/modules/datasource/maven/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,21 @@ describe('modules/datasource/maven/index', () => {
expect(res).toBe(releaseOrig);
});

it('returns original value for 200 response with versionOrig', async () => {
httpMock
.scope(MAVEN_REPO)
.head('/foo/bar/1.2.3/bar-1.2.3.pom')
.reply(200);
const releaseOrig: Release = { version: '1.2', versionOrig: '1.2.3' };

const res = await postprocessRelease(
{ datasource, packageName: 'foo:bar', registryUrl: MAVEN_REPO },
releaseOrig,
);

expect(res).toBe(releaseOrig);
});

it('returns original value for invalid configs', async () => {
const releaseOrig: Release = { version: '1.2.3' };
expect(
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 @@ -254,7 +254,7 @@ export class MavenDatasource extends Datasource {
{ registryUrl, packageName }: PostprocessReleaseConfig,
{ version, versionOrig }: Release,
) =>
`postprocessRelease:${registryUrl}:${packageName}:${versionOrig ?? version}`,
`postprocessRelease:${registryUrl}:${packageName}:${versionOrig ? `${versionOrig}:${version}` : `${version}`}`,
ttlMinutes: 24 * 60,
})
override async postprocessRelease(
Expand Down