Skip to content

Remove dist from git and enforce release-only distribution - #970

Draft
hadijafar wants to merge 3 commits into
mainfrom
hadijafar/remove-tracked-dist
Draft

Remove dist from git and enforce release-only distribution#970
hadijafar wants to merge 3 commits into
mainfrom
hadijafar/remove-tracked-dist

Conversation

@hadijafar

@hadijafar hadijafar commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Removes generated dist/ output from git, ignores future local generation, and adds a CI index guard so force-added distribution files cannot become tracked again. GitHub release assets become the repository's distribution path.

This PR is intentionally a draft until the publishing and consumer-migration prerequisites below are complete.

Context

Keeping generated taxonomy output in git no longer scales: the current 311 tracked files occupy roughly 6.3 GB in a checkout, five files require Git LFS, and generated diffs obscure the source-of-truth changes under data/. The release-asset work moves those files to durable, gzip-compressed GitHub Release URLs instead.

The final cutover needs a stronger invariant than .gitignore alone because ignored files can still be force-added. CI now inspects the checked-out index rather than the working tree, so normal ephemeral generation remains allowed while committed dist/ paths fail validation.

Closes https://github.com/shop/issues-taxonomy/issues/546.

Merge prerequisites

Changes

  • Remove all 311 tracked files under dist/.
  • Ignore root-level generated /dist/ output.
  • Remove the obsolete .gitattributes rules for the five former LFS-backed dist files.
  • Add a dedicated dist_not_tracked CI job that fails when git ls-files -- dist/ returns any path, including a force-added ignored file.
  • Stop the stable release command from reading and version-badging the removed dist/README.md.
  • Make documentation command tests use their temporary dist fixture instead of silently depending on the repository's committed dist/ tree.

Tophatting

Validated from a checkout with no tracked or generated dist/ directory:

  • bundle exec rake test:unit — 452 runs, 287,605 assertions, 0 failures/errors.
  • Generated a fresh English dist tree with bundle exec bin/product_taxonomy dist --locales en; all 20 generated files remained ignored and git ls-files -- dist/ remained empty.
  • bundle exec rake test:integration — 11 runs, 527,791 assertions, 0 failures/errors.
  • bundle exec rake schema:vet — all data and generated dist schemas passed.
  • bundle exec rake test:orphan — 2 runs, 4 assertions, 0 failures/errors.
  • RuboCop passed for all modified Ruby files.
  • Exercised the CI guard against an isolated index containing a force-added ignored dist/forced-guard-test.json; the guard detected the path and exited non-zero.

KaiKitJeffreyChan and others added 3 commits July 29, 2026 15:14
- Add an explicit 'Generate distribution files' step to the integration
  and schema-check matrix jobs. The step removes the checked-out dist/
  tree and regenerates en from data/ and VERSION, so checks validate
  generated output instead of committed files. Unit tests skip it.
- Remove distribution_matches_data_test.rb: comparing regenerated output
  with a committed dist/ baseline is obsolete once dist/ is unversioned.
- Remove the /generate_dist commit-back workflow (already broken: it
  invoked a Makefile deleted in 354723b).

Part of shop/issues-taxonomy#544

Co-authored-by: AI (Pi/Claude Fable 5) <noreply@pi.dev>
Assisted-By: devx/bf7ee413-9453-4826-b1dc-8893f26eb97d
Stop storing derived dist output in the repository now that release assets are
the distribution channel. Remove all 311 tracked dist files and the obsolete
Git LFS attributes that only applied to those files, then ignore future local
generation under dist/.

Add a dedicated CI guard that inspects the checked-out git index with
`git ls-files -- dist/`. This rejects force-added ignored files while allowing
integration and schema jobs to generate ephemeral ignored output.

Keep the release flow working without dist/README.md by updating only the root
README badge. Isolate documentation tests from repository dist fixtures so unit
tests continue to run from a clean checkout with no generated output.

Closes shop/issues-taxonomy#546
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