Repository navigation
Conversation
git refuses a push command before the update hook runs when its objects are incomplete (a missing tree, a missing parent, a random SHA, a tag at a missing target) or when it is a shallow update, but it still passes the command to pre-receive. The publication gate counted such a command as needing the pack, so the pack was uploaded and registered, no ref pointed into it, and every repack carried its objects forward. The gate now runs git's own connectivity check for the first command that has no stored target, and a command that fails it never justifies publication. A push whose commands git refuses and no other command needs the pack is refused before the upload, like a push that only policy-denied commands need. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I492f0a3b9407e77cfe4ac6464a467e3f43a97008
Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: Icfb038a419f8f0221eeee94ac6f914be03012449
…gate Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I8e3d2e74dc284bef083f354e46edb0ba69ee47ef
|
@codex review |
|
@codex security review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8faa6c5dbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 8faa6c5dbc
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
A connectivity check that cannot read an object exits 128. A git that does not know --exclude-hidden (before 2.39) exits 129, and a signal or an out-of-memory kill ends the check too. Those statuses say nothing about the command, so the gate publishes as it did before and no push that git accepts is refused. The refusal is a client-visible refusal, so the pusher reads why the push stored nothing. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I8df39e20ce78f02f8d03e2c24e588790dab5fc81
Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I73ffc05cbf4b61525c02da34c08dbf54ea1c8f7c
Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: Ie48f212f900030abc3be5db9af7e4e3b4b6b910a
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
The gate comment says that a wholly allowed push is refused when only git-refused commands need the pack, and that receive-pack runs one combined check and then one check for each command. The wire compatibility page lists refs that git refuses among the refs that make the server decline a whole push. The no-replace test also covers the new check. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I405b02b6752efc97ef906d4eb3e13e8371983210
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Only the lane-schedule sync commit line conflicted. Main moved it, so this takes main's line and the next commit re-records it. Change-Id: I26bf62e14bae9a571a410d93a0d35c839cd6469f Signed-off-by: Thomas Kosiewski <tk@coder.com>
Main moved the sync commit line in the same place. Only the line moves. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: If6d9dbcf7f01a570724e0c8a904801b6feb377be
…efused commands A writer could send a push with hundreds of commands that name incomplete histories. The publication gate then ran one git rev-list for each of them, and each walked the same objects. The gate now asks git once for each distinct target and stops asking after eight targets have failed. A push with more failing targets than that publishes its pack as it did before the check. git still refuses each of those refs. The same change rewraps a comment, corrects a comment that promised a message the git-refused refusal does not give, and adds a real signal to the exit-status test. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I5260045b374c817b034e832a6926a29c9ed00d5d
…ectivity checks The publication gate now asks git through a probe. The sync commit line and the fingerprint of preReceivePolicyGate move with it, and the probe is covered. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I2623ed230422cc29d9a055365afa64b338e34899
staticcheck flagged the repeated call in one condition. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-sonnet-5-5` • Thinking: `xhigh`_ <!-- xum-attribution: model=anthropic:claude-sonnet-5-5 thinking=xhigh --> Change-Id: I4399c34c2fa711fc90100b764ac6c7aaaec05075
Why
git refuses some push commands before the update hook runs: an object that the pack does not complete (a commit with a missing tree or parent, a random SHA, a tag at a missing target) and a shallow update (
shallow update not allowed, for example a plaingit pushfrom a--depth 1clone). git still hands such a command topre-receive. The publication gate (preReceivePolicyGateininternal/githttp/hook.go) counted every command whose target was not in the main store as needing the pack, so the pack was uploaded and registered, no ref could ever point into it, and every repack carried its objects forward (the repack keeps the registered set, by design). Each refused shallow push with new objects left a quota-counted pack that nothing reclaims short of a repository purge. The code says the opposite: it must not publish a pack that "could only become a registered, unreachable, quota-consuming blob".I reproduced it on
mainwith a real node: shapes with a missing tree, a missing parent, a random SHA, a tag at a missing target, a real shallow push, a decoy (a create at a stored commit beside the refused command), and the atomic variant each left 1 registered pack and 1 blob. A policy denial, a branch at a blob, a no-force-push rewind, a hidden ref, a delete-only push and a quota denial leave none.What changed
reachesUpdateHookanswers "no" only when git exits 128 (a connectivity check that cannot read an object). Any other status says nothing about the command, so the gate publishes as before: a git without--exclude-hidden(before 2.39) exits 129 and behaves as it did, and a signal or an out-of-memory kill never refuses a push that git accepts. It runs git's own connectivity check (rev-list --objects --stdin --not --exclude-hidden=receive --all --quiet --alternate-refs, the call in git'sconnected.c) for a command's new value, in the hook's environment, which sees the quarantine.the quarantined pack is needed only by ref updates that git refuses (<ref>: its objects are incomplete, or the update is a shallow update), refusing pack publication. A refused push must not pass pre-receive, because git would then move the quarantined objects into the node's cache, where no registered pack holds them.TestPackPublication_GitRefusedCommandStoresNothing(3 subtests: the shallow push, a commit with a missing tree, and the decoy) fails onmainfor the right reason (the count of pack rows and blobs) and passes here.TestReachesUpdateHookRefusesOnlyOnExit128pins the exit-status rule.preReceivePolicyGateis covered. The model does not describe the gate.Tradeoff
A push whose first new command has a target that the main store lacks (every push that adds commits) now runs one more
rev-listover that command's new objects. git did the same walk once before it ran the hook. A push of several refs pays it once, unless its first commands fail it: the gate stops at the first command that passes. A shallow push, or a push with a missing object, is now refused as a whole where git used to land its other refs (pre-receiverefuses the push, like the existing decoy rule for a policy denial).Scope
Not changed: the atomic stale-old refusal that registers its pack (it is a listed residual in the gate's comment), a stale compare-and-swap in a non-atomic push, and the D/F-doomed create. They fail after publication, for reasons that the gate does not model.
Verification
main(3 of 3) and passes. The fullinternal/githttprace lane (local backend, 841 s),gofmt, golangci-lint 2.15.0 (0 issues), the gitlimit lease audit, the darwin test build, the doc-link gate and both fingerprint gates pass. The PostgreSQL and S3-WAL lanes run in CI (this host has no docker).Generated with
xum• Model:anthropic:claude-sonnet-5-5• Thinking:xhigh