Cache prefix key for multiple cache-dependency-path
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- nodejs, typescript
- Ambito
- ci-cd
Direzione di ricerca
Esamina come setup-node costruisce le chiavi della cache a partire da cache-dependency-path, quindi leggi la issue correlata #1120 per il contesto. Il lavoro è completato quando i workflow possono fornire un prefisso controllabile tra il gestore dei pacchetti e l’hash del lockfile, in modo che le cache di monorepo con ambiti distinti non vengano ripristinate l’una dall’altra.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 5k
- Fork
- 1.7k
- Merge medio
- 2g 11h
- PR unite (30g)
- 3
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di actions/setup-node
-
feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
actions/setup-node#1531 · 1 commento · 4 reazioni ·
-
feature request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
actions/setup-node#1634 · 1 commento ·
-
actions/setup-node#1628 · 3 commenti · 1 assegnatario ·
-
`npm config get cache` fails with `EBADDEVENGINES` when requiring newer npm versions in `devEngines` Apertafeature request
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
actions/setup-node#1553 · 12 commenti · 2 reazioni ·
-
feature request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
actions/setup-node#1428 · 1 commento · 3 reazioni ·
Tutte le issue di actions/setup-node
Issue simili
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Mend: dependency security vulnerability untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100