Skip to content
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

Include provider ID in minder CLI response #5029

Merged

Conversation

navnitms
Copy link
Contributor

Fixed the issue where deleting a provider by its ID was not possible due to the missing provider ID in the CLI response

Summary

Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.

Fixes #5000

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Tested the flow using CLI command minder provider get -n <provider-name>

Response :

image

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

Fixed the issue where deleting a provider by its ID was not possible due to the missing provider ID in the CLI response
@navnitms navnitms requested a review from a team as a code owner November 22, 2024 18:30
@coveralls
Copy link

coveralls commented Nov 22, 2024

Coverage Status

coverage: 54.515% (-0.005%) from 54.52%
when pulling 426301a on navnitms:add-provider-id-to-cli-response
into c6efd48 on mindersec:main.

Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

Two minor comments, but I'm happy to merge as-is, and you can do a follow-up PR if you want, since our usage of google.api.field_behavior is not very consistent, so we'll need to do a pass over all the fields anyway.

Comment on lines +3353 to +3356
string id = 10 [
(buf.validate.field).string = {uuid: true},
(buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
];
Copy link
Member

Choose a reason for hiding this comment

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

Not strictly required, but you might want to also add the (google.api.field_behavior) = OUTPUT_ONLY annotation, since I expect that we would reject changing the ID on create/update.

Here's an example:

https://github.com/mindersec/minder/blob/main/proto/minder/v1/minder.proto#L3646

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure will do a follow up PR to address this
Thanks

Comment on lines +84 to 87
t.AddRow("ID", p.GetId())
t.AddRow("Name", p.GetName())
t.AddRow("Project", p.GetProject())
t.AddRow("Version", p.GetVersion())
Copy link
Member

Choose a reason for hiding this comment

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

This is fine for now, but these wide tables end up being a bit ugly, so we'll probably (at some future point) need to figure out how to collapse them more elgantly. (And a 36-character wide UUID doesn't help, but it's not the only contributor)

@evankanderson
Copy link
Member

(The security scan failure is an upstream Trivy issue where they are triggering on their own examples...)

@evankanderson evankanderson merged commit 8b25d8c into mindersec:main Nov 22, 2024
25 of 26 checks passed
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.

Cannot delete a provider by its ID using the CLI
3 participants