-
Notifications
You must be signed in to change notification settings - Fork 147
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
base: main
Are you sure you want to change the base?
fix(rest): Add license information linking for project releases. #2871
Conversation
...-server/src/main/java/org/eclipse/sw360/rest/resourceserver/project/Sw360ProjectService.java
Outdated
Show resolved
Hide resolved
jsonResult.put(SW360Constants.STATUS, SW360Constants.FAILURE); | ||
} | ||
|
||
componentClient.updateRelease(release, sw360User); |
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.
This call can result in creation of Moderation Request. Please add comment field for the same in the controller as done in #2405
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.
@GMishx , For this endpoint, a Moderation Request is not required, so adding a comment field is not necessary.
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.
@nikkuma7 , I get it now, the function processSingleAttachment()
updates the release by calling setMainLicenseIds()
and setOtherLicenseIds()
.
Thus, calling componentClient.updateRelease()
can result in moderation request. The comparator for Release
does checks the mainLicenseIds
and otherLicenseIds
fields.
Please test again!
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.
@nikkuma7 any updates on this?
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.
A moderation request is now created when clicking the "Add License Info" button. The moderation request is also created at the time of attachment creation or when modifying the attachment file. However, the moderation request is not created when clicking the "License Info" button.
...ce-server/src/main/java/org/eclipse/sw360/rest/resourceserver/project/ProjectController.java
Outdated
Show resolved
Hide resolved
Any updates @nikkuma7 ? |
de1b3a4
to
42d0655
Compare
comment addressed. |
42d0655
to
fc1d47d
Compare
@nikkuma7 looks like the above 2 comments from me are not incorporated. Please have a look again. |
fc1d47d
to
dd6a077
Compare
...ce-server/src/main/java/org/eclipse/sw360/rest/resourceserver/project/ProjectController.java
Outdated
Show resolved
Hide resolved
...ce-server/src/main/java/org/eclipse/sw360/rest/resourceserver/project/ProjectController.java
Outdated
Show resolved
Hide resolved
jsonResult.put(SW360Constants.STATUS, SW360Constants.FAILURE); | ||
} | ||
|
||
componentClient.updateRelease(release, sw360User); |
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.
@nikkuma7 , I get it now, the function processSingleAttachment()
updates the release by calling setMainLicenseIds()
and setOtherLicenseIds()
.
Thus, calling componentClient.updateRelease()
can result in moderation request. The comparator for Release
does checks the mainLicenseIds
and otherLicenseIds
fields.
Please test again!
dd6a077
to
4bdbad8
Compare
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.
@nikkuma7 can you please take a look and close this PR ASAP? UI will be needing it soon.
log.info("Updating licenses for release: {}", release.getId()); | ||
release.setMainLicenseIds(mainLicenses); | ||
release.setOtherLicenseIds(otherLicenses); | ||
} else { | ||
log.info("No changes detected for release: {}", release.getId()); |
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 logs here are more of debug statement IMO. I'd use log.debug
instead of log.info
|
||
MockHttpServletRequestBuilder requestBuilder = post("/api/projects/" + projectId + "/addLinkedRelesesLicenses") | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.param("comment", comment) |
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 param comment
is sent here but not read in the controller. Am I missing something?
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.
done.
Signed-off-by: Nikesh kumar <[email protected]>
4bdbad8
to
1ab8200
Compare
Issue: #2844
Suggest Reviewer
How To Test?
resource/api/projects/{id}/addLinkedRelesesLicenses
please check project should have licenses attached.
Checklist
Must: