GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — github-backup: Cloudflare rehost as Workers + R2 smart-HTTP (#8584) by dezren39 · Pull Request #14321 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Refs #8584 — the Cloudflare rehost leg, built on the surface Drew picked himself on 2026-11-24 ("Go with Workers + R2 smart-HTTP instead", decision recorded on #8584), over the evaluation's Tunnel recommendation.

What this lands

  • Worker infra/github-backup/rehost/worker/ — protocol-v0 git smart-HTTP: info/refs advertisement rendered from a published refs.json, git-upload-pack answered with NAK + one pre-generated self-contained pack streamed from R2. Read-only by construction (no receive-pack). Protocol decisions are pure functions in src/protocol.js with node tests.
  • Publisher bin/rehost_publish.py + bin/rehost_publish_all.py — per fleet repo: git pack-objects --all --delta-base-offset over the backup mirror + a refs index (heads/tags with peeled targets), uploaded pack-first with SHA-256 read-back, refs.json last as the commit point, byte-compared; old pack generations pruned to current + previous.
  • Freshness probe — cloudflare_rehost is verified for real now: the HEAD oid in the Worker's live advertisement must equal the local mirror HEAD per fleet repo (was "unverified by construction"). Fetch errors are normalized so a truncated read records the copy unverified instead of crashing the probe.
  • Schedule — github-backup-rehost.timer daily 03:20 + 30m delay (after fetch/R2/mirror, before the 04:10 freshness probe), wrapper + install-units wiring + doc/fleet-schedule-registry.md row.
  • Docs — rehost README (design, protocol notes, ops), RUNBOOK §13, evaluation addendum recording the decision and build.

Already provisioned (authorized by Drew's pick)

  • R2 bucket fleet-git-rehost (fleet Cloudflare account, created 2026-11-24T10:35Z)
  • Worker fleet-git-rehost, R2 binding REHOST, custom domain git.security.cab (+ workers.dev), current version 5f4bcaf4-64f5-4838-a187-fb27e7c72206

Clone proof (live)

developing-today/fleet published from a fresh bare mirror clone (pack 7c58cc94a13da20f9957df81ee921295f65db931, 55 refs), then:

$ git clone https://git.security.cab/developing-today/fleet
986 objects received, deltas resolved
$ git rev-parse HEAD
b328920249fc80ec09406139e8edc3019a29a158   # == source HEAD

git fetch (up-to-date path) and git ls-remote also verified against the live endpoint; the freshness probe's own parser reads the live advertisement HEAD as the same oid.

Bugs the live drill caught (fixed in this PR)

  1. Publisher inherited stdin — git pack-objects reads object names from stdin and hung forever at 0 CPU. Now DEVNULL.
  2. git sends larger upload-pack requests gzip-compressed — the Worker now decompresses before parsing (was HTTP 400).
  3. git's HTTP transport separates first-want capabilities with a space, not NUL — the parser now keeps only the oid token under either separator.

Operator remainder (not in this PR)

  • Run infra/github-backup/systemd/install-units.sh from a laptop main checkout to install the rehost timer with the others; the first scheduled publish then covers all four repos from the laptop mirrors. From this seat only developing-today/fleet is published so far (the laptop mirrors are the publisher's source; the seat published from a fresh GitHub mirror clone for the proof).
  • This seat has no working rclone (the ~/tools/bin dispatcher shim is broken while nix is out), so the proof publish drove the publisher's own code with its rclone transport translated to Cloudflare REST calls. The shipped publisher uses rclone exactly like the proven bundle_r2.py; its logic is covered by hermetic tests with a fake rclone.

Verification

Remote dispatch on this head: https://github.com/developing-today-forks/fleet/actions/runs/45385726911 (publisher tests, probe tests, readout regression, argument-contract scripts, py_compile, worker node tests where node exists). Results recorded on #8584.

No new dependencies: Python stdlib + git + rclone (publisher/probe), plain JS Worker (no build deps).


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
felix added 6 commits November 24, 2026 10:34
felix
github-backup: build the Cloudflare rehost as Workers + R2 smart-HTTP (…
85cba1c
…#8584)

Drew picked option 2 (Workers + R2 smart-HTTP) on 2026-11-24 over the
evaluation's Tunnel recommendation; decision recorded on #8584.

- rehost/worker: protocol-v0 smart-HTTP Worker (fleet-git-rehost)
  serving info/refs + upload-pack from a refs.json index and one
  pre-generated self-contained pack per repo in R2; read-only.
- bin/rehost_publish.py + rehost_publish_all.py: build the pack
  (pack-objects --all --delta-base-offset) and refs.json from the
  backup mirror, upload pack-then-refs with read-back verification,
  prune all but the current and previous pack generations.
- freshness_probe: cloudflare_rehost is now verified for real — the
  HEAD oid in the Worker's live advertisement must equal the local
  mirror HEAD per fleet repo — instead of unverified by construction.
- systemd: github-backup-rehost.timer daily 03:20 + wrapper +
  install-units wiring + schedule-registry row.
- Docs: rehost README (design/protocol/ops), RUNBOOK §13, evaluation
  addendum recording the decision and build.
felix
github-backup: rehost publisher must not inherit stdin (#8584)
9268c4f
git pack-objects reads object names from stdin once its revision
arguments are exhausted; with an inherited stdin that never reaches
EOF the publish blocks forever at 0 CPU (two live proof runs hung
exactly this way, 2026-11-24). Operator scripts get DEVNULL stdin.
felix
github-backup: rehost Worker must gunzip upload-pack requests (#8584)
efc50fa
git's HTTP transport gzip-compresses larger upload-pack request
bodies; parsing the raw bytes as pkt-lines answers 400 and the clone
dies with 'the remote end hung up unexpectedly'. Found by the first
live clone drill against git.security.cab (55 advertised refs make
the want list big enough for git to compress). Decompress per the
Content-Encoding header before parsing.
felix
github-backup: rename request stream var in rehost Worker (#8584)
f26ba75
The gzip fix collided with the response ReadableStream declared
later in the same function; esbuild rejected the redeclaration at
deploy time.
felix
github-backup: accept space-separated want capabilities in rehost Wor…
21a0e71
…ker (#8584)

git's HTTP transport separates the first want line's capabilities
from the oid with a space, not the NUL the ssh/local form uses
(captured from a real clone request against git.security.cab). The
parser kept the whole tail as part of the oid, so every clone's
first want failed validation. Keep only the oid token under either
separator; the test now covers both forms.
felix
github-backup: normalize rehost fetch errors in the freshness probe (#…
73386ff
…8584)

A truncated advertisement body raises http.client.IncompleteRead,
which is not an OSError — unnormalized it would crash the probe
instead of recording the rehost copy unverified. Seen live from the
sandbox seat (proxy-truncated read, 2049 of 4515 bytes). The fetcher
now converts every transport failure to RuntimeError, the shape
collect_outcomes already handles.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ba1e3c49-eb57-475f-8f7f-dbc55d37d79d
Commits

Reviewing files that changed from the base of the PR and between 5e8b853 and 188546f.

Files selected for processing: 20

  • doc/fleet-schedule-registry.md
  • infra/github-backup/bin/freshness_probe.py
  • infra/github-backup/bin/rehost_publish.py
  • infra/github-backup/bin/rehost_publish_all.py
  • infra/github-backup/docs/CLOUDFLARE-REHOST-EVALUATION.md
  • infra/github-backup/docs/RUNBOOK.md
  • infra/github-backup/rehost/README.md
  • infra/github-backup/rehost/worker/deploy.sh
  • infra/github-backup/rehost/worker/package.json
  • infra/github-backup/rehost/worker/src/index.js
  • infra/github-backup/rehost/worker/src/protocol.js
  • infra/github-backup/rehost/worker/test/protocol.test.mjs
  • infra/github-backup/rehost/worker/wrangler.jsonc
  • infra/github-backup/systemd/github-backup-rehost.service
  • infra/github-backup/systemd/github-backup-rehost.timer
  • infra/github-backup/systemd/install-units.sh
  • infra/github-backup/systemd/run-rehost.sh
  • infra/github-backup/systemd/test-rehost-arguments.sh
  • infra/github-backup/tests/test_freshness_probe.py
  • infra/github-backup/tests/test_rehost_publish.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

felix added 2 commits November 24, 2026 06:22
felix
github-backup: run fixture tags in the fixture repo, not the cwd (#8584)
dde4305
make_mirror's two git tag calls missed cwd=src, so they ran against
whatever repo the test process was launched from and died with exit
128 where no tagger identity was configured (fleet-command executor).
Found by Felix review of PR #14321's verification run 45385726911.
felix
github-backup: stage the pack inside the scratch repo before index-pa…
188546f
…ck (#8584)

The consistency oracle ran index-pack on the bucket path, which writes
the .idx beside the bucket pack and never makes the objects visible to
the scratch repo, so cat-file on the head commit exited 128. Copy the
pack into scratch/objects/pack first. Found by Felix review of
verification run 45392907375 (errors 3 -> 1 after the cwd fix; this was
the last one).
@dezren39
dezren39 merged commit 0070828 into main Nov 24, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the felix/8584-cf-rehost-workers-r2 branch November 24, 2026 13:03
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
Fleet unification slice 6: backups — Turso into D1, repos to Cloudflare plus mirror plus R2 #8584
Closed
@developing-today-fleet developing-today-fleet Bot added the audit:completed-later Gap completed by later merged PR label Nov 27, 2026
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 27, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:completed-later Gap completed by later merged PR

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.