Remove dist from git and enforce release-only distribution - #970
Draft
hadijafar wants to merge 3 commits into
Draft
Remove dist from git and enforce release-only distribution#970hadijafar wants to merge 3 commits into
hadijafar wants to merge 3 commits into
Conversation
- 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
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.
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
.gitignorealone 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 committeddist/paths fail validation.Closes https://github.com/shop/issues-taxonomy/issues/546.
Merge prerequisites
dist/output for integration/schema CI and removes the commit-back workflow. This branch currently contains its commit, so that diff will disappear after Generate dist in CI and validate against generated output #968 merges.unstableprerelease assets.v2026-05still has no assets.Error encountered. All repository-owned checks pass, and this PR does not touch its only configured source path (data/localizations/return_reasons/{{language}}.yml).Changes
dist/./dist/output..gitattributesrules for the five former LFS-backed dist files.dist_not_trackedCI job that fails whengit ls-files -- dist/returns any path, including a force-added ignored file.dist/README.md.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.bundle exec bin/product_taxonomy dist --locales en; all 20 generated files remained ignored andgit 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.dist/forced-guard-test.json; the guard detected the path and exited non-zero.