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(Project): Add new endpoint for project's license clearing tree view #2614

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

Conversation

hoangnt2
Copy link
Contributor

Create new endpoints to serve tree view of dependency network (New GUI)

Pre-condition:

Turn on feature by adding this property into /etc/sw360/sw360.properties: enable.flexible.project.release.relationship=true

Create a new project with dependency network:

{
    "name": "Test_PR",
    "dependencyNetwork": [
        {
            "releaseId": "${release_id_1_in_sw360}", // Replace this by an existing release id in sw360
            "releaseRelationship": "CONTAINED",
            "mainlineState": "OPEN",
            "comment": "",
            "createOn": "2024-07-05",
            "createBy": "admin@sw360.org",
            "releaseLink": [
                {
                    "releaseId": "${release_id_2_in_sw360}", // Replace this by an existing release id in sw360 (difference from above)
                    "releaseRelationship": "OPTIONAL",
                    "mainlineState": "MAINLINE",
                    "comment": "",
                    "createOn": "2024-07-05",
                    "createBy": "admin@sw360.org",
                    "releaseLink": []
                }
            ]
        }
    ]
}

How To Test?

Replace {project_id} with the id of the project created in the pre-condition

Endpoint 1: Get directly linked resources of project (listing all directly linked projects and releases of a project)

{
    "id": "{project_id}",
    "name": "Test_PR",
    "relation": "UNKNOWN",
    "projectType": "PRODUCT",
    "state": "ACTIVE",
    "clearingState": "OPEN",
    "linkedReleases": [
        {
            "id": "{release_id_1_in_sw360}",
            "vendor": "",
            "name": "{release_1_name}",
            "version": "{release_1_version}",
            "longName": "{release_1_long_name}",
            "releaseRelationship": "CONTAINED",
            "mainlineState": "OPEN",
            "hasSubreleases": true,
            "clearingState": "NEW_CLEARING",
            "attachments": [],
            "componentType": "SERVICE",
            "licenseIds": [],
            "comment": "",
            "otherLicenseIds": [],
            "accessible": true,
            "index": 0,
            "projectId": "{project_id}",
            "releaseMainLineState": "OPEN"
        }
    ],
    "enableSvm": true
}

Endpoint 2: Get get indirect linked releases of a project in dependency network by release's index path (support fetch data on expand node from GUI)

{
    "_embedded": {
        "sw360:releaseLinks": [
            {
                "id": "{release_id_2_in_sw360}",
                "vendor": "",
                "name": "{release_2_name}",
                "version": "{release_2_version}",
                "longName": "{release_2_long_name}",
                "releaseRelationship": "OPTIONAL",
                "mainlineState": "MAINLINE",
                "hasSubreleases": false,
                "clearingState": "NEW_CLEARING",
                "attachments": [],
                "componentType": "OSS",
                "licenseIds": [],
                "comment": "",
                "otherLicenseIds": [],
                "accessible": true,
                "index": 0,
                "projectId": "6d0c271a16ee457a8b608afc874e1dc9",
                "releaseMainLineState": "OPEN"
            }
        ]
    },
    "_links": {
        "curies": [
            {
                "href": "http://localhost:8080/resource/docs/{rel}.html",
                "name": "sw360",
                "templated": true
            }
        ]
    }
}

…iew (New GUI)

Signed-off-by: hoangnt2 <hoang2.nguyenthai@toshiba.co.jp>
@hoangnt2 hoangnt2 changed the title feat(Project): Add new endpoint for project's license clearing tree v… feat(Project): Add new endpoint for project's license clearing tree view Sep 16, 2024
@hoangnt2 hoangnt2 added REST New-UI Level for the API and UI level changes for the new-ui needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Sep 16, 2024
@hoangnt2
Copy link
Contributor Author

This is the backend of this PR eclipse-sw360/sw360-frontend#289

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 New-UI Level for the API and UI level changes for the new-ui REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant