Skip to content

CC-4669 CC-4671 CLI-125 Schema Registry API Key commands - #258

Merged
Prathibha Muralidharan (Prathibha-m) merged 45 commits into
masterfrom
prathibha-sr-apikey
Aug 28, 2019
Merged

CC-4669 CC-4671 CLI-125 Schema Registry API Key commands#258
Prathibha Muralidharan (Prathibha-m) merged 45 commits into
masterfrom
prathibha-sr-apikey

Conversation

@Prathibha-m

Copy link
Copy Markdown
Contributor

No description provided.

@Prathibha-m
Prathibha Muralidharan (Prathibha-m) force-pushed the prathibha-sr-apikey branch 2 times, most recently from 4604514 to c672dae Compare August 20, 2019 18:06
@codecov

codecov Bot commented Aug 20, 2019

Copy link
Copy Markdown

Codecov Report

Merging #258 into master will increase coverage by 1.96%.
The diff coverage is 39.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #258      +/-   ##
==========================================
+ Coverage   41.08%   43.04%   +1.96%     
==========================================
  Files          62       63       +1     
  Lines        4732     4776      +44     
==========================================
+ Hits         1944     2056     +112     
+ Misses       2543     2458      -85     
- Partials      245      262      +17
Impacted Files Coverage Δ
internal/cmd/command.go 0% <ø> (ø) ⬆️
internal/pkg/cmd/config.go 19.51% <ø> (ø) ⬆️
internal/pkg/errors/errors.go 12.5% <ø> (ø) ⬆️
internal/pkg/cmd/flags.go 0% <0%> (ø) ⬆️
internal/cmd/apikey/utils.go 47.61% <47.61%> (ø)
internal/cmd/apikey/command.go 56.35% <69.23%> (+56.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2fdbca3...d80f6d1. Read the comment docs.

@Prathibha-m Prathibha Muralidharan (Prathibha-m) changed the title CC-4669 CC-4671 Schema Registry API Key commands CC-4669 CC-4671 CLI-125 Schema Registry API Key commands Aug 21, 2019

@codyaray Cody A. Ray (codyaray) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

approach looks good to me. a bunch of little code nits and a couple missing tests, but no blockers in here

Comment thread cmd/lint/main.go Outdated
Comment thread internal/pkg/cmd/flags.go
Comment thread internal/pkg/cmd/flags.go Outdated
Comment thread internal/pkg/cmd/config.go Outdated
Comment thread internal/cmd/schema-registry/command.go Outdated
Comment thread cmd/lint/main.go
Comment thread internal/cmd/apikey/apikey_test.go Outdated
Comment thread internal/cmd/apikey/apikey_test.go Outdated

func (suite *APITestSuite) TestDeleteApiKey() {
cmd := suite.newCMD()
cmd.SetArgs(append([]string{"delete", apiKey}))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably want to verify that correct apiKey ID was passed to the update and delete api keys

Comment thread internal/cmd/apikey/apikey_test.go Outdated
Comment thread test/apikey_test.go
@Prathibha-m
Prathibha Muralidharan (Prathibha-m) force-pushed the prathibha-sr-apikey branch 3 times, most recently from dc2960d to 7b85955 Compare August 23, 2019 21:02
Comment thread internal/cmd/apikey/command.go Outdated
Comment thread internal/cmd/apikey/utils.go Outdated
Comment thread internal/cmd/apikey/utils.go
Comment thread internal/cmd/apikey/utils.go Outdated
Comment thread test/fixtures/output/apikey20.golden

@codyaray Cody A. Ray (codyaray) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm, nice work!

a couple small things left, mostly test updates and a couple nits.

Comment thread internal/cmd/apikey/command.go Outdated

if err := c.keystore.StoreAPIKey(userKey, kcc.ID, environment); err != nil {
return errors.HandleCommon(errors.Wrapf(err, "Unable to store API key locally."), cmd)
if resourceType == "kafka" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you pull out consts to the top of the file for the different resource types?

Comment thread internal/cmd/apikey/utils.go
Comment thread internal/pkg/cmd/config.go Outdated
}
return &kafkav1.KafkaCluster{AccountId: c.Config.Auth.Account.Id, Id: kafka.ID, ApiEndpoint: kafka.APIEndpoint}, nil
}
func (c *ConfigHelper) SchemaRegistry(resourceID, environment string, ctx context.Context) (*srv1.SchemaRegistryCluster, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just noticed this has nothing to do with the CLI config; why's it in the ConfigHelper?

nit: ctx should always be the first param on a method

@Prathibha-m

Copy link
Copy Markdown
Contributor Author

Thanks so much for the reviews Cody A. Ray (@codyaray)! Addressed all your comments

@DABH

Copy link
Copy Markdown
Contributor

I am going to revert this PR for now since #273 which fixes it requires some additional work / renaming which won't happen for a few days

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.

4 participants