Scope pull request uploads to the pull request

オープン
#16 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
backend, devops

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
TypeScript
スター
8
フォーク
0
平均マージ
2日 10時間
マージ済み PR(30日)
27

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/vite-plus-remote-cache-cloudflare のほかの issue

voidzero-dev/vite-plus-remote-cache-cloudflare の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。