Skip to content

Commit 5dcd683

Browse files
alan-agius4josephperrott
authored andcommitted
ci: update MODULE.bazel.lock and refine update strategy (#2978)
Adds a Renovate postUpdateTask to automatically update `MODULE.bazel.lock` and resolves an outstanding issue with Bazel lockfile support. Reduces dependency updates on non-main branches to only Bazel, GitHub Actions, and cross-repository updates. This change aims to reduce friction and improve the caretaker workflow. PR Close #2978
1 parent b2f3a85 commit 5dcd683

File tree

1 file changed

+44
-14
lines changed

1 file changed

+44
-14
lines changed

renovate-presets/default.json5

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,43 @@
3636
'yarn', // Yarn is copied locally in all repositories where needed.
3737
],
3838

39+
// Renovate does not update Bazel lockfile for the time being.
40+
// Workaround for https://github.com/renovatebot/renovate/issues/25557
41+
postUpgradeTasks: {
42+
commands: [
43+
'git restore .npmrc || true', // In case `.npmrc` avoid a hard error.
44+
'pnpm install --frozen-lockfile',
45+
'pnpm bazel mod deps --lockfile_mode=update',
46+
],
47+
executionMode: 'branch',
48+
},
49+
3950
packageRules: [
4051
// ============================================================================
4152
// GENERAL GROUPING & UPDATE BEHAVIOR
4253
// ============================================================================
4354

44-
// Group all non-major updates (minor and patch) together
55+
// Disable 'postUpdateTasks' for changes that do not effect the BAZEL lockfile or generated files.
56+
{
57+
postUpgradeTasks: {commands: []},
58+
matchManagers: ['!npm', '!bazel', '!bazel-module', '!bazelisk'],
59+
},
60+
61+
// Rule to disable NPM updates on branches other than 'main'.
62+
// But allow updating engines and packageManagers.
63+
{
64+
enabled: false,
65+
matchBaseBranches: ['!main'],
66+
matchDepNames: ['!node', '!pnpm', '!npm', '!yarn'],
67+
matchManagers: ['npm'],
68+
},
69+
70+
// Group all non-major dependencies together for updates.
4571
{
4672
groupName: 'all non-major dependencies',
4773
matchDepNames: ['*', '!node', '!pnpm', '!npm', '!yarn'],
4874
matchUpdateTypes: ['digest', 'patch', 'minor'],
75+
matchManagers: ['npm'],
4976
},
5077

5178
// ============================================================================
@@ -55,7 +82,13 @@
5582
// Group Bazel updates
5683
{
5784
groupName: 'bazel dependencies',
58-
matchManagers: ['bazel'],
85+
matchManagers: ['bazel', 'bazel-module'],
86+
},
87+
88+
// Group GitHub Actions workflow
89+
{
90+
groupName: 'all github actions',
91+
matchManagers: ['github-actions'],
5992
},
6093

6194
// ============================================================================
@@ -64,6 +97,7 @@
6497

6598
// Group updates related to Angular ecosystem across repositories
6699
{
100+
enabled: true, // Enable NPM updates of cross-repo dependencies on all branches.
67101
groupName: 'cross-repo angular dependencies',
68102
followTag: 'next',
69103
separateMajorMinor: false,
@@ -107,17 +141,6 @@
107141
schedule: ['on sunday and wednesday'],
108142
},
109143

110-
// ============================================================================
111-
// WORKFLOW-SPECIFIC UPDATE RULES
112-
// ============================================================================
113-
114-
// Group dependencies in the scorecard GitHub Actions workflow
115-
{
116-
groupName: 'scorecard action dependencies',
117-
matchFileNames: ['.github/workflows/scorecard.yml'],
118-
matchDepNames: ['*'],
119-
},
120-
121144
// ============================================================================
122145
// EXCLUSION RULES
123146
// ============================================================================
@@ -134,7 +157,7 @@
134157
matchDepNames: [
135158
'@types/node',
136159
'node',
137-
'bazel', // bazelisk bazel verison
160+
'bazel', // bazelisk bazel version
138161
'npm',
139162
'rxjs',
140163
'tslib',
@@ -149,5 +172,12 @@
149172
matchDepNames: ['typescript'],
150173
matchUpdateTypes: ['major', 'minor'],
151174
},
175+
176+
// Rule to disable major updates on branches other than 'main'.
177+
{
178+
enabled: false,
179+
matchBaseBranches: ['!main'],
180+
matchUpdateTypes: ['major'],
181+
},
152182
],
153183
}

0 commit comments

Comments
 (0)