Skip to content

Commit c49e87f

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 c49e87f

File tree

1 file changed

+40
-14
lines changed

1 file changed

+40
-14
lines changed

renovate-presets/default.json5

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,37 @@
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',
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
// ============================================================================
55+
// Rule to disable NPM updates on branches other than 'main'.
56+
// But allow updating engines and packageManagers.
57+
{
58+
enabled: false,
59+
matchBaseBranches: ['!main'],
60+
matchDepNames: ['!node', '!pnpm', '!npm', '!yarn'],
61+
matchManagers: ['npm'],
62+
},
4363

44-
// Group all non-major updates (minor and patch) together
64+
// Group all non-major dependencies together for updates.
4565
{
4666
groupName: 'all non-major dependencies',
4767
matchDepNames: ['*', '!node', '!pnpm', '!npm', '!yarn'],
4868
matchUpdateTypes: ['digest', 'patch', 'minor'],
69+
matchManagers: ['npm'],
4970
},
5071

5172
// ============================================================================
@@ -55,7 +76,15 @@
5576
// Group Bazel updates
5677
{
5778
groupName: 'bazel dependencies',
58-
matchManagers: ['bazel'],
79+
matchManagers: ['bazel', 'bazel-module'],
80+
},
81+
82+
// Group GitHub Actions workflow
83+
{
84+
groupName: 'all github actions',
85+
matchManagers: ['github-actions'],
86+
// Disable 'postUpdateTasks' for changes that do not effect the BAZEL lockfile or generated files.
87+
postUpgradeTasks: {commands: []},
5988
},
6089

6190
// ============================================================================
@@ -64,6 +93,7 @@
6493

6594
// Group updates related to Angular ecosystem across repositories
6695
{
96+
enabled: true, // Enable NPM updates of cross-repo dependencies on all branches.
6797
groupName: 'cross-repo angular dependencies',
6898
followTag: 'next',
6999
separateMajorMinor: false,
@@ -107,17 +137,6 @@
107137
schedule: ['on sunday and wednesday'],
108138
},
109139

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-
121140
// ============================================================================
122141
// EXCLUSION RULES
123142
// ============================================================================
@@ -134,7 +153,7 @@
134153
matchDepNames: [
135154
'@types/node',
136155
'node',
137-
'bazel', // bazelisk bazel verison
156+
'bazel', // bazelisk bazel version
138157
'npm',
139158
'rxjs',
140159
'tslib',
@@ -149,5 +168,12 @@
149168
matchDepNames: ['typescript'],
150169
matchUpdateTypes: ['major', 'minor'],
151170
},
171+
172+
// Rule to disable major updates on branches other than 'main'.
173+
{
174+
enabled: false,
175+
matchBaseBranches: ['!main'],
176+
matchUpdateTypes: ['major'],
177+
},
152178
],
153179
}

0 commit comments

Comments
 (0)