Loading
docs(plans): plan Go hosted repositories
Summary
- Change: the implementation plan for hosted Go repositories, as S37 defines them: publishing a module zip, the GOPROXY reads the
gocommand makes, and managing Go modules and versions. It is 36 steps, each under the 1,000-line Go gate. - Why: see the spec.
- Downsides: Go becomes creatable only in the last code step, so nothing is usable until the whole stack lands. No format enforces the namespace storage quota yet, so S37's quota check waits with npm's in #260. A test-only pending list exists until Step 31. A Go zip check whose need exceeds its upload unit (none of 723 measured real modules) releases it and waits in the gate's FIFO queue for up to about 60 MiB, held until its
.modis written, so smaller uploads queued behind it wait too, and under load such a publish can answer503after its full body. Ago.modwhose parse estimate exceeds that maximum is refused with422.
S37 has merged, and this MR targets main.
Daniel Prause wrote this plan. While Daniel is out of office, mkhalifa3 took over the last review rounds to carry it to merge: 0518032a answers the fourth round, and 9f1b4951 revises the zip check, its memory and the step list after a review against the code, Go's own tools and real modules. After those rounds, the repository-owned-rows rule (!3864 (merged), tracking #1752) reached the plan: go_versions now carries go_repository_id, NOT NULL, and widens its module reference, in S37's schema and in Steps 3, 4 and 12.
Checklist
- Risk first: the pre-move check in the storage layer (Step 10) changes the shared commit protocol, and the whole publish path depends on it. It has no step dependencies, so it can start at once, and its MR asks one of the storage layer's main authors to review it.
- Conflicts: the query-name catalog groups by table, so the datastore, management and lifecycle steps rebase onto each other there. Each per-format map gains its Go arm in exactly one step, and the handler skeleton (Step 17) owns the route table. The Debian spec (!3447 (merged)) takes the next free format value if Go merges first.
- Reach: storage-layer authors (Step 10); the monolith's GraphQL format enum,
ArtifactRegistry::Formatsand client must acceptgobefore Step 32 merges, and Step 24 opens that issue. The Snowplow context schema takesformatas a free string, so it needs no change. - Coverage: every S37 behavior has a step, except the storage-quota check (#260). Remote and virtual Go and the
glabhelper commands are out of scope in S37 itself. - Least sure: Step 8, the zip check. It ports
archive/zip's directory parsing and copies twox/mod/zipfunctions, so parity rests on differential fuzz tests againstx/mod/zip.CheckFilesandarchive/zip. We call neither of those at run time, because a hostile zip within S37's caps makesCheckFilesallocate gigabytes. A parity gap the fuzz tests cannot reach would change my mind.
Related to #1754
Edited by Daniel Prause