Make sure specs are fetched from the right source when materializing #4562
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.
What was the end-user or developer problem that led to this PR?
Sometimes, the dependency names initially set for each source will end up not matching that actual dependency names that got fetched from each source. We fix this issue by fetching any missing specs for the source set for each spec before materializing it, to make sure they will actually be found in the source.
However, unless this "double check" is the very last manipulation of the source, it can happen that other manipulations of the source (like
source.local!
orsource.remote!
) "cancel" the extra fetches.This is a bit of a mess right now, but I expect to improve it so that the dependency names to be fetched from each source are set correctly from the beginning, so that we no longer need to do all this dance before materializing.
What is your fix for the problem, implemented in this PR?
For now I move the extra fetching of missing dependency names to be the last manipulation of the source before materialization to fix this issue. But I expect to completely remove the need for these manipulations by accurately setting the dependency names to be fetched from each source beforehand in the future.
Fixes #4553.
Make sure the following tasks are checked