Scope pull request uploads to the pull request

Aperta
#16 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend, devops

Direzione di ricerca

Start by reading src/auth.ts, which the issue identifies as enforcing the current upload policy, then trace how cache requests are routed and how vp run addresses cache scopes. The proposal leaves endpoint design, fallback behavior, and retention unresolved, so define those decisions before implementation. Done means same-repository PR runs can write and read their own scope with default-branch fallback, while default-branch builds cannot read PR scopes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Motivation

A pull request can't reuse cache entries from its own earlier runs. Only push jobs on the namespace's default branch can upload (src/auth.ts), so pull_request runs get 403 write_policy and can only restore what the default branch published. After each new push to a PR, tasks whose inputs differ from the default branch rebuild, even if the PR's previous run already built them.

Uploading PR results into the namespace itself would let unreviewed PR code publish entries that default-branch builds restore, so PR entries need their own scope.

Proposal

  • A pull_request run uploads to a scope for its PR, derived from the token's ref claim (refs/pull/<n>/merge).
  • PR runs read their PR scope first, falling back to the default branch. Default-branch builds never read PR scopes.
  • Default-branch publishing is unchanged.

This covers same-repository PRs only; fork PR runs in public repositories don't get id-token: write.

Open questions

  • Endpoint: how a client addresses a PR scope (e.g. /projects/<namespace>/pulls/<n>), with the write policy checking that the token's ref matches it.
  • Fallback: the server could serve default-branch entries on a PR-scope miss, or vp run (vite-task) could read both endpoints.
  • Retention: PR scopes should expire soon after the PR closes or goes idle, within the namespace's limits.
Lingua principale
TypeScript
Stelle
8
Fork
0
Merge medio
2g 15h
PR unite (30g)
33

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/vite-plus-remote-cache-cloudflare

Tutte le issue di voidzero-dev/vite-plus-remote-cache-cloudflare

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.