Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In spin new/add, display only templates compatible with current command #2984

Merged

Conversation

itowlson
Copy link
Contributor

This addresses an issue noted by @tschneidereit (#2970 (comment)) - if you run spin add or spin new without a template ID, it prompts you for a template, but the prompt lists all templates regardless of if they support the current command variant. For example, if you do a spin add, it lists http-grain even though that template is currently new-only1.

This PR filters the selection list based on whether a template supports the current variant.

Footnotes

  1. Because laziness that is why.

@itowlson
Copy link
Contributor Author

I believe the CI failures are spurious. The Go failure has a fix waiting to be merged, and the JS ones seem to have started today.

Copy link
Contributor

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you!

@itowlson itowlson force-pushed the templates-dont-offer-when-doesnt-have-variant branch from f5f501c to d10b10b Compare January 21, 2025 18:51
@itowlson
Copy link
Contributor Author

@fermyon/administrators The CI failures are verified spurious (shenanigans afoot in the JS SDK repo) - can someone force merge this please? Thanks!

@vdice vdice merged commit 0817a0e into fermyon:main Jan 21, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants