Skip to content

ci: guard against committing dependencies or build output - #381

Merged
wagmiiii merged 1 commit into
mainfrom
ci/repo-hygiene-guard
Aug 4, 2026
Merged

ci: guard against committing dependencies or build output#381
wagmiiii merged 1 commit into
mainfrom
ci/repo-hygiene-guard

Conversation

@mallison031

Copy link
Copy Markdown
Collaborator

Investigation result: this repo is healthy

Following the 252MB clone problem found in soroban-cost-linter, I ran the same
investigation here. This repository does not have that problem:

soroban-budget-assert soroban-cost-linter
GitHub size 10 MB 252 MB
packfile 3.57 MiB 310 MiB
working tree 1.4 MB / 156 files 1.1 MB / 152 files
history vs tree ~2.5× — normal >200×

No target/ directory has ever been committed. Largest currently tracked file
is 88KB. No remediation is needed, and documenting a blobless clone here
would be noise — a full clone already takes a couple of seconds.

But the same gap exists

History shows scripts/node_modules was committed and later untracked in
d6cb2db, leaving blobs like stellar-sdk.js (1.73MB), stellar-sdk-no-axios.js
(1.66MB) and stellar-base.js (1.24MB) in history permanently. .gitignore and
git rm stop future commits but do not retract what is already there.

That is the identical mistake that took cost-linter to 252MB — caught early here,
so the damage stayed small. Nothing prevented it in either repo: no pre-commit
config, no size check in CI.

The guard

Two checks added to the existing lint job:

  • any tracked path under target/ or node_modules/
  • any tracked file over 5MB (largest today is ~88KB, so wide headroom)

lint is already a required status context here, so unlike the sibling repo
this needs no aggregating job and no branch-protection change. The checks run
before the Rust toolchain setup, so they fail in seconds rather than after a
build.

Verified in both directions: passes on the current tree, and catches a planted
scripts/node_modules/pkg/index.js and a 6MB file. A guard nobody has seen fail
is not a guard.

`scripts/node_modules` was committed and later untracked in d6cb2db. The files
are gone from the tree, but .gitignore does not retract what is already in
history and a clone downloads history, so ~1.7MB blobs such as stellar-sdk.js
are paid for on every clone permanently.

This repository got off lightly — 10MB on GitHub against a 1.4MB working tree,
which is healthy and needs no remediation. The sibling soroban-cost-linter
reached a 252MB clone through exactly the same mistake at a larger scale, and
nothing in either repository prevented it: there is no pre-commit config and no
size check in CI.

Add two checks to the existing `lint` job, which is already a required status
context, so no new context and no branch-protection change is needed:

- fail on any tracked path under target/ or node_modules/
- fail on any tracked file over 5MB (largest legitimate file today is ~88KB)

They run before the Rust toolchain setup so they fail in seconds. Verified that
they pass on the current tree and that they catch a planted
scripts/node_modules/pkg/index.js and a 6MB file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ToyjQ3F5ogZ4G2C3YRpH4N
@wagmiiii
wagmiiii merged commit d9af357 into main Aug 4, 2026
7 checks passed
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.

2 participants