githttp: hide ephemeral refs from the persistent remote and refuse pushes to them, as the docs say

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

维护者通常 1 天内回复

@ThomasK33 已经在做这个了。

开始于 2026年11月11日。

  • #800 来自 @ThomasK33 —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
git, go

调研方向

Start by mapping every reader of refs/namespaces/ listed in the issue, including the sync worker, push-upstream, forward_pushes, S3-WAL hydration, repack, LFS reclaim reachability, orphan sweep, and the +ephemeral remote. Record the design check in a comment before coding; if any reader requires the persistent remote, report that finding to the desk. Otherwise inspect where every git child is configured, then verify the persistent remote hides these refs and rejects pushes with per-ref ng; include the required breaking-change notice.

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

描述

Problem

The persistent git remote (/<repo>.git) advertises the API's ephemeral branches (refs/namespaces/ephemeral/...) and accepts pushes to them. Two docs say the opposite:

  • docs/explanation/git-protocol-and-namespaces.md:38-39: "persistent remotes must not see ephemeral refs (git namespaces or separate ref stores)".
  • The wire-compatibility table: ephemeral state "does not cross surfaces".

No hideRefs setting exists in internal/ today. A token still needs the same scope on both paths, so nobody gains access they lack, but a user who relies on the docs gets a wrong result. One edge case from #797 also depends on this: after someone pushes a branch named HEAD into that namespace over the persistent remote, the API cannot delete it by the name the list shows.

Found by a verifier on #798 (owner report, 2026-11-11).

Desk decision: Option A (make the code match the docs)

  1. Design check first, recorded as a comment here before any code: list every reader of refs/namespaces/ that goes through the git transport (sync worker, push-upstream and forward_pushes, S3-WAL hydration, repack, LFS reclaim reachability, orphan sweep, the +ephemeral remote itself, tests and verification skills). Hiding refs must not change any of them. Internal readers that open the repository directly are not affected by transport settings, but prove each one.
  2. Hide refs/namespaces/ from the persistent remote's upload-pack and receive-pack advertisements, and refuse a push to refs/namespaces/* on the persistent remote with a per-ref ng and a clear message. Do it once, where the server configures every git child (as the GIT_NO_REPLACE_OBJECTS rule in AGENTS.md does), not per call.
  3. A client that today fetches or pushes those refs through the persistent remote sees a change, so the PR is breaking: fix(githttp)!: with a BREAKING CHANGE: line.
  4. If the design check finds a reader that needs these refs on the persistent remote, stop and report it to the desk before coding.

Severity

Medium: documented isolation does not hold.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: medium

主要语言
Go
星标
0
派生
0
平均合并
6 小时 16 分钟
30 天内合并 PR
243

环境准备

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

从这里开始

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

coder/openstorage 的其他 Issue

查看 coder/openstorage 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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