Skip to content

Commit c0d97db

Browse files
alan-agius4josephperrott
authored andcommitted
ci: change when postUpgradeTasks are invoked (#3013)
Since the `package.json` file is no longer included in the Bazel lock file, the `postUpgradeTasks` are only necessary when the `matchManagers` are 'bazel', 'bazel-module', or 'bazelisk' for the majority of our repos. For the dev-infra and Angular framework repositories, the `Angular framework repositories, the postUpgradeTasks` should be executed when the managers are 'bazel', 'bazel-module', 'bazelisk', or 'npm' due to them having generated checked-in files. PR Close #3013
1 parent 7e2eefa commit c0d97db

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

renovate-presets/default.json5

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,25 @@
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-
5039
packageRules: [
5140
// ============================================================================
5241
// GENERAL GROUPING & UPDATE BEHAVIOR
5342
// ============================================================================
5443

55-
// Disable 'postUpdateTasks' for changes that do not effect the BAZEL lockfile or generated files.
44+
// Enable 'postUpdateTasks' for changes that effect the BAZEL lockfile or generated files.
45+
// Renovate does not update Bazel lockfile for the time being.
46+
// Workaround for https://github.com/renovatebot/renovate/issues/25557
5647
{
57-
postUpgradeTasks: {commands: []},
58-
matchManagers: ['!npm', '!bazel', '!bazel-module', '!bazelisk'],
48+
postUpgradeTasks: {
49+
commands: [
50+
'var',
51+
'git restore .npmrc || true', // In case `.npmrc` avoid a hard error.
52+
'pnpm install --frozen-lockfile',
53+
'pnpm bazel mod deps --lockfile_mode=update',
54+
],
55+
executionMode: 'branch',
56+
},
57+
matchManagers: ['bazel', 'bazel-module', 'bazelisk'],
5958
},
6059

6160
// Rule to disable NPM updates on branches other than 'main'.

renovate.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["github>angular/dev-infra//renovate-presets/default.json5"],
4-
"postUpgradeTasks": {
5-
"commands": [
6-
"pnpm install --frozen-lockfile",
7-
"pnpm bazel mod deps --lockfile_mode=update",
8-
"pnpm update-generated-files"
9-
],
10-
"executionMode": "branch"
11-
},
124
"ignoreDeps": ["@google-cloud/spanner"],
135
"ignorePaths": ["bazel/integration/tests/**"],
146
"packageRules": [
157
{
168
"enabled": true,
179
"matchPackageNames": ["typescript"],
1810
"matchUpdateTypes": ["minor"]
11+
},
12+
{
13+
"postUpgradeTasks": {
14+
"commands": [
15+
"pnpm install --frozen-lockfile",
16+
"pnpm bazel mod deps --lockfile_mode=update",
17+
"pnpm update-generated-files"
18+
],
19+
"executionMode": "branch"
20+
},
21+
"matchManagers": ["bazel", "bazel-module", "bazelisk", "npm"]
1922
}
2023
]
2124
}

0 commit comments

Comments
 (0)