test: cover empty tag sets when prompting for tenant tags - #624
Open
NickJosevski wants to merge 1 commit into
Open
test: cover empty tag sets when prompting for tenant tags#624NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
`tenant create` used to fail interactively with "please provide options to select from" on any space without usable tag sets. The old AskTags helper flattened every tag set into one list and always raised a MultiSelect, so an empty list aborted the prompt. That helper was replaced by selectors.Tags in #548, which iterates each tag set and skips the ones with no tags, so the reported failure no longer occurs. Nothing covered that behaviour though, and the fix was incidental rather than deliberate, so add regression tests for the zero-tag-set, empty-single-select and empty-multi-select cases, plus an empty tag set sitting alongside a populated one. Fixes #529 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NickJosevski
marked this pull request as ready for review
August 4, 2026 07:17
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.
Fixes #529
Adding tests only
The reported bug is already fixed, incidentally, and this adds only the missing regression coverage. Close #529 without merging if you'd rather not carry the tests.
What was actually wrong
tenant createfailed interactively withplease provide options to select fromon any space without usable tag sets. The oldAskTagshelper inpkg/cmd/tenant/create/create.goflattened every tag set into one list and always raised asurvey.MultiSelect:With no tag sets — or only empty ones —
Optionsis empty andsurveyext/select.gorejects it.Why it no longer reproduces
#548 (feat: Extend tag sets and add environment tags, Nov 2025) replaced
AskTagswithselectors.Tags, which iterates each tag set and skips the empty ones. That landed after the versions in the report (2.15.7 and 2.18.0), so the fix has been shipping since ~2.19.0.🤖 Generated with Claude Code