~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

A push through the gateway reads its repository once

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:gateway/push-reads-once

What changes

dev.knotless.pushRefs builds the merge gate's view of the repository, and a runner's landing check, from the snapshot it already read under the repository's push turn (Target::read), rather than opening the repository from its PDS again for each (Target::open). A collaborator's push to a gated repository makes one fewer full read of the PDS. A runner landing a merge-queue batch makes two fewer.

Why

pushRefs averaged 4.5 s on prod over the day to 2026-11-01 17:00 UTC, with 34 of 43 calls over 2 s. Most of those are the runner landing batches and agents pushing to chadtmiller.com/knotless, which has runners, so every push was gated. The repeat reads came after the push had taken its turn, so they saw the same repository the first read did. The PDS writes still take what they take.

How it was checked

The gateway tests cover a gated collaborator push, a runner's landing push and a refused one. CI runs them. The after number will come from knotless admin stats once this is deployed.

Shortcomings

Target::open followed a repository that had moved; the snapshot writer reads doesn't. The push itself already wrote to the repository writer found, so the gate now reads the same one it writes. How much of the 4.5 s this saves isn't measured yet. The rest is the PDS writes and the mirror's index-pack.

🤖 Generated with Claude Code

Approved

This makes pushRefs build the merge gate's view and the runner's landing check from the snapshot writer read under the push turn, using Target::read. It no longer opens the repository again with Target::open. I read it against Target::read and Target::open in forge.rs, and the change looks correct.

  • open is locate followed by read, so you lose nothing but the second PDS read. org::fill and previous still run.
  • A runner is still checked for landing whether or not it is gated. Gating still excludes the repository's owner. The landing refusal and the gate each get the same target, as before.
  • The one real difference is the one you name: the snapshot doesn't follow a repository that has moved. That is fine, because the push writes to the repository writer found.

CI had not finished when I looked: check, test and e2e were queued. The other four checks were skipped, as expected for a Rust-only change. I'd merge once check and test pass. There's no docs or changeset requirement here, since only knotless-serve changes.

Merged as a8f0812