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(obligation): list license obligation table data #2302

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

rudra-superrr
Copy link
Contributor

@rudra-superrr rudra-superrr commented Feb 7, 2024

Issue: Closes #2301

Description:
This new endpoint will list license obligation data for the given project.

@rudra-superrr rudra-superrr force-pushed the feat/licenseObligationTable branch 2 times, most recently from d4fee59 to a710935 Compare February 7, 2024 06:17
@rudra-superrr rudra-superrr changed the title Feat/license obligation table feat(obligation): list license obligation table data Feb 7, 2024
@rudra-superrr rudra-superrr force-pushed the feat/licenseObligationTable branch 4 times, most recently from 3ba0737 to 1e2d97d Compare February 7, 2024 07:10
@rudra-superrr rudra-superrr added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for REST labels Feb 7, 2024
@eldrin30 eldrin30 self-assigned this Feb 9, 2024
@eldrin30
Copy link
Contributor

eldrin30 commented Feb 12, 2024

Test successful
Screenshot from 2024-02-12 11-50-03

@ag4ums ag4ums assigned KoukiHama and unassigned eldrin30 Feb 28, 2024
@RequestMapping(value = PROJECTS_URL + "/{id}/licenseObligations", method = RequestMethod.GET)
public ResponseEntity<HalResource> getLicenseObligations(Pageable pageable,
@Parameter(description = "Project ID.") @PathVariable("id") String id, HttpServletRequest request)
throws TException, URISyntaxException, PaginationParameterException, ResourceClassNotFoundException {
Copy link
Contributor

Choose a reason for hiding this comment

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

URISyntaxException, PaginationParameterException, ResourceClassNotFoundException are never thrown

)
@RequestMapping(value = PROJECTS_URL + "/{id}/licenseObligations", method = RequestMethod.GET)
public ResponseEntity<HalResource> getLicenseObligations(Pageable pageable,
@Parameter(description = "Project ID.") @PathVariable("id") String id, HttpServletRequest request)
Copy link
Contributor

Choose a reason for hiding this comment

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

unused param HttpServletRequest request

licenseInfoWithObligations, releaseIdToAcceptedCLI);
Map<String, String> releaseIdToAcceptedCli = new HashMap<String, String>();
obligationStatusMap = licenseObligation.getObligationStatusMap();
Map<String, ObligationStatusInfo> newObligationMap = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused variable

public Map<String, ObligationStatusInfo> setLicenseInfoWithObligations(Map<String, ObligationStatusInfo> obligationStatusMap, Map<String, String> releaseIdToAcceptedCLI,
List<Release> releases, User user) {

final Set<Release> excludedReleases = Sets.newHashSet();
Copy link
Contributor

Choose a reason for hiding this comment

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

Contents of collection excludedReleases are updated at lines 186 and 195, but never queried. Can we remove it ?

@Test
public void should_document_get_license_obligations() throws Exception {
String accessToken = TestHelper.getAccessToken(mockMvc, testUserId, testUserPassword);
mockMvc.perform(get("/api/projects/" + "123456733" + "/licenseObligations")
Copy link
Contributor

Choose a reason for hiding this comment

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

Id 123456733 should be replaced by project8.getId()

Suggested change
mockMvc.perform(get("/api/projects/" + "123456733" + "/licenseObligations")
mockMvc.perform(get("/api/projects/" + project8.getId() + "/licenseObligations")

@rudra-superrr rudra-superrr force-pushed the feat/licenseObligationTable branch 2 times, most recently from 7cd9cd1 to 8811f76 Compare February 29, 2024 09:55
@rudra-superrr
Copy link
Contributor Author

Review comments addressed.

@hoangnt2
Copy link
Contributor

Code look good to me

@tienlee tienlee 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 Mar 1, 2024
@ag4ums
Copy link
Contributor

ag4ums commented Mar 11, 2024

This PR is dependent on #2276, merge this after merging #2276

@heliocastro
Copy link
Contributor

Just a tip, you can add Depends-On in github pull request header:
Depends-On: #<number_of_pr>

Signed-off-by: Rudra Chopra <prabhuchopra@gmail.com>
@rudra-superrr rudra-superrr force-pushed the feat/licenseObligationTable branch from c8050fa to 4f65386 Compare March 18, 2024 14:00
@ag4ums ag4ums merged commit ab4c5f4 into eclipse-sw360:main Mar 19, 2024
2 checks passed
@GMishx GMishx deleted the feat/licenseObligationTable branch March 27, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ready to merge REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List license obligation table's data of a project
7 participants