coder features list CLI command#3533
Conversation
Signed-off-by: Spike Curtis <[email protected]>
Signed-off-by: Spike Curtis <[email protected]>
Signed-off-by: Spike Curtis <[email protected]>
Signed-off-by: Spike Curtis <[email protected]>
Signed-off-by: Spike Curtis <[email protected]>
Signed-off-by: Spike Curtis <[email protected]>
|
|
||
| client := coderdtest.New(t, nil) | ||
| coderdtest.CreateFirstUser(t, client) | ||
| cmd, root := clitest.New(t, "features", "list", "-o", "json") |
There was a problem hiding this comment.
Possibly slightly weird is that when you do -o json you get the whole Entitlements struct, but when you do -o table (or default output), you only get the features in the table.
What is missing in the table output are the warnings, but our plan is to print license warnings after every CLI command, so when that is done you will still get them in the output.
kylecarbs
left a comment
There was a problem hiding this comment.
Just one comment on the API, but LGTM.
| type EntitlementsRequest struct { | ||
| // placeholder so that we can add request parameters in future | ||
| // without breaking changes to the go API | ||
| } |
There was a problem hiding this comment.
I'm tempted not to do this unless we have certainty that all parameters would be optional.
Otherwise a syntax error wouldn't occur, but the API request may fail.
There was a problem hiding this comment.
We don't have certainty that all parameters will be optional, but adding a new non-optional parameter is always an API breaking change.
If we formulate things with this placeholder, we at least have a straightforward way to add optional parameters in future without a breaking change. It's true that we could do opts ...EntilementsRequestOptions in future, but that's inconsistent with how other methods work, so I added the placeholder...
There was a problem hiding this comment.
Hmm, well, looks like my hand is being forced to what you suggest anyway. Typescript doesn't like the empty struct from our autogenerated code, so I'll just drop this. Not worth fixing for something we're not crazy about in the first place.
Signed-off-by: Spike Curtis <[email protected]>
Signed-off-by: Spike Curtis <[email protected]>
Fixes #3278