Skip to content

test(module): keep the root module zip within a size budget - #2724

Open
houko wants to merge 2 commits into
mainfrom
test/issue-1560-module-zip-budget
Open

houko wants to merge 2 commits into
mainfrom
test/issue-1560-module-zip-budget

Conversation

@houko

@houko houko commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Issue #1560 asked for two things: retract the abandoned github.com/nsgo-dev/game/packages/game v0.1.0, and keep the website and design trees out of the root module zip with a test that fails when the zip outgrows its budget. The retraction release packages/game/v0.1.1 (a deprecated module that carries retract v0.1.0) and the nested go.mod files for website and design (#2397) already landed, so this change adds the remaining acceptance item: internal/repocheck now builds the module zip golang.org/x/mod/zip produces for the current tree, asserts that no website/ or design/ file is in it, and compares its byte size and file count against benchmarks/module-zip-budget.json. The baseline is about 28.4 MiB in 6,368 files and the budget adds about 5% headroom, the same margin the other budget files in benchmarks/ use. go.mod moves golang.org/x/mod from the indirect to the direct requirements because the test now imports it.

The retraction was verified against the proxy from this checkout: go list -m -versions github.com/nsgo-dev/game/packages/game lists only v0.1.1, and go list -m -json -retracted github.com/nsgo-dev/game/packages/game@v0.1.0 reports the retraction; the proxy's v0.1.1 go.mod starts with the // Deprecated: comment.

The new note .agents/notes/implemented/testing/2026-12-01-module-zip-budget.md records the guard, and the two existing notes about the module zip link it: the layout note's rejected stub-module alternative was overtaken for website and design by the exclusions note. There is no changelog fragment because nothing user-visible changes; the 0.4.0 changelog already records keeping the website and design trees out of the module zip.

Related issue

Fixes #1560

Verification

  • gofmt -l . produces no output.
  • go tool nsgo check passes from the repository root (the default targets).
  • go tool nsgo test ./internal/repocheck passes from the repository root: 40 passed, 0 failed, 1 skipped (an environment-dependent guard unrelated to this change).
  • bun run verify-notes passes (846 note(s) tree and relative links verified, 846 note(s) verified).
  • go tool nsgo test ./... was not run; the changed package was tested and the full suite is CI's job.
  • go tool nsgo check -target macos,windows,linux,android,web was not run separately; the default go tool nsgo check ran.
  • go tool nsgo check -target ios,ios_simulator was not run; the change touches no platform code.
  • bun run build was not run; neither docs/ nor website/ changed.
  • No docs/en/ or docs/zh/ update is needed; the change is repository tooling, not a documented page.

Screenshots

None; the change has no visible surface. The editor checklist does not apply because no pkg/editor file changed.

Build the module zip the proxy serves for the current tree with golang.org/x/mod/zip, assert no website or design file is in it, and fail when it grows past the byte and file counts in benchmarks/module-zip-budget.json, so a tree that loses its nested go.mod or the module outgrowing a download fails the repository checks.

Refs #1560.
@github-actions github-actions Bot added documentation Improvements or additions to documentation size/S dependencies Pull requests that update a dependency file pkg/internal pkg/game area/tools area/agents labels Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agents area/tools dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation pkg/game pkg/internal size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module: retract the abandoned github.com/nsgo-dev/game/packages/game v0.1.0 on the proxy, and keep the website and design files out of the module zip

1 participant