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

fix(rest): Add license information linking for project releases. #2871

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nikkuma7
Copy link
Contributor

Please provide a summary of your changes here.

  • Which issue is this pull request belonging to and how is it solving it? (Refer to issue here)
  • Did you add or update any new dependencies that are required for your change?

Issue: #2844

Suggest Reviewer

You can suggest reviewers here with an @mention.

How To Test?

resource/api/projects/{id}/addLinkedRelesesLicenses
please check project should have licenses attached.

How should these changes be tested by the reviewer?
Have you implemented any additional tests?

Checklist

Must:

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

@GMishx GMishx added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for has merge conflicts The PR has merge conflicts labels Jan 27, 2025
Comment on lines 1596 to 1598
Set<String> mainLicenses = release.getMainLicenseIds() != null ? release.getMainLicenseIds() : new HashSet<>();
Set<String> otherLicenses = release.getOtherLicenseIds() != null ? release.getOtherLicenseIds()
: new HashSet<>();
Copy link
Member

Choose a reason for hiding this comment

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

In accordance with #2827, the main licenses and other licenses of the release should be overwritten.

Thus the mainLicenses and otherLicenses should always be created as fresh HashSet.

jsonResult.put(SW360Constants.STATUS, SW360Constants.FAILURE);
}

componentClient.updateRelease(release, sw360User);
Copy link
Member

Choose a reason for hiding this comment

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

This call can result in creation of Moderation Request. Please add comment field for the same in the controller as done in #2405

mediaType = "application/hal+json",
schema = @Schema(type = "object", implementation = JSONObject.class),
examples = @ExampleObject(
value = "{\n \"one\": [\"Release1\", \"Release2\"],\n \"mul\": [\"Release3\"]\n}"
Copy link
Member

Choose a reason for hiding this comment

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

The actual response seems more like following.

Suggested change
value = "{\n \"one\": [\"Release1\", \"Release2\"],\n \"mul\": [\"Release3\"]\n}"
value = "{\n \"releasesWithSingleCLI\": [\"Release1\", \"Release2\"],\n \"releasesWithMultipleCLI\": [\"Release3\"],\n \"STATUS\": \"FAILURE\"\n}"

@GMishx
Copy link
Member

GMishx commented Jan 31, 2025

Any updates @nikkuma7 ?

@nikkuma7 nikkuma7 force-pushed the feat/Add_License_Info_to_Release branch from de1b3a4 to 42d0655 Compare February 4, 2025 04:42
@nikkuma7
Copy link
Contributor Author

nikkuma7 commented Feb 4, 2025

Any updates @nikkuma7 ?

comment addressed.

@nikkuma7 nikkuma7 removed the has merge conflicts The PR has merge conflicts label Feb 4, 2025
@rudra-superrr rudra-superrr added the has merge conflicts The PR has merge conflicts label Feb 6, 2025
@nikkuma7 nikkuma7 force-pushed the feat/Add_License_Info_to_Release branch from 42d0655 to fc1d47d Compare February 7, 2025 06:18
@nikkuma7 nikkuma7 removed the has merge conflicts The PR has merge conflicts label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs code review needs general test This is general testing, meaning that there is no org specific issue to check for
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants