Scope pull request uploads to the pull request

未关闭
#16 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 天 15 小时
30 天内合并 PR
33

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

voidzero-dev/vite-plus-remote-cache-cloudflare 的其他 Issue

查看 voidzero-dev/vite-plus-remote-cache-cloudflare 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。