During declarative recipe loading filter out duplicate copies of singleton recipes.#7468
Merged
During declarative recipe loading filter out duplicate copies of singleton recipes.#7468
Conversation
…leton recipes. I had proposed something very similar to this before, here: #6560 That didn't get merged because it felt too magical / special case for DeclarativeRecipe to deduplicate as a silent implementation detail. Instead of doing this the first time we decided on creating Singleton. But with Singleton alone I cannot find a way to guard the scanning phase without breaking ScanningRecipe.generate(). I tried several things. But a common usage for scanning recipes is to verify whether a file already exists, if I skip those then generate() recipes will create files they shouldn't because their scanner was skipped by Singleton. So I'm resurrecting the declarative recipe duplicate loading skip. But this time I'm keying off the presence of Singleton, which explicitly opts-in a recipe to desiring this behavior.
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.
I had proposed something very similar to this before, here: #6560
That didn't get merged because it felt too magical / special case for DeclarativeRecipe to deduplicate as a silent implementation detail. Instead of doing this the first time we decided on creating Singleton.
But with Singleton alone I cannot find a way to guard the scanning phase without breaking ScanningRecipe.generate(). I tried several things. But a common usage for the scanning phase is to verify whether a file already exists, if I skip those then
generate()will create files they shouldn't because their scanner was skipped by Singleton.So I'm resurrecting the declarative recipe duplicate loading skip. This time I'm keying off the presence of
Singleton, which explicitly opts-in a recipe to desiring this behavior.