Skip to content

Commit 54df9e4

Browse files
committed
ci: update MODULE.bazel.lock and refine update strategy
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.
1 parent d076ba5 commit 54df9e4

File tree

1 file changed

+45
-14
lines changed

1 file changed

+45
-14
lines changed

renovate-presets/default.json5

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,44 @@
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+
fileFilters: ['MODULE.bazel.lock'],
48+
executionMode: 'branch',
49+
},
50+
3951
packageRules: [
4052
// ============================================================================
4153
// GENERAL GROUPING & UPDATE BEHAVIOR
4254
// ============================================================================
4355

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

5179
// ============================================================================
@@ -55,7 +83,13 @@
5583
// Group Bazel updates
5684
{
5785
groupName: 'bazel dependencies',
58-
matchManagers: ['bazel'],
86+
matchManagers: ['bazel', 'bazel-module'],
87+
},
88+
89+
// Group GitHub Actions workflow
90+
{
91+
groupName: 'all github actions',
92+
matchManagers: ['github-actions'],
5993
},
6094

6195
// ============================================================================
@@ -64,6 +98,7 @@
6498

6599
// Group updates related to Angular ecosystem across repositories
66100
{
101+
enabled: true, // Enable NPM updates of cross-repo dependencies on all branches.
67102
groupName: 'cross-repo angular dependencies',
68103
followTag: 'next',
69104
separateMajorMinor: false,
@@ -107,17 +142,6 @@
107142
schedule: ['on sunday and wednesday'],
108143
},
109144

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-
121145
// ============================================================================
122146
// EXCLUSION RULES
123147
// ============================================================================
@@ -134,7 +158,7 @@
134158
matchDepNames: [
135159
'@types/node',
136160
'node',
137-
'bazel', // bazelisk bazel verison
161+
'bazel', // bazelisk bazel version
138162
'npm',
139163
'rxjs',
140164
'tslib',
@@ -149,5 +173,12 @@
149173
matchDepNames: ['typescript'],
150174
matchUpdateTypes: ['major', 'minor'],
151175
},
176+
177+
// Rule to disable major updates on branches other than 'main'.
178+
{
179+
enabled: false,
180+
matchBaseBranches: ['!main'],
181+
matchUpdateTypes: ['major'],
182+
},
152183
],
153184
}

0 commit comments

Comments
 (0)