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): New endpoint allow load SPDX license info from attachment of release (ISR, CLX, CLI) #2049

Merged

Conversation

hoangnt2
Copy link
Contributor

@hoangnt2 hoangnt2 commented Jul 18, 2023

New endpoint allow load SPDX license info from attachment of release (ISR, CLX, CLI)

How To Test?

  1. Upload Attachment with type is Component license information (XML), Component license information (Combined) or Initial Scan Report.
  2. Send GET request to: http://localhost:8080/resource/api/releases/{releaseId}/spdxLicensesInfo?attachmentId={attachmentId}
  3. Example Response:
  • Attachment Type is Initial Scan Report
{
  "otherLicense": "Other License Ids",
  "otherLicenseIds": [
    "MIT",
    "RSA-Security"
  ],
  "license": "Possible Main License Ids",
  "totalFileCount": 4,
  "MIT": [
    "test-3.2.tar.gz/test-3.2/support/sys/cron",
    "test-3.2.tar.gz/test-3.2/support/README",
    "test-3.2.tar.gz/test-3.2/sample"
  ],
  "RSA-Security": [
    "test-3.2.tar.gz/test-3.2/support/md5.h"
  ]
}
  • Attachment Type is Component license information (XML) or Component license information (Combined)
{
  "license": "Concluded License Ids",
  "licenseIds": [
    "BSD-3-Clause",
    "GPL"
  ],
  "otherLicense": "Other License Ids",
  "otherLicenseIds": [
    "MIT",
    "RSA-Security"
  ]
}

Refer to Rest doc for more information: http://localhost:8080/resource/docs/api-guide.html#resources-load-SPDX-license-info-from-attachment-of-release

@hoangnt2 hoangnt2 added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for REST New-UI Level for the API and UI level changes for the new-ui labels Jul 18, 2023
@nikkuma7
Copy link
Contributor

Test successful.

image
image

AttachmentType: ISR (Initial Scan Report)
image
image
image

@ag4ums ag4ums removed the needs general test This is general testing, meaning that there is no org specific issue to check for label Jul 19, 2023
@hoangnt2 hoangnt2 force-pushed the release/load_spdx_attachment_info branch from d0bebae to 9553007 Compare July 27, 2023 04:26
@hoangnt2 hoangnt2 force-pushed the release/load_spdx_attachment_info branch from 9553007 to f5ec0f0 Compare August 3, 2023 09:15
@hoangnt2 hoangnt2 force-pushed the release/load_spdx_attachment_info branch from f5ec0f0 to 00e8a39 Compare August 21, 2023 09:47
@afsahsyeda
Copy link
Contributor

Hi, found this test in the Rest API Docs...not sure it belongs there
image

@afsahsyeda afsahsyeda self-requested a review August 22, 2023 05:35
@hoangnt2
Copy link
Contributor Author

Hi, found this test in the Rest API Docs...not sure it belongs there image

Hi @afsahsyeda, there are 2 response's formats for this API with ISR attachment and CLX(CLI) attachment. In your image, it's response for CLX or CLI file type

@afsahsyeda
Copy link
Contributor

@hoangnt2 is it supposed to be a part of the response for CLX attachment?

@hoangnt2
Copy link
Contributor Author

hoangnt2 commented Aug 22, 2023

@hoangnt2 is it supposed to be a part of the response for CLX attachment?

@afsahsyeda Yes it's response for CLX attachment. Actually, I'm not clearly about this feature, I'm trying to do the same as Portlet is doing. So if you find out any problems please let me know

@hoangnt2 hoangnt2 force-pushed the release/load_spdx_attachment_info branch from 00e8a39 to 5dfae41 Compare August 23, 2023 05:03
@hoangnt2 hoangnt2 force-pushed the release/load_spdx_attachment_info branch from 5dfae41 to afe118d Compare August 23, 2023 06:39
@afsahsyeda afsahsyeda added ready ready to merge and removed needs code review labels Aug 23, 2023
@ag4ums ag4ums merged commit afe96c1 into eclipse-sw360:main Aug 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New-UI Level for the API and UI level changes for the new-ui ready ready to merge REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants