Skip to content

Commit f34968f

Browse files
committed
Merge branch 'main' of https://github.com/renovatebot/renovate into gerrit-labels-as-hashtags
2 parents 28c16e4 + 22b232d commit f34968f

File tree

27 files changed

+714
-248
lines changed

27 files changed

+714
-248
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ jobs:
389389
done
390390
391391
- name: Move coverage files
392-
if: (success() || failure()) && github.event.pull_request.draft != true && matrix.coverage
392+
if: success() && github.event.pull_request.draft != true && matrix.coverage
393393
run: |
394394
mkdir -p ./coverage/lcov
395395
mkdir -p ./coverage/json
@@ -400,7 +400,7 @@ jobs:
400400
done
401401
402402
- name: Save coverage artifacts
403-
if: (success() || failure()) && github.event.pull_request.draft != true && matrix.coverage
403+
if: success() && github.event.pull_request.draft != true && matrix.coverage
404404
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
405405
with:
406406
name: ${{ matrix.upload-artifact-name }}
@@ -412,7 +412,7 @@ jobs:
412412
needs: [test]
413413
runs-on: ubuntu-latest
414414
timeout-minutes: 3
415-
if: (success() || failure()) && github.event_name != 'merge_group' && github.event.pull_request.draft != true
415+
if: success() && github.event_name != 'merge_group' && github.event.pull_request.draft != true
416416
steps:
417417
- name: Checkout code
418418
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -441,7 +441,7 @@ jobs:
441441
- setup-build
442442
runs-on: ubuntu-latest
443443
timeout-minutes: 3
444-
if: (success() || failure()) && github.event.pull_request.draft != true
444+
if: success() && github.event.pull_request.draft != true
445445
steps:
446446
- name: Checkout code
447447
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -705,7 +705,7 @@ jobs:
705705
show-progress: false
706706

707707
- name: docker-config
708-
uses: containerbase/internal-tools@82eae9bb384849f340bbf269d995aa7badc4aa13 # v3.10.41
708+
uses: containerbase/internal-tools@e9586b5ff433686becf57ffa6eead0c7a2854f64 # v3.10.42
709709
with:
710710
command: docker-config
711711

lib/config/presets/internal/workarounds.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const presets: Record<string, Preset> = {
1818
'workarounds:supportRedHatImageVersion',
1919
'workarounds:javaLTSVersions',
2020
'workarounds:disableEclipseLifecycleMapping',
21+
'workarounds:disableGradleReplacements',
2122
'workarounds:disableMavenParentRoot',
2223
'workarounds:containerbase',
2324
'workarounds:bitnamiDockerImageVersioning',
@@ -69,6 +70,16 @@ export const presets: Record<string, Preset> = {
6970
},
7071
],
7172
},
73+
disableGradleReplacements: {
74+
description: 'Disable package replacement updates for gradle dependencies.',
75+
packageRules: [
76+
{
77+
enabled: false,
78+
matchManagers: ['gradle'],
79+
matchUpdateTypes: ['replacement'],
80+
},
81+
],
82+
},
7283
disableMavenParentRoot: {
7384
description:
7485
'Avoid version fetching for Maven packages detected as project root.',

lib/modules/manager/bazel-module/extract.spec.ts

Lines changed: 65 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ describe('modules/manager/bazel-module/extract', () => {
6262
remote = "https://github.com/example/rules_foo.git",
6363
)
6464
`;
65+
6566
const result = await extractPackageFile(input, 'MODULE.bazel');
66-
if (!result) {
67-
throw new Error('Expected a result.');
68-
}
6967

7068
expect(result).toEqual({
7169
deps: [
@@ -102,10 +100,8 @@ describe('modules/manager/bazel-module/extract', () => {
102100
remote = "https://github.com/example/rules_foo.git",
103101
)
104102
`;
103+
105104
const result = await extractPackageFile(input, 'MODULE.bazel');
106-
if (!result) {
107-
throw new Error('Expected a result.');
108-
}
109105
expect(result).toEqual({
110106
deps: [
111107
{
@@ -128,10 +124,8 @@ describe('modules/manager/bazel-module/extract', () => {
128124
it('returns dependencies and custom registry URLs when specified in a bazelrc', async () => {
129125
const packageFile = 'extract/multiple-bazelrcs/MODULE.bazel';
130126
const input = Fixtures.get(packageFile);
127+
131128
const result = await extractPackageFile(input, packageFile);
132-
if (!result) {
133-
throw new Error('Expected a result.');
134-
}
135129
expect(result).toEqual({
136130
registryUrls: [
137131
'https://example.com/custom_registry.git',
@@ -158,10 +152,8 @@ describe('modules/manager/bazel-module/extract', () => {
158152
],
159153
)
160154
`;
155+
161156
const result = await extractPackageFile(input, 'MODULE.bazel');
162-
if (!result) {
163-
throw new Error('Expected a result.');
164-
}
165157

166158
expect(result).toEqual({
167159
deps: [
@@ -191,10 +183,8 @@ describe('modules/manager/bazel-module/extract', () => {
191183
],
192184
)
193185
`;
186+
194187
const result = await extractPackageFile(input, 'MODULE.bazel');
195-
if (!result) {
196-
throw new Error('Expected a result.');
197-
}
198188

199189
expect(result).toEqual({
200190
deps: [
@@ -221,10 +211,8 @@ describe('modules/manager/bazel-module/extract', () => {
221211
urls = "/path/to/repo",
222212
)
223213
`;
214+
224215
const result = await extractPackageFile(input, 'MODULE.bazel');
225-
if (!result) {
226-
throw new Error('Expected a result.');
227-
}
228216

229217
expect(result).toEqual({
230218
deps: [
@@ -252,10 +240,8 @@ describe('modules/manager/bazel-module/extract', () => {
252240
urls = "/path/to/repo",
253241
)
254242
`;
243+
255244
const result = await extractPackageFile(input, 'MODULE.bazel');
256-
if (!result) {
257-
throw new Error('Expected a result.');
258-
}
259245

260246
expect(result).toEqual({
261247
deps: [
@@ -283,10 +269,8 @@ describe('modules/manager/bazel-module/extract', () => {
283269
registry = "https://example.com/custom_registry",
284270
)
285271
`;
272+
286273
const result = await extractPackageFile(input, 'MODULE.bazel');
287-
if (!result) {
288-
throw new Error('Expected a result.');
289-
}
290274

291275
expect(result).toEqual({
292276
deps: [
@@ -318,10 +302,8 @@ describe('modules/manager/bazel-module/extract', () => {
318302
registry = "https://example.com/custom_registry",
319303
)
320304
`;
305+
321306
const result = await extractPackageFile(input, 'MODULE.bazel');
322-
if (!result) {
323-
throw new Error('Expected a result.');
324-
}
325307

326308
expect(result).toEqual({
327309
deps: [
@@ -351,10 +333,8 @@ describe('modules/manager/bazel-module/extract', () => {
351333
registry = "https://example.com/custom_registry",
352334
)
353335
`;
336+
354337
const result = await extractPackageFile(input, 'MODULE.bazel');
355-
if (!result) {
356-
throw new Error('Expected a result.');
357-
}
358338

359339
expect(result).toEqual({
360340
deps: [
@@ -412,10 +392,8 @@ describe('modules/manager/bazel-module/extract', () => {
412392
version_conflict_policy = "pinned",
413393
)
414394
`;
395+
415396
const result = await extractPackageFile(input, 'MODULE.bazel');
416-
if (!result) {
417-
throw new Error('Expected a result.');
418-
}
419397

420398
expect(result).toEqual({
421399
deps: [
@@ -459,9 +437,6 @@ describe('modules/manager/bazel-module/extract', () => {
459437
`;
460438

461439
const result = await extractPackageFile(input, 'MODULE.bazel');
462-
if (!result) {
463-
throw new Error('Expected a result.');
464-
}
465440

466441
expect(result).toEqual({
467442
deps: [
@@ -498,9 +473,6 @@ describe('modules/manager/bazel-module/extract', () => {
498473
`;
499474

500475
const result = await extractPackageFile(input, 'MODULE.bazel');
501-
if (!result) {
502-
throw new Error('Expected a result.');
503-
}
504476

505477
expect(result).toEqual({
506478
deps: [
@@ -542,10 +514,8 @@ describe('modules/manager/bazel-module/extract', () => {
542514
version_conflict_policy = "pinned",
543515
)
544516
`;
517+
545518
const result = await extractPackageFile(input, 'MODULE.bazel');
546-
if (!result) {
547-
throw new Error('Expected a result.');
548-
}
549519

550520
expect(result).toEqual({
551521
deps: [
@@ -575,24 +545,72 @@ describe('modules/manager/bazel-module/extract', () => {
575545
});
576546
});
577547

578-
it('returns git_repository dependencies', async () => {
548+
it('returns git_repository dependencies with digest', async () => {
579549
const input = codeBlock`
580550
git_repository(
551+
name = "rules_foo",
552+
commit = "850cb49c8649e463b80ef7984e7c744279746170",
553+
remote = "https://github.com/example/rules_foo.git"
554+
)
555+
`;
556+
557+
const result = await extractPackageFile(input, 'MODULE.bazel');
558+
559+
expect(result).toEqual({
560+
deps: [
561+
{
562+
depType: 'git_repository',
563+
depName: 'rules_foo',
564+
currentDigest: '850cb49c8649e463b80ef7984e7c744279746170',
565+
datasource: GithubTagsDatasource.id,
566+
packageName: 'example/rules_foo',
567+
},
568+
],
569+
});
570+
});
571+
572+
it('returns git_repository dependencies with tag', async () => {
573+
const input = codeBlock`
574+
git_repository(
575+
name = "rules_foo",
576+
tag = "1.2.3",
577+
remote = "https://github.com/example/rules_foo.git"
578+
)
579+
`;
580+
581+
const result = await extractPackageFile(input, 'MODULE.bazel');
582+
583+
expect(result).toEqual({
584+
deps: [
585+
{
586+
depType: 'git_repository',
587+
depName: 'rules_foo',
588+
currentValue: '1.2.3',
589+
datasource: GithubTagsDatasource.id,
590+
packageName: 'example/rules_foo',
591+
},
592+
],
593+
});
594+
});
595+
596+
it('returns new_git_repository dependencies', async () => {
597+
const input = codeBlock`
598+
new_git_repository(
581599
name = "rules_foo",
582600
commit = "850cb49c8649e463b80ef7984e7c744279746170",
583601
remote = "https://github.com/example/rules_foo.git",
602+
tag = "1.2.3"
584603
)
585604
`;
605+
586606
const result = await extractPackageFile(input, 'MODULE.bazel');
587-
if (!result) {
588-
throw new Error('Expected a result.');
589-
}
590607

591608
expect(result).toEqual({
592609
deps: [
593610
{
594-
depType: 'git_repository',
611+
depType: 'new_git_repository',
595612
depName: 'rules_foo',
613+
currentValue: '1.2.3',
596614
currentDigest: '850cb49c8649e463b80ef7984e7c744279746170',
597615
datasource: GithubTagsDatasource.id,
598616
packageName: 'example/rules_foo',

lib/modules/manager/bazel-module/parser/rules.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const supportedRules = [
2020
'local_path_override',
2121
'single_version_override',
2222
'git_repository',
23+
'new_git_repository',
2324
];
2425
const supportedRulesRegex = regEx(`^${supportedRules.join('|')}$`);
2526

lib/modules/manager/bazel-module/rules.ts

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -239,24 +239,35 @@ export function toPackageDependencies(
239239
}
240240

241241
export const GitRepositoryToPackageDep = RuleFragmentSchema.extend({
242-
rule: z.literal('git_repository'),
242+
rule: z.union([z.literal('git_repository'), z.literal('new_git_repository')]),
243243
children: z.object({
244244
name: StringFragmentSchema,
245245
remote: StringFragmentSchema,
246-
commit: StringFragmentSchema,
246+
commit: StringFragmentSchema.optional(),
247+
tag: StringFragmentSchema.optional(),
247248
}),
248-
}).transform(({ rule, children: { name, remote, commit } }): BasePackageDep => {
249-
const gitRepo: BasePackageDep = {
250-
depType: rule,
251-
depName: name.value,
252-
currentDigest: commit.value,
253-
};
254-
const ghPackageName = githubPackageName(remote.value);
255-
if (is.nonEmptyString(ghPackageName)) {
256-
gitRepo.datasource = GithubTagsDatasource.id;
257-
gitRepo.packageName = ghPackageName;
258-
} else {
259-
gitRepo.skipReason = 'unsupported-datasource';
260-
}
261-
return gitRepo;
262-
});
249+
}).transform(
250+
({ rule, children: { name, remote, commit, tag } }): BasePackageDep => {
251+
const gitRepo: BasePackageDep = {
252+
depType: rule,
253+
depName: name.value,
254+
};
255+
256+
if (commit?.value) {
257+
gitRepo.currentDigest = commit.value;
258+
}
259+
260+
if (tag?.value) {
261+
gitRepo.currentValue = tag.value;
262+
}
263+
264+
const ghPackageName = githubPackageName(remote.value);
265+
if (is.nonEmptyString(ghPackageName)) {
266+
gitRepo.datasource = GithubTagsDatasource.id;
267+
gitRepo.packageName = ghPackageName;
268+
} else {
269+
gitRepo.skipReason = 'unsupported-datasource';
270+
}
271+
return gitRepo;
272+
},
273+
);

lib/modules/manager/bazel/__fixtures__/WORKSPACE1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ git_repository(
2828
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
2929
node_repositories(package_json = ["//:package.json"])
3030

31-
git_repository(
31+
new_git_repository(
3232
name = "build_bazel_rules_typescript",
3333
remote = "https://github.com/bazelbuild/rules_typescript.git",
3434
tag = "0.6.1",

lib/modules/manager/bazel/__snapshots__/extract.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ exports[`modules/manager/bazel/extract > extractPackageFile() > extracts multipl
4747
"currentValue": "0.6.1",
4848
"datasource": "github-releases",
4949
"depName": "build_bazel_rules_typescript",
50-
"depType": "git_repository",
50+
"depType": "new_git_repository",
5151
"managerData": {
5252
"idx": 4,
5353
},

0 commit comments

Comments
 (0)