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

feat(manager/gradle): Use dependencies task when generating verification metadata #29602

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
8 changes: 4 additions & 4 deletions lib/modules/manager/gradle/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ describe('modules/manager/gradle/artifacts', () => {
]);
expect(execSnapshots).toMatchObject([
{
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256 help',
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256 dependencies',
options: {
cwd: '/tmp/github/some/repo',
stdio: ['pipe', 'ignore', 'pipe'],
Expand Down Expand Up @@ -662,7 +662,7 @@ describe('modules/manager/gradle/artifacts', () => {
},
},
{
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256 help',
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256 dependencies',
options: {
cwd: '/tmp/github/some/repo',
stdio: ['pipe', 'ignore', 'pipe'],
Expand Down Expand Up @@ -705,7 +705,7 @@ describe('modules/manager/gradle/artifacts', () => {

expect(execSnapshots).toMatchObject([
{
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256 help',
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256 dependencies',
options: {
cwd: '/tmp/github/some/repo',
stdio: ['pipe', 'ignore', 'pipe'],
Expand Down Expand Up @@ -747,7 +747,7 @@ describe('modules/manager/gradle/artifacts', () => {

expect(execSnapshots).toMatchObject([
{
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256,pgp help',
cmd: './gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256,pgp dependencies',
options: {
cwd: '/tmp/github/some/repo',
stdio: ['pipe', 'ignore', 'pipe'],
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/gradle/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async function buildUpdateVerificationMetadataCmd(
if (!hashTypes.length) {
return null;
}
return `${baseCmd} --write-verification-metadata ${hashTypes.join(',')} help`;
return `${baseCmd} --write-verification-metadata ${hashTypes.join(',')} dependencies`;
}

export async function updateArtifacts({
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/gradle/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ As the output of these commands can be very large, any text other than errors (i

### Dependency verification

If Renovate finds a `gradle/verification-metadata.xml` file, it updates the content by using the `gradle --write-verification-metadata <hashTypes>` command.
If Renovate finds a `gradle/verification-metadata.xml` file, it updates the content by using the `gradle --write-verification-metadata <hashTypes> dependencies` command.
Renovate will check the file for existing hash types (like `sha256`) and use them as `<hashTypes>`.

<!-- prettier-ignore -->
Expand Down