-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add endpoint to create or update a package set #205 #350
Conversation
Signed-off-by: 404-geek <[email protected]>
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.
@404-geek Thanks for the PR! Can you make a test for this new view?
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
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.
@404-geek Thanks for the revisions! I left a comment about using the text label for content_type choices instead of the integer value when updating a package set
} | ||
|
||
self.assertAlmostEquals(expected, response.data) | ||
|
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.
Add one more test for when an invalid or nonexisting uuid is given to the API.
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.
Added a test for non exisiting uuid
Signed-off-by: 404-geek <[email protected]>
and changed content type to be passed as text labels nexB#205 Signed-off-by: 404-geek <[email protected]>
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.
@404-geek LGTM, thanks!
I have crafted an api for updating a package set with purl entry.
Below is the approach which I have taken.
Take a list of
packages
(where each item is a dictionary containing PURL and content_type).If
uuid
is given then all purls will be added to package set if it exists else a new set would be created and all the purls will be added to that new set.Note: There is also a slight addition to the logic where a purl already exists in the database
and so there are no changes done to the purl entry it is passed as it is.
Request example:
Please feel free to suggest any changes to the approach or if anything false has been assumed/coded.