-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NOISSUE - Fix bootstrap token naming and interfaces named args #1117
Conversation
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
bootstrap/service.go
Outdated
if err != nil { | ||
if id == "" { | ||
// Fail silently. | ||
bs.sdk.DeleteThing(cfg.MFThing, key) | ||
bs.sdk.DeleteThing(cfg.MFThing, token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of bs.sdk.DeleteThing
is not checked (from errcheck
)
bootstrap/service.go
Outdated
if err != nil { | ||
if err == mfsdk.ErrNotFound { | ||
return mfsdk.Thing{}, errors.Wrap(errThingNotFound, ErrNotFound) | ||
} | ||
|
||
if id != "" { | ||
bs.sdk.DeleteThing(thingID, key) | ||
bs.sdk.DeleteThing(thingID, token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of bs.sdk.DeleteThing
is not checked (from errcheck
)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
bootstrap/configs.go
Outdated
|
||
// RetrieveByID retrieves the Config having the provided identifier, that is owned | ||
// by the specified user. | ||
RetrieveByID(string, string) (Config, error) | ||
RetrieveByID(key, id string) (Config, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider renaming key
to owner
in repository methods (both interface and implementation, but in tests also).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1117 +/- ##
=======================================
Coverage 76.12% 76.12%
=======================================
Files 96 96
Lines 6890 6890
=======================================
Hits 5245 5245
Misses 1295 1295
Partials 350 350 Continue to review full report at Codecov.
|
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
@@ -57,7 +57,7 @@ func NewConfigRepository(db *sqlx.DB, log logger.Logger) bootstrap.ConfigReposit | |||
return &configRepository{db: db, log: log} | |||
} | |||
|
|||
func (cr configRepository) Save(cfg bootstrap.Config, connections []string) (string, error) { | |||
func (cr configRepository) Save(cfg bootstrap.Config, chsConnIDs []string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider renaming chsConnIDs
.
* NOISSUE - Fix bootstrap token naming and interfaces named args Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix CI bot Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use owner for repository layer Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: Manuel Imperiale manuel.imperiale@gmail.com