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 摘要。