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

feat(rest): Added new endpoints to update attachment info of Project, Component, Release #1190

Merged

Conversation

JaideepPalit
Copy link
Contributor

@JaideepPalit JaideepPalit commented Apr 28, 2021

Added new endpoints to update attachment info of Project, Component, Release.

Issue: closes #1189

How To Test?

Refer Rest Documentation
http://localhost:8080/resource/docs/api-guide.html#resources-project-attachment-info-update
Example Request -

curl 'https://sw360.org/api/projects/98745/attachment/1234' -i -X PATCH 
-H 'Content-Type: application/hal+json' -H 'Authorization: Bearer **********' -H 'Accept: application/hal+json' 
-d '{
  "attachmentType" : "BINARY",
  "createdComment" : "Created Comment",
  "checkedComment" : "Checked Comment",
  "checkStatus" : "ACCEPTED"
}'

http://localhost:8080/resource/docs/api-guide.html#resources-component-attachment-info-update
Example Request -

curl 'https://sw360.org/api/components/98745/attachment/1234' -i -X PATCH 
-H 'Content-Type: application/hal+json' -H 'Authorization: Bearer *******' -H 'Accept: application/hal+json' 
-d '{
  "attachmentType" : "BINARY",
  "createdComment" : "Created Comment",
  "checkedComment" : "Checked Comment",
  "checkStatus" : "ACCEPTED"
}'

http://localhost:8080/resource/docs/api-guide.html#resources-release-attachment-info-update
Example Request -

curl 'https://sw360.org/api/releases/98745/attachment/1234' -i -X PATCH 
-H 'Content-Type: application/hal+json' -H 'Authorization: Bearer *************' -H 'Accept: application/hal+json' 
-d '{
  "attachmentType" : "BINARY",
  "createdComment" : "Created Comment",
  "checkedComment" : "Checked Comment",
  "checkStatus" : "ACCEPTED"
}'

Have you implemented any additional tests? - No

Checklist

Must:

  • All related issues are referenced in commit messages and in PR

Signed-off-by: Jaideep Palit jaideep.palit@siemens.com

@JaideepPalit JaideepPalit added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Apr 28, 2021
@akapti akapti self-requested a review April 29, 2021 08:46
@JaideepPalit JaideepPalit force-pushed the feat/UpdateAttachmentMetadataRest branch from 89c045b to b50f1f6 Compare April 29, 2021 12:15
Copy link
Contributor

@akapti akapti left a comment

Choose a reason for hiding this comment

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

Reviewed the code, suggested some minor changes.
Tested the changes, and all the 3 endpoints working as expected.

… Component, Release

Signed-off-by: Jaideep Palit <jaideep.palit@siemens.com>
@JaideepPalit JaideepPalit force-pushed the feat/UpdateAttachmentMetadataRest branch from b50f1f6 to 4140a8a Compare April 30, 2021 06:55
@JaideepPalit
Copy link
Contributor Author

Thanks for review and test.
Incorporated changes based on review comments

Copy link
Contributor

@akapti akapti left a comment

Choose a reason for hiding this comment

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

Code looks good.
Tested the PR again after changes, and is working fine.

@akapti akapti added ready ready to merge and removed needs general test This is general testing, meaning that there is no org specific issue to check for labels May 3, 2021
@mcjaeger mcjaeger merged commit 2a06ded into eclipse-sw360:master May 7, 2021
@Lythenas
Copy link

Lythenas commented Jun 9, 2021

Is there a reason that the patch url is different from the get url?

To get the attachment infos you need to use https://sw360.org/api/releases/1234/attachments/1234
but to patch the same infos you need to use https://sw360.org/api/releases/1234/attachment/1234. I think this is really inconvenient.

It would also be nice if attachment infos could be updated through the self link (i.e. https://sw360.org/api/attachments/1234)

@mcjaeger
Copy link
Contributor

mcjaeger commented Jun 9, 2021

so, it is about the "s" ... I agree, but I am not sure how much trouble we cause will there be in case we change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REST API: allow modification of attachment meta info (checkStatus)
4 participants