Skip to content

Commit

Permalink
fix(maven): Return isPrivate flag for default repo (#31061)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Aug 28, 2024
1 parent c3d4cc0 commit 523d80e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ exports[`modules/datasource/clojure/index returns releases from custom repositor
"display": "org.example:package",
"group": "org.example",
"homepage": "https://package.example.org/about",
"isPrivate": true,
"name": "package",
"packageScope": "org.example",
"registryUrl": "https://custom.registry.renovatebot.com",
Expand Down
2 changes: 2 additions & 0 deletions lib/modules/datasource/maven/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ exports[`modules/datasource/maven/index removes authentication header after redi
"display": "org.example:package",
"group": "org.example",
"homepage": "https://package.example.org/about",
"isPrivate": true,
"name": "package",
"packageScope": "org.example",
"registryUrl": "https://frontend_for_private_s3_repository/maven2",
Expand Down Expand Up @@ -118,6 +119,7 @@ exports[`modules/datasource/maven/index returns releases from custom repository
"display": "org.example:package",
"group": "org.example",
"homepage": "https://package.example.org/about",
"isPrivate": true,
"name": "package",
"packageScope": "org.example",
"registryUrl": "https://custom.registry.renovatebot.com",
Expand Down
2 changes: 2 additions & 0 deletions lib/modules/datasource/maven/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ describe('modules/datasource/maven/index', () => {
{ version: '1.0.5-SNAPSHOT' },
{ version: '2.0.0' },
],
isPrivate: true,
});
expect(googleAuth).toHaveBeenCalledTimes(5);
});
Expand Down Expand Up @@ -552,6 +553,7 @@ describe('modules/datasource/maven/index', () => {
{ version: '1.0.5-SNAPSHOT' },
{ version: '2.0.0' },
],
isPrivate: true,
});
expect(googleAuth).toHaveBeenCalledTimes(5);
});
Expand Down
12 changes: 11 additions & 1 deletion lib/modules/datasource/maven/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,16 @@ export class MavenDatasource extends Datasource {
latestSuitableVersion,
));

return { ...dependency, ...dependencyInfo, releases };
const result: ReleaseResult = {
...dependency,
...dependencyInfo,
releases,
};

if (!this.defaultRegistryUrls.includes(registryUrl)) {
result.isPrivate = true;
}

return result;
}
}
1 change: 1 addition & 0 deletions lib/modules/datasource/maven/s3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ describe('modules/datasource/maven/s3', () => {
{ version: '1.0.2' },
{ version: '1.0.3', releaseTimestamp: '2020-01-01T00:00:00.000Z' },
],
isPrivate: true,
});
});

Expand Down

0 comments on commit 523d80e

Please sign in to comment.