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(rest): Update API create Release with Moderator, Contributor, CpeId #2091

Conversation

tuannn2
Copy link
Contributor

@tuannn2 tuannn2 commented Aug 16, 2023

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?

How To Test?

  • Run command line:
curl 'https://sw360.org/api/releases' -i -X POST \
    -H 'Content-Type: application/hal+json' \
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsic3czNjAtUkVTVC1BUEkiXSwidXNlcl9uYW1lIjoiYWRtaW5Ac3czNjAub3JnIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTY5MjAwNDYyOSwiYXV0aG9yaXRpZXMiOlsiUkVBRCIsIldSSVRFIl0sImp0aSI6IkxoS1l1aEItbUJSeVV1QWNLT2FseXRSWW1yYyIsImNsaWVudF9pZCI6InRydXN0ZWQtc3czNjAtY2xpZW50In0.pObj6HM4dKGeEK0weAX8TLGt3Da9nrkXxFwbjdLsEylnRID1gDax_NonMYvHAI8gEqRzZtE7FJ2CAhveJiSIH8rwzDh8jzbJL-o0G3NRZylmYBtv4uAe8rbSkNrLuzRrjgtorQyl7AlUdwlAd4VoCVAeJ5iB1-kIgrrMrsFk-6K3yOtxSCF3IlMIbq8NuR-UthkiwM1DuQaBIF-Zcf5Dv8rJU-MQkAuKeqrrXxpo_SHsJqdBa4t59oTH5g_GtFEvKJw2Ww3dTzbmBf844JSmVcNx6eH7CV1DdhL6DcGXcMk_d4Bfz0vPKaHHunoIUvBgZ76RZM7SCYyP5q5PS2hrYw' \
    -d '{
  "componentId": "17653524",
  "version": "1.0",
  "contributors": [
      "[email protected]",
      "[email protected]"
  ],
  "moderators": [
      "[email protected]",
      "[email protected]"
  ],
  "cpeid": "cpe:2.3:a:s:glibc:1.0.0"
}'

  • Expected Output
{
    "name": "Test Release",
    "version": "1.0",
    "cpeid": "cpe:2.3:a:s:glibc:1.0.0",
    "contributors": [
        "[email protected]",
        "[email protected]"
    ],
    "_links": {
        "sw360:component": {
            "href": "https://sw360.org/api/components/17653524"
        },
        "self": {
            "href": "https://sw360.org/api/releases/1234567890"
        },
        "curies": [
            {
                "href": "https://sw360.org/docs/{rel}.html",
                "name": "sw360",
                "templated": true
            }
        ]
    }
	"_embedded": {
        "sw360:moderators": [
            {
                "email": "[email protected]",
                "deactivated": false,
                "fullName": "Test Clearing1",
                "_links": {
                    "self": {
                        "href": "http://localhost:8080/resource/api/users/byid/cecb575b594a495e8df56067368f70e7"
                    }
                }
            },
            {
                "email": "[email protected]",
                "deactivated": false,
                "fullName": "Test Admin",
                "_links": {
                    "self": {
                        "href": "http://localhost:8080/resource/api/users/byid/3309473e580848e8b32dc2bdd2ddf1ba"
                    }
                }
            }
        ]
    }
}

@tienlee tienlee added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for REST New-UI Level for the API and UI level changes for the new-ui labels Aug 16, 2023
@nikkuma7
Copy link
Contributor

Test successful.
image
image

@KoukiHama KoukiHama removed the needs general test This is general testing, meaning that there is no org specific issue to check for label Aug 18, 2023
Copy link
Contributor

@ag4ums ag4ums left a comment

Choose a reason for hiding this comment

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

Changes looks good

@ag4ums ag4ums added ready ready to merge and removed needs code review labels Aug 23, 2023
@ag4ums ag4ums merged commit ec2c177 into eclipse-sw360:main Aug 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New-UI Level for the API and UI level changes for the new-ui ready ready to merge REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants