feat: initial commit for abra app volume ls/rm #51

Merged
roxxers merged 2 commits from knoflook/abra:secret-create into main 2021-08-18 18:29:14 +00:00
Owner
No description provided.
roxxers requested changes 2021-08-12 13:20:20 +00:00
roxxers left a comment
First-time contributor

Just needs to check for if the app exists to work great out of the box, i gave you a code snippet to fix that.

Just needs to check for if the app exists to work great out of the box, i gave you a code snippet to fix that.
@ -0,0 +21,4 @@
Action: func(c *cli.Context) error {
appName := c.Args().First()
if appName == "" {
internal.ShowSubcommandHelpAndError(c, errors.New("No app name provided!"))
First-time contributor

Style: Errors should not start with capital. https://staticcheck.io/docs/checks#ST1005

Style: Errors should not start with capital. https://staticcheck.io/docs/checks#ST1005
First-time contributor

I am also unsure of using this error vs just printing the help page without the error. Since not giving the first arg seems to do so without error for other commands. This is more a thing for future clean up tbf and me rambling.

I am also unsure of using this error vs just printing the help page without the error. Since not giving the first arg seems to do so without error for other commands. This is more a thing for future clean up tbf and me rambling.
roxxers marked this conversation as resolved
@ -0,0 +27,4 @@
if err != nil {
logrus.Fatal(err)
}
host := appFiles[appName].Server
First-time contributor

As discussed with my panic hour, this just isn't checking if the app itself exists leading to a weird error that is very confusing. Like "Context '' does not exist."

var host string
if app, ok := appFiles[appName]; ok {
	host = app.Server
}
if host == "" {
	logrus.Fatalf(`app "%s" does not exist`, appName)
}

Just tested this and it works great with this addition.

As discussed with my panic hour, this just isn't checking if the app itself exists leading to a weird error that is very confusing. Like "Context '' does not exist." ```go var host string if app, ok := appFiles[appName]; ok { host = app.Server } if host == "" { logrus.Fatalf(`app "%s" does not exist`, appName) } ``` Just tested this and it works great with this addition.
First-time contributor

Just realised this should be simplified to

var host string
if app, ok := appFiles[appName]; ok {
	host = app.Server
} else {
	logrus.Fatalf(`app "%s" does not exist`, appName)
}
Just realised this should be simplified to ```go var host string if app, ok := appFiles[appName]; ok { host = app.Server } else { logrus.Fatalf(`app "%s" does not exist`, appName) } ```
knoflook marked this conversation as resolved
@ -0,0 +42,4 @@
if err != nil {
logrus.Fatal(err)
}
fmt.Println("DRIVER\t\t\tVOLUME NAME")
First-time contributor

Minimal: We use table creation in the formatter for the abra/cli package

Minimal: We use table creation in the formatter for the abra/cli package
knoflook marked this conversation as resolved
@ -0,0 +66,4 @@
if err != nil {
logrus.Fatal(err)
}
host := appFiles[appName].Server
First-time contributor

Same issue as before. Since you are doing this twice you could refactor some of the calls here into their own functions so both commands can use them?

Same issue as before. Since you are doing this twice you could refactor some of the calls here into their own functions so both commands can use them?
knoflook marked this conversation as resolved
@ -0,0 +86,4 @@
volumeNames = append(volumeNames, volume.Name)
}
var volumesToRemove []string
if !internal.Force {
First-time contributor

This is great!!

This is great!!
roxxers marked this conversation as resolved
knoflook force-pushed secret-create from bfa2237103 to c3088a5158 2021-08-17 18:40:42 +00:00 Compare
Author
Owner

@roxxers could you review the code? Should be good now!

@roxxers could you review the code? Should be good now!
roxxers merged commit d2d0ce3d05 into main 2021-08-18 18:29:14 +00:00
First-time contributor

LGTM

LGTM
Sign in to join this conversation.
No description provided.