CodeForPhilly / CodeForPhilly/codeforphilly-ng

upgrade gitsheets 1.4.1 → 2.x (Rust core), pairing with upstream per-sheet refresh (gitsheets#184)

未关闭
#150 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
1
派生
1
平均合并
5 天 3 小时
30 天内合并 PR
9

描述

The API is pinned to \`gitsheets ^1.4.1\` — a full major version behind the 2.x line, which replaced the JS engine with a Rust core (canonical TOML, schema validation, and tree ops all native; measured ~4–5× faster on large-sheet commit workloads, with byte-identical output). A migration guide ships with 2.x.

Beyond the version bump, the upgrade is the right moment to retire three workarounds that all trace to the stale-\`Sheet\`-cache gap tracked upstream as JarvusInnovations/gitsheets#184:

- \`apps/api/src/store/store.ts\` — \`swapPublic()\` and the funnel-all-reads-through-memory rule exist because direct \`sheet.query*()\` after a transact reads the pre-commit tree (documented in \`specs/behaviors/storage.md\` under "Direct gitsheets reads after a transact").
- \`apps/api/src/routes/attachments.ts\` — deliberately bypasses \`Sheet.getAttachment()\` and streams via raw \`git cat-file\` to dodge the same cache.
- \`apps/api/src/lib/data-repo-lock.ts\` — a parallel mutex because gitsheets' internal one isn't exposed for non-transact git ops.

Ideally the upgrade lands alongside (or drives) the upstream #184 implementation so those can be deleted rather than ported.

Also worth checking during the upgrade: the \`asValidator()\` cast in \`apps/api/src/store/public.ts\` (Zod v4 vs \`StandardSchemaResult\` structural mismatch) and the \`BlobObject.write(hologit, buf as unknown as string)\` casts (\`importer.ts\`, \`people.ts\`) — the 2.x API surface (\`BlobHandle\`, typed error classes) may eliminate both.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start with the gitsheets 2.x migration guide and upstream issue #184, then inspect apps/api/src/store/store.ts, apps/api/src/routes/attachments.ts, apps/api/src/lib/data-repo-lock.ts, apps/api/src/store/public.ts, importer.ts, and people.ts. Done means the API runs on 2.x, the stale-cache workarounds are removed where upstream support permits, and the noted casts are checked against the new API.

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

评估

技术栈
git, rust, typescript
领域
api, backend
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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