Warn when some templates can't be upgraded #1147
Merged
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.
Originally,
spin templates upgrade
ignored templates with no origin info, because there's not much it can do about them.However, this was a poor initial experience because existing installs would not have origin info. So now, if we detect that no templates have origin info (and so cannot be upgraded), we print a warning that tells people how to upgrade the old way.
But this is still a suboptimal experience because a user could, say, old-skool upgrade the Spin repo templates and forget about the JS SDK repo. Now the upgrade command would offer to upgrade the Spin repo, but mysteriously not show the JS repo, and there would be no clue as to why.
This PR adds YET MOAR verbiage to the flood. In the situation above, the user will now see:
(The additional "can be automatically upgraded" line is shown only if there was a warning; it is there to separate the warning from the selector, and make the context of the selector clear.)
The hope is that, after the initial experience, users will not see this verbiage again. However, users with templates installed from local directories will see it each time. Hopefully that is edge case enough not to be a significant issue - and if it is we can refine it over time.