Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

build-train: remote content-addressed build cache (R2)

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
cloud, typescript

调研方向

Read contentHashStalenessOracle and recordBuilt to trace the existing local cache key and build flow, then inspect the bundle-store upload path and ADRs 0015 and 0020 for storage and scoping. Start after blockers #481 and #482 are complete; add restore verification, opt-in publishing, and fault-injection coverage. Done means remote hits are verified before reuse, successful builds publish non-fatally, and local-only behavior remains the default.

由索引模型根据 Issue 内容生成。

描述

ready-for-agent

What to build

The train's build cache (.bos/build-cache.json) is local-only — every fresh CI runner, agent session, and laptop rebuilds unchanged workspaces. Make the cache content-addressed and shareable: publish input-hash → dist bundle to the R2-backed bundle storage (ADR 0015 / ADR 0020 already provision the store and upload plumbing), restore on hit before judging staleness.

The cache key already exists: the member's input hash + build-mode env (envKey in contentHashStalenessOracle).

Behavior:

  • Judgement: if the local cache is cold but a remote entry exists for the key, restore the dist into the member, run the #482 output verification against the recorded hashes, and treat it fresh on match (rebuild on any mismatch — restore is never trusted unverified).
  • Publish: after a successful local build (recordBuilt), upload the dist keyed by input hash. Upload failures are non-fatal — the cache is an optimization, never a gate (same posture as the unwritable local cache, workspace.ts:394).
  • Opt-in: gated behind a flag/env (e.g. BOS_BUILD_CACHE_REMOTE=... + existing storage credentials); default remains local-only.
  • Auth/scope: reuse the bundle-store upload path and scoping (ADR 0015 bundles:write/bundles:read); keys are namespaced so members can't collide across projects.

This is the Bazel remote-cache win ported onto the train — no Bazel, no rules, just the store that already exists.

Blocked by

#481 (stats fast path — restore must be cheaper than rebuild to be worth it), #482 (output verification — restored dists must be integrity-checked before being trusted).

Status

  • Remote judgement: cold-local + remote-hit → restore → verify → fresh
  • Post-build publish keyed on input hash + envKey; failures non-fatal
  • Opt-in flag/env; local-only default preserved
  • Fault-injection tests: corrupt restore, missing remote entry, upload failure mid-train, concurrent publish
  • Changeset added
主要语言
TypeScript
星标
5
派生
3
平均合并
11 小时 8 分钟
30 天内合并 PR
90

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

NEARBuilders/everything-dev 的其他 Issue

查看 NEARBuilders/everything-dev 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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