fix(pkgzip): exclude .venv & build/tooling caches from the App Block source bundle - #8
Merged
Merged
Conversation
…ource bundle The packager only skipped .git/node_modules/dist. A stray Python `.venv` in an App Block dir (regenerable, never used by the server build recipe) leaked into the bundle — for gen-matrix that was 859 extra files / ~11 MiB, ballooning the submit bundle to 888 files / 4.5 MiB and slowing the Forgejo review-repo push. Extend the default-exclude set to the obvious VCS / dependency-install / build-output / tooling-cache dirs (.venv, venv, .pnpm-store, build, out, .next, .vite, .cache, coverage, .pytest_cache, .mypy_cache, .ruff_cache, .turbo, .hg, .svn) so they never ship. Result on gen-matrix: 888 -> 29 files, 4.5 MiB -> 126 KiB compressed; only real source (manifest + src + configs + lockfile + docs) remains. The `app submit` help excludes list is rendered from pkgzip.JoinExcluded(), so it updates automatically. Tests added for the new excludes; the count-pinned ExcludedNames assertion relaxed to a core-membership check. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
app submitpackages the source tree for the platform to rebuild, but the packager only skipped.git/node_modules/dist. Anything else in the project dir shipped — including a stray Python.venvin the gen-matrix block dir.That one
.venvadded 859 files / ~11 MiB, bloating the gen-matrix submit bundle to 888 files / 4.5 MiB. The server never uses it (it rebuilds fromsrc+ configs), and the extra files slow the Forgejo review-repo push.Fix
Extend the default
excludedDirsset to the obvious VCS / dependency-install / build-output / tooling-cache dirs that should never ship:.git,.hg,.svnnode_modules,.venv,venv,.pnpm-storedist,build,out,.next.vite,.cache,coverage,.pytest_cache,.mypy_cache,.ruff_cache,.turboThe
app submit --helpexcludes list renders frompkgzip.JoinExcluded(), so it updates automatically.Result (gen-matrix)
Only real source remains:
block.manifest.json,package.json,pnpm-lock.yaml, configs, 14src/files, docs.Tests
TestBuildExcludesVenvAndCachesasserts a tree with.venv/venv/build/out/.next/.vite/coverage/.pytest_cachepackages down to just real source.TestExcludedNamesextended to cover every new entry (and assertsrc/public/assets/libare NOT excluded).TestExcludedNamesAndJoinassertion relaxed from== 3to a core-membership check so it won't break on future additions.go test ./...passes.🤖 Generated with Claude Code