Fix lint and CLI Integration Test errors from PR#258 - #273
Fix lint and CLI Integration Test errors from PR#258#273Prathibha Muralidharan (Prathibha-m) wants to merge 6 commits into
Conversation
60f3020 to
53f7197
Compare
53f7197 to
3184864
Compare
| linter.ExcludeCommandContains("iam rolebinding"), | ||
| // skip secret commands | ||
| linter.ExcludeCommandContains("secret"), | ||
| linter.ExcludeCommandContains("schema-registry enable"), |
There was a problem hiding this comment.
Hm should probably just be excluding as few as possible here
There was a problem hiding this comment.
I've excluded commands which don't use names/ID's (which is pretty much all of them)
Codecov Report
@@ Coverage Diff @@
## master #273 +/- ##
=========================================
Coverage ? 43.05%
=========================================
Files ? 63
Lines ? 4775
Branches ? 0
=========================================
Hits ? 2056
Misses ? 2457
Partials ? 262
Continue to review full report at Codecov.
|
Cody A. Ray (codyaray)
left a comment
There was a problem hiding this comment.
I think we need to step back and review the DevX here. It's inconsistent with the rest of the CLI.
| vocabWords = []string{ | ||
| "ccloud", "kafka", "api", "acl", "url", "config", "multizone", "transactional", "ksql", "decrypt", "iam", "rolebinding", | ||
| "geo", | ||
| "geo", "subject", "version", "schema", |
There was a problem hiding this comment.
these are actual english words. why do they need to be added here?
| createCmd.Flags().String("cloud", "", "Cloud provider (e.g. 'aws', 'azure', or 'gcp').") | ||
| _ = createCmd.MarkFlagRequired("cloud") | ||
| createCmd.Flags().String("geo", "", "Either 'us', 'eu', or 'apac' (only applies to Enterprise accounts)") | ||
| createCmd.Flags().String("geo", "", "Either 'us', 'eu', or 'apac' (only applies to Enterprise accounts).") |
There was a problem hiding this comment.
is this "only applies to..." still accurate?
There was a problem hiding this comment.
As per the 1-pager doc, that's what it says. But I'll check again!
There was a problem hiding this comment.
Will change it. Thanks for catching that!
| linter.OnlyLeafCommands, linter.ExcludeCommand(utilityCommands...), | ||
| // skip resource container commands | ||
| linter.ExcludeUse("list", "auth"), | ||
| linter.ExcludeUse("list", "auth", "describe", "enable"), |
There was a problem hiding this comment.
this is a very large blanket exclude. this already tests all the other "describe" commands (since that's a standard verb). I'm not sure about "enable" but it sounds pretty standard and shouldn't be wholeheartedly excluded like this.
(Both describe and enable refer to a single resource, right? That's why this exclusion doesn't make so much since, like "list" which doesn't refer to a single resource)
There was a problem hiding this comment.
I see your point. Would it then be a better idea to simply have linter.ExcludeCommandContains("schema-registry"), since schema-registry commands do not have a name or id passed in
| // skip following schema-registry commands which do not use names/ID's | ||
| linter.ExcludeCommandContains("schema-registry compatibility"), | ||
| linter.ExcludeCommandContains("schema-registry schema"), | ||
| linter.ExcludeCommandContains("schema-registry mode"), |
There was a problem hiding this comment.
I don't think I was around to review the original PRs, but these don't seem to all fit with expected grammar for the CLI:
schema-registry <resource--noun> <standard verb: create/describe/update/delete/etc>
I would expect it to be more like this to fit with the rest of the CLI:
schema-registry cluster enable
schema-registry cluster describe
# describe should include the mode and compatibility level for the cluster
schema-registry cluster update --mode=READWRITE
schema-registry cluster update --compatibility=BACKWARD
schema-registry subject list
schema-registry subject describe subjectname
schema-registry subject update subjectname --mode=READWRITE
schema-registry subject update subjectname --compatibility=BACKWARD
No description provided.