Skip to content

Commit 2548214

Browse files
devversiondylhunn
authored andcommitted
ci: invalidate circleci caches to prune nested node_modules (#46707)
Yarn 1.x. is known to not prune nested unused node modules. This throws off Bazel when the dependency tree changes but there are leftover unused nested node module folders. This causes CI failures currently after the dependency tree updates. Invalidating the cache fixes this issue. Long-term a switch to Yarn 2.x+, pnpm will fix this. PR Close #46707
1 parent ab9ce8a commit 2548214

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ version: 2.1
2424
# **NOTE 2 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
2525
# **NOTE 3 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
2626
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
27-
var_3: &cache_key v6-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
27+
var_3: &cache_key v7-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
2828
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
2929
# folder will contain all previously used versions and ultimately cause the cache restoring to
3030
# be slower due to its growing size.
31-
var_4: &cache_key_fallback v6-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
31+
var_4: &cache_key_fallback v7-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
3232

3333
# Windows needs its own cache key because binaries in node_modules are different.
34-
var_3_win: &cache_key_win v8-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}
35-
var_4_win: &cache_key_win_fallback v8-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
34+
var_3_win: &cache_key_win v9-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}
35+
var_4_win: &cache_key_win_fallback v9-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
3636

3737
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
3838
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.

0 commit comments

Comments
 (0)