Skip to content

Conversation

@priteshbandi
Copy link
Contributor

@priteshbandi priteshbandi commented Dec 23, 2023

  • Adding more functionality required for notation-go to depend on this pkg.
  • Also some renaming and update to Error struct to matching it with notation-go.

Signed-off-by: Pritesh Bandi <priteshbandi@gmail.com>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

  1. Please add doc to struct CLI defined at line 23 of cli.go.
  2. When I new a CLI struct with pl == nil: cli, _ := New("notation-my-plugin", nil), this will panic when I call cli.Execute(...). We should always check nil when new a CLI.
  3. In NewWithLogger function, we are only checking prefix of the plugin executable name. We should also check the suffix matches with the plugin's metadata.Name, i.e. {plugin-name} of notation-{plugin-name} should equal to pl.GetMetadata resp.Name. In fact, do we really need the executableName parameter here?
  4. deferStdout() and type discardLogger struct{} should be moved to utils.go
  5. In utils.go getValidArgs(), the result strings should not be hardcoded, because they are defined in the proto.go:
    type Command string

priteshbandi and others added 2 commits December 25, 2023 21:16
Co-authored-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Pritesh Bandi <priteshbandi@gmail.com>
Co-authored-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Pritesh Bandi <priteshbandi@gmail.com>
@priteshbandi priteshbandi force-pushed the main branch 2 times, most recently from ff76a38 to 591e3f3 Compare December 30, 2023 09:10
Signed-off-by: Pritesh Bandi <priteshbandi@gmail.com>
@priteshbandi
Copy link
Contributor Author

  1. Please add doc to struct CLI defined at line 23 of cli.go.

    1. When I new a CLI struct with pl == nil: cli, _ := New("notation-my-plugin", nil), this will panic when I call cli.Execute(...). We should always check nil when new a CLI.

    2. In NewWithLogger function, we are only checking prefix of the plugin executable name. We should also check the suffix matches with the plugin's metadata.Name, i.e. {plugin-name} of notation-{plugin-name} should equal to pl.GetMetadata resp.Name. In fact, do we really need the executableName parameter here?

    3. deferStdout() and type discardLogger struct{} should be moved to utils.go

    4. In utils.go getValidArgs(), the result strings should not be hardcoded, because they are defined in the proto.go:

      type Command string

Done. Addressed all the feedbacks

Signed-off-by: Pritesh Bandi <priteshbandi@gmail.com>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM with a single nit comment.

Signed-off-by: Pritesh Bandi <priteshbandi@gmail.com>
Signed-off-by: Pritesh Bandi <priteshbandi@gmail.com>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@rgnote rgnote left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JeyJeyGao JeyJeyGao left a comment

Choose a reason for hiding this comment

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

LGTM

@priteshbandi priteshbandi merged commit c077eda into notaryproject:main Jan 3, 2024
@priteshbandi priteshbandi mentioned this pull request Jan 29, 2024
6 tasks
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