spin new -E should not fail just because template update fails#3565
Merged
itowlson merged 1 commit intoJun 11, 2026
Conversation
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
vdice
approved these changes
Jun 11, 2026
vdice
left a comment
Contributor
There was a problem hiding this comment.
LGTM. I'd guess you're likely to have the most critical eye towards code structure; I'm not too worried. Timeout: perhaps, at some point... but don't think it is a pressing need. (Probably other spots in Spin code where it might apply? A holistic helper func/pkg might be the way to go.)
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.
spin new -Ealways tries to install the latest templates from the remote. If this fails,spin newbails.But this is suboptimal for people doing
spin new -Eon a plane or whatever. If they've already got templates for their environment, they should be allowed to use those: okay, they might not be the latest, but 1. they probably are and 2. even if they're not, they're still better than nothing.This fixes that. As long as they have templates for the env, they'll be able to create apps even while away from the network.
(Obviously, if they have never had the templates at all before getting on the plane, they're still out of luck. Fixing this is outside the scope of Spin.)
Tested by
new -E-ing from a local env file, then modifying the env file to point to an invalid tag andnew -E-ing again. Got the "can't check" warning but it still let me use the templates.Reviewer notes:
I am not sure what to do about the code structure here. The function is now nearly 100 lines, with multiple conditionals and significant nesting, and arms pushed more than a screen apart so you see a case and go "wait what does this go with". I tried extracting functions to do the env template install and manage the if-then logic (e.g. return an outcome code and drive messaging off that( but nothing came out very nicely. Advice welcome!
I wondered if I should put a timeout on it so the user of a ropey network doesn't get blocked waiting for a network connection that will never come. It's a nice backstop but man even moar complexity? Yikes. Thoughts?