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): Added packageIds in project create and update APIs. #2885

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ static abstract class MultiStatusMixin extends MultiStatus {
"packageIdsSize",
"setPackageIds",
"packageIdsIterator",
"packageIds",
"setReleaseRelationNetwork",
"releaseRelationNetwork",
"projectTypeIsSet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public void before() throws TException, IOException {
project.setCreatedOn("2016-12-15");
project.setCreatedBy("[email protected]");
project.setModerators(new HashSet<>(Arrays.asList("[email protected]", "[email protected]")));
project.setPackageIds(new HashSet<>(Arrays.asList("123456", "54844")));
project.setBusinessUnit("sw360 AR");
project.setExternalIds(Collections.singletonMap("mainline-id-project", "515432"));
project.setOwnerAccountingUnit("4822");
Expand Down Expand Up @@ -319,6 +320,7 @@ public void before() throws TException, IOException {
project2.setProjectType(ProjectType.PRODUCT);
project2.setDescription("Orange Web provides a suite of components for documentation.");
project.setDomain("Hardware");
project2.setPackageIds(new HashSet<>(Arrays.asList("123456", "54844")));
project2.setCreatedOn("2016-12-17");
project2.setCreatedBy("[email protected]");
project2.setBusinessUnit("sw360 EX DF");
Expand Down Expand Up @@ -376,6 +378,7 @@ public void before() throws TException, IOException {
linkedProjects2.put("123456", new ProjectProjectRelationship(ProjectRelationship.CONTAINED).setEnableSvm(true));
project4.setLinkedProjects(linkedProjects2);
project4.setSecurityResponsibles(new HashSet<>(Arrays.asList("[email protected]", "[email protected]")));
project4.setPackageIds(new HashSet<>(Arrays.asList("123456", "54844")));

Project project5 = new Project();
project5.setId("123456");
Expand Down Expand Up @@ -876,6 +879,7 @@ public void should_document_get_projects() throws Exception {
responseFields(
subsectionWithPath("_embedded.sw360:projects.[]name").description("The name of the project"),
subsectionWithPath("_embedded.sw360:projects.[]version").description("The project version"),
//subsectionWithPath("_embedded.sw360:projects.[]packageIds").description("List of package IDs associated with the project"),
subsectionWithPath("_embedded.sw360:projects.[]projectType").description("The project type, possible values are: " + Arrays.asList(ProjectType.values())),
subsectionWithPath("_embedded.sw360:projects").description("An array of <<resources-projects, Projects resources>>"),
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources"),
Expand Down Expand Up @@ -1045,6 +1049,7 @@ public void should_document_get_projects_with_all_details() throws Exception {
subsectionWithPath("_embedded.sw360:projects.[]_embedded.sw360:attachments").description("An array of all project attachments").optional(),
subsectionWithPath("_embedded.sw360:projects.[]vendor").description("An array of all component vendors with full name and link to their <<resources-vendor-get,Vendor resource>>"),
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources"),
subsectionWithPath("_embedded.sw360:projects[].packageIds").description("List of package IDs associated with each project."),
fieldWithPath("page").description("Additional paging information"),
fieldWithPath("page.size").description("Number of projects per page"),
fieldWithPath("page.totalElements").description("Total number of all existing projects"),
Expand All @@ -1067,6 +1072,7 @@ public void should_document_get_project() throws Exception {
fieldWithPath("id").description("The id of the project"),
fieldWithPath("name").description("The name of the project"),
fieldWithPath("version").description("The project version"),
fieldWithPath("packageIds").description("List of package IDs associated with the project."),
fieldWithPath("createdOn").description("The date the project was created"),
fieldWithPath("description").description("The project description"),
fieldWithPath("projectType").description("The project type, possible values are: " + Arrays.asList(ProjectType.values())),
Expand Down Expand Up @@ -1651,6 +1657,7 @@ public void should_document_update_project_vulnerabilities() throws Exception {
responseFields(
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]projectRelevance").description("The relevance of project of the vulnerability, possible values are: " + Arrays.asList(VulnerabilityRatingForProject.values())),
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]intReleaseId").description("The release id"),
// subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]packageIds").description("The list of package IDs linked to the vulnerability."),
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]comment").description("Any message to add while updating project vulnerabilities"),
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]projectAction").description("The action of vulnerability"),
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes").description("An array of <<resources-vulnerabilities, Vulnerability resources>>"),
Expand Down Expand Up @@ -2044,6 +2051,7 @@ public void should_document_update_project() throws Exception {
fieldWithPath("considerReleasesFromExternalList").description("Consider list of releases from existing external list"),
fieldWithPath("enableVulnerabilitiesDisplay").description("Displaying vulnerabilities flag."),
fieldWithPath("clearingState").description("The clearingState of the project"),
subsectionWithPath("packageIds").description("List of package IDs associated with the project"),
subsectionWithPath("_embedded.sw360:moderators").description("An array of moderators"),
subsectionWithPath("_embedded.sw360:projects").description("An array of <<resources-projects, Projects resources>>"),
subsectionWithPath("_embedded.sw360:releases").description("An array of <<resources-releases, Releases resources>>"),
Expand Down