Skip stale RBI file removal when --only is set#2642
Open
Vein05 wants to merge 1 commit into
Open
Conversation
When `tapioca dsl --only` runs, only a subset of compilers executes. The purge logic then treats every RBI from excluded compilers as stale and deletes them, producing a large misleading diff. Return an empty purge set when `--only` is present so existing RBI files from other compilers are preserved during focused runs. Fixes Shopify#1612
Author
|
I have signed the CLA! |
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.
Motivation
Fixes #1612.
When
tapioca dsl --onlyruns, only the specified compilers execute. The purge logic ingenerate_dsl_rbi_filescomputesexisting_rbi_files - generated_filesand treats the result as stale. Since only a subset of compilers ran, RBI files from every other compiler end up in the purge set and get deleted, producing a large misleading diff.Implementation
Guard the purge computation in
abstract_dsl.rbwith an@only.any?check. When--onlyis present, the method returns an emptySetand logs a message explaining that stale RBI removal was skipped. The guard is placed afterpipeline.runso file generation still executes normally (including fordsl --only --verify).Tests
Added a new test (
"does not remove existing RBI files when using --only") that:dslrun--only SidekiqWorkerUpdated four existing
--onlytests to include the new skip message in their expected stdout.I added
say("Skipping stale RBI removal because--onlyis set.", :yellow)instead of"Skipping purging because of --only flag"as that felt more relevant here.This will be my first time working with production ruby, and I may have skipped something important. I'm open to suggestions. Thanks!
All 69 tests pass (0 failures, 1 pre-existing protobuf error).
bin/typecheckpasses with no errors.