Cache prefix key for multiple cache-dependency-path
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nodejs, typescript
- 领域
- ci-cd
调研方向
检查 setup-node 如何根据 cache-dependency-path 构造缓存键,然后阅读相关 issue #1120 了解背景。完成的标准是:工作流可以在包管理器和 lockfile 哈希之间提供一个可控的前缀,从而使关注点各自独立的 monorepo 缓存不会相互交叉恢复。
由索引模型根据 Issue 内容生成。
描述
Description:
Currently the cache key is always the following format node-cache-{platform}-{packageManager}-{fileHash(lockfile)}
I'd like a way to add a prefix between the packageManager and the file hash like node-cache-{platform}-{packageManager}-{cachePrefix}-{fileHash(lockfile)}
Justification:
We work in a monorepo with yarn workspaces. In order to scope our yarn installs and cache, we use yarn workspaces focus with cache-dependency-path pointing to yarn.workspace.lock from https://github.com/MaintainX/yarn-plugin-workspace-lockfile
This means we have multiple workflows all saving and restoring caches for different file hashes.
Because we use yarn3, setup-node uses fallback restore keys.
Which means it frequently happens that 1 workflow will fallback on the cache from a totally different set of lockfiles, run yarn effectively download what's missing and grow the cache and save that cache back.
Somewhat related https://github.com/actions/setup-node/issues/1120
What happens is that our caches are constantly growing, over time including the whole monorepo's dependencies and more.
We tried to mitigate this by manually creating caches on push to master using actions/cache/save instead of setup-node so we wouldn't restore the cache making it a "fresh" cache.
Having a cache prefix that we control, we could give a semantic name for scopes of the monorepo allowing to avoid workflows to cross restore caches for a different yarn workspaces focus command
Are you willing to submit a PR?
Yes I'm willing to open a PR if this suggestion is accepted
- 主要语言
- TypeScript
- 星标
- 5k
- 派生
- 1.7k
- 平均合并
- 5 天 4 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
actions/setup-node 的其他 Issue
-
feature request
难度 2/5 1-3 小时 新手友好度 65/100
actions/setup-node#1531 · 1 条评论 · 4 个 reaction ·
维护者通常 4 天内回复
-
feature request
难度 5/5 一周以上 新手友好度 30/100
actions/setup-node#1634 · 1 条评论 ·
维护者通常 4 天内回复
-
Volta extends resolution in getNodeVersionFromFile has no cycle detection, recursing until stack overflow可能重新可做 @v-gowridurgad 于 32 天前认领,目前没有进行中的 PR。 未关闭bug
actions/setup-node#1628 · 3 条评论 · 已指派 1 人 ·
维护者通常 4 天内回复
-
`npm config get cache` fails with `EBADDEVENGINES` when requiring newer npm versions in `devEngines`未关闭feature request
难度 4/5 3-5 天 新手友好度 52/100
actions/setup-node#1553 · 14 条评论 · 2 个 reaction ·
维护者通常 4 天内回复
-
feature request
难度 3/5 1-2 天 新手友好度 38/100
actions/setup-node#1428 · 1 条评论 · 3 个 reaction ·
维护者通常 4 天内回复
查看 actions/setup-node 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
apache/rocketmq-dashboard#6610 ·
维护者通常 3 天内回复
-
nextjs-tracking
难度 2/5 1-3 小时 新手友好度 69/100
cloudflare/vinext#3920 ·
维护者通常 1 天内回复
-
Team:Dashboards
难度 2/5 1-3 小时 新手友好度 65/100
elastic/kibana#297299 · 1 条评论 ·
维护者通常 1 天内回复
-
analytics beginner friendly community contributions-welcome good first issue hacktoberfest help wanted up-for-grabs
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
affected/v17 affected/v18 area/frontend type/bug
难度 2/5 1-3 小时 新手友好度 82/100
umbraco/Umbraco-CMS#24186 ·
维护者通常 2 天内回复