Open
Conversation
Add output options to the profile create command so that we can return an id for the newly create profile. Supported formats are consistent with other commands (i.e. yaml and json)
f36307e to
bca20a0
Compare
cutecatfann
approved these changes
Feb 10, 2026
cmrigney
approved these changes
Feb 23, 2026
Contributor
cmrigney
left a comment
There was a problem hiding this comment.
lgtm. Just left a couple chore suggestions. I could be wrong but I think we already test those cases.
Comment on lines
+92
to
+97
| case OutputFormatJSON: | ||
| // Output JSON with just the profile ID | ||
| fmt.Printf("{\"id\":\"%s\"}\n", id) | ||
| case OutputFormatYAML: | ||
| // Output YAML with just the profile ID | ||
| fmt.Printf("id: %s\n", id) |
Contributor
There was a problem hiding this comment.
thought: We don't allow quotes in ids, so this seems safe. But if we wanted to future proof it, we could do something like:
var o struct {
ID string `yaml:"id" json:"id"`
}
o.ID = id
data, err := json.Marshal(o)
// err check...
fmt.Printf("%s\n", string(data))
| } | ||
|
|
||
| // TestCreateJSONWithDuplicateIDPrevention tests that JSON output reflects the actual ID with duplicate suffix | ||
| func TestCreateJSONWithDuplicateIDPrevention(t *testing.T) { |
Contributor
There was a problem hiding this comment.
chore: We already test ID duplication I think, so we can remove this test.
| } | ||
|
|
||
| // TestCreateJSONWithNoServers tests that JSON output works correctly with empty server list | ||
| func TestCreateJSONWithNoServers(t *testing.T) { |
Contributor
There was a problem hiding this comment.
chore: This might be overkill since this behavior is already tested I think, and we're really just worried about testing output format.
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.
What I did
Add output options to the profile create command so that we can return an id for the newly create profile. Supported formats are consistent with other commands (i.e. yaml and json)
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did