Skip to content

sources: the site's sources pinned and checked in Gate, and a daily sync (R5, R6, R7) - #52

Merged
aledbf merged 3 commits into
mainfrom
sources-sync
Oct 24, 2026
Merged

aledbf merged 3 commits into
mainfrom
sources-sync

Conversation

@aledbf

@aledbf aledbf commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Plan steps R5, R6 and R7: the site pins what it is generated from, Gate checks the reference against those pins, and a daily job opens one sync pull request.

R5: pins

  • versions.yaml (go-tools versions format, held by versions/gate in tools/sources/repo_test.go) pins:
    • spin at main's 77380b13d. This is the commit the reference already documents. No release has been cut since v20261019.02, and that release has no board.
    • spin-terraform-aws at v20261024.01.
    • brand at its main.
  • The files refgen writes that record commits are in the gate's Elsewhere.
  • refgen fails when reference.json's commits are not the pins (tools/refgen/pins.go).
  • task sources (tools/sources) fetches exactly the pinned commits, with history and tags, into .sources/. SPIN, TERRAFORM and BRAND now default to those directories. It is tested against a local bare repository.
  • reference:public uses tools/sources in place of the source task.
  • task sources:bump moves the pins:
    • spin moves to a release only when that release holds the pinned commit (GitHub's compare);
    • a release never moves back to an older one;
    • brand follows its main.
  • check:public is the path with no credentials.

R6: Gate

  • Gate mints a read-only sources-App token for spin alone, then runs task sources and task check.
  • With no secret (a fork's pull request), Gate runs task check:public instead.
  • tools/sources hands the token to its own git commands as GIT_CONFIG_* (http.extraheader). It is only in the Sources step's environment and is written nowhere.
  • setup-go's cache is keyed on versions.yaml as well, so spin's modules and CLI build stay cached until the spin pin moves.

R7: sync

  • sync.yml runs daily and on a sources-released repository_dispatch. It bumps the pins, regenerates with no token, and force-pushes sync/sources as the sync App. It opens or updates one pull request and does not auto-merge.
  • That pull request lists only the pin moves and the changed files.
  • The commit digest goes in one issue in spin, "Site vs spin main", written with the sources App:
    • commits grouped by the spin path that feeds each page, with the pages listed;
    • the release-chain report;
    • a weekly section on how far spin main is past the pin. It is advisory.
  • tools/sync builds all of it and is tested with httptest.
  • refgen now lists spin's tasks with go tool task in spin's checkout. Gate has no task on PATH, so this uses the Task version spin's own go.mod pins.

Gate time

  • Before: 57–92 s.
  • On this branch, cold cache: 3 min 26 s. Most of that was compiling with an empty build cache.
  • On this branch, warm cache (re-run): 98 s in total.
    • Sources: 11 s (spin fetched with the token).
    • task check: 27 s.
    • Restoring setup-go's cache: 28 s.

🤖 Generated with Claude Code

aledbf and others added 3 commits October 24, 2026 19:52
…fetched by Gate with the sources App

versions.yaml pins what the site is generated from, in go-tools' versions format and held by
versions/gate (tools/sources/repo_test.go): spin at main's 77380b13d, the commit the reference
documents, since v20261019.02 has no board and no release has been cut since; spin-terraform-aws
at v20261024.01; brand at its main. What refgen writes that records a commit - reference.json,
figures.json, shots.json, the CLI's goldens, the reference pages - is the gate's Elsewhere, and
refgen fails when reference.json's commits, or the release a pin at one names, are not the pins.

task sources (tools/sources) fetches exactly those commits, with their history and tags, into
.sources/, where SPIN, TERRAFORM and BRAND now point; reference:public fetches the public two the
same way, in place of the task that read reference.json for them. A checkout already at its pin is
left alone, so only the fetch needs a token. tools/sources hands SOURCES_TOKEN to its own git
commands as GIT_CONFIG_* (an http.extraheader, Basic as checkout sends it: git's HTTP takes no
Bearer), and writes it nowhere. task sources:bump moves the pins to the newest releases: spin to
one only once it holds the commit pinned, as GitHub's compare says, a release never back, brand
along its main.

Gate mints a read-only token of the sources App on spin alone, fetches, and runs task check;
with no secret - a fork's pull request - it runs task check:public, the gate, whose
reference:public needs none. setup-go's cache is keyed on versions.yaml too, so spin's modules
and its CLI's build come from it until spin's pin moves.

Plan steps R5 and R6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…quest, and what spin's commits say in one issue in spin

sync.yml runs every day, and on a sources-released repository_dispatch: task sources:bump with the
sources App's token, task reference with none, and the result force-pushed to sync/sources as the
sync App - whose push starts Gate, as GITHUB_TOKEN's would not - with its one pull request opened
or updated. Nothing merges it.

The website is public and spin private, so the pull request names the pins that moved and the
files that changed, and nothing of what spin's commits say. That goes in one issue in spin, "Site
vs spin main", written with the sources App: the commits the bump took in, each under every path
of spin it touches that feeds a page - the generated pages' own source, the diagrams', and what
refgen holds the hand-written pages to - with the pages; and the release chain: spin-machine as
spin main pins it against its newest release, when machine.yml, propose.yml and fresh-install.yml
last ran and how, and the release and module ref spinbox.dev runs. Every Monday the same issue
says what spin main has past the pin, as advice that fails nothing. Each job writes its own
section and keeps the others; the issue is found by its author, not by search, which lags.

tools/sync writes all of it, tested against httptest servers and a local bare repository;
-print shows an issue's sections without writing them.

Plan step R7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e has without installing one

Gate runs task check now, and its runner has no task on PATH: go tool task in spin's checkout is
the Task spin's Taskfile is written for.

Plan step R6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit 16d86da into main Oct 24, 2026
4 checks passed
@aledbf
aledbf deleted the sources-sync branch October 24, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant