-
Notifications
You must be signed in to change notification settings - Fork 0
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
[IA-4912] Add DELETE chartVersion endpoint #6
Conversation
type: array | ||
items: | ||
type: string | ||
style: pipeDelimited |
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.
Hmm... do we really want to take a pipedelimited list of parameters as a raw string in the query params? Would it be possible to take a json payload with a proper array in a POST request?
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.
the possible styles are form, spaceDelimited, pipeDelimited, deepObject
spaceDelimited and pipeDelimited are what you'd expect, this is what the other 2 look like on swagger
Form:
api/admin/v1/charts/versions?chartNames=string1&chartNames=string2
deepObject:
api/admin/v1/charts/versions?chartNames=string1,string2
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.
oh wait I see what you were suggesting, to make this a POST to a different endpoint instead of a DELETE?
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.
yeah, I think I would prefer that to parsing query parameters. Open to other thoughts though, but it seems preferable to either have it take a JSON payload to delete multiple or to have the delete endpoint take a single chartName for deletion
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.
cc: @cpate4 what are your thoughts on making this a POST vs. DELETE? or sticking to a single chartName?
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.
My original thoughts were that we would use this URL form:
DELETE api/admin/v1/charts/versions?chartName=string1&chartName=string2
... and let the framework do "the parsing" for us.
If the hangup is around syntax for deleting multiple, I would recommend just keeping it simple and using @lucymcnatt's original format of:
DELETE api/admin/v1/charts/versions/chartName
Total random aside, and happy for any feedback on this ...
I am seeing the syntax of our URL and wondering if we should just drop the versions/
from the URL, making our URL format:
ACTION api/admin/v1/charts/chartName
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.
I have to agree on the versions/
point, it feels a little redundant when we already have charts/
and I feel comfortable sticking with Form
style (...versions?chartName=string1&chartName=string2
), @jdcanas is that ok with you?
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.
I am tempted to keep it "as is" for now for the following reasons:
- ... if we did this, would we rename chartVersion to chart with the following structure?
{
name: ...
version: ...
app_version: ...
...
}
- but ultimately, the
app_version
is just a param into the chart, and therefore, should we introduceparams
oroptions
as amap
?
... so I go back to, the is a specific case at the moment. I am back to recommending that we leave it, with its current structure, and simplify the endpoint to only delete singles.
6d4c717
to
37e8767
Compare
a9eb8eb
to
2a08258
Compare
this looks good - there are some remaining "chartVersion" references in the code; is there a reason to keep this and not just change everything to "chart"? |
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, just remove the unnecessary throws exception
sonarcube is pointing out
This reverts commit 2a08258.
Quality Gate passedIssues Measures |
Adding the DELETE CRUD Admin endpoint for Sherlock to use to interact with the APP VERSION table
DELETE /api/admin/v1/charts/versions/{chartNames}
Soft-deletes a record in the APP VERSION table (DELETE) (sets their inactive_at datetime)