Repository navigation
Count only git-tracked files in the provider-literal ratchet - #8528
Merged
Merged
Conversation
scanTree walked the file system, so a file that a test run leaves in the tree counted as core code. bb-app's managed-json-process test bundles into packages/bb-app/.managed-json-cli-*; when turbo cancels that test, the bundle stays, and the ratchet then fails with "core gained provider-id references" until someone deletes it. Two earlier artifacts of the same kind got their own path exclusion. scanTree now lists files with git ls-files, so untracked files never count. The file walk and the exclusions for untracked artifacts (.packaged-plugin-build-, .runtime-test-, .wrangler) are removed. The fixture tests now run in a temporary git repository and write their artifacts as untracked files. .gitignore now ignores the bb-app and plugin-sdk test temp roots, so git add -A cannot commit a leaked bundle. docs/debugging-and-qa.md says that the ratchet counts git-tracked files.
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.
Human comments
What was wrong
The provider-literal ratchet walked the file system, so files that a test run leaves in the tree counted as core code.
bb-app's managed-json-process test bundles intopackages/bb-app/.managed-json-cli-*. When turbo cancels that test, the bundle stays, and the ratchet fails until someone deletes it. This is the third artifact of the kind. The first two got a path exclusion each (#4064, #4976).What changed
scripts/check-provider-literal-ratchet.mjs:scanTreelists files withgit ls-files -z, so untracked files never count. The sameisIncludedfilter applies. The file walk is removed, together with the exclusions that only skipped untracked artifacts (.packaged-plugin-build-,.runtime-test-,.wrangler). Git tracks no file under them. A new core file now counts locally aftergit add. CI scans the committed tree, so the merge check is unchanged.packages/scripts/test/provider-literal-ratchet.test.mjs: each fixture is a temporary git repository.write()stages the file, and artifacts are written untracked. A case forpackages/bb-app/.managed-json-cli-*/bb-app.mjsis added..gitignore: ignorespackages/bb-app/.managed-json-cli-*andpackages/plugin-sdk/.runtime-test-*, likeapps/cli/.packaged-plugin-build-*, sogit add -Acannot commit a leaked bundle.docs/debugging-and-qa.md: says that the ratchet counts git-tracked files.Why not one more exclusion: it would fix only this artifact. Filtering on git fixes the class and removes about 20 lines.
How you verified
node scripts/check-provider-literal-ratchet.mjs --base origin/main(CI command), untracked.managed-json-cli-PROBE/bb-app.mjspresentFAILED vs origin/main, exit 1turbo run typecheck lint test --filter=@bb/scriptsandoxlint -c .oxlintrc.type-aware.json scripts .github ./*.tspass.Fixes #8527