-
Notifications
You must be signed in to change notification settings - Fork 233
feat(attachmentUsage): Store Ignore Licenses in Attachment usage #3495
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(attachmentUsage): Store Ignore Licenses in Attachment usage #3495
Conversation
GMishx
left a 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.
Some suggestions to use stronger typing and simpler data structure.
...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
...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
e0d41a9 to
68983ec
Compare
GMishx
left a 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.
Changes looks good.
…nfo in Attachment Usage
…nfo in Attachment Usage
68983ec to
628a16e
Compare
GMishx
left a 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.
Minor refactor required.
...ce-server/src/main/java/org/eclipse/sw360/rest/resourceserver/project/ProjectController.java
Outdated
Show resolved
Hide resolved
|
Tested, working as expected Request:Result:201, "AttachmentUsages Saved Successfully" |
…nfo in Attachment Usage
GMishx
left a 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.
Changes looks good.
Closes: #3471
Suggest Reviewer
How To Test?
Test Data (Sample only for reference)
9ebb01de944badd68a3f8fe916000a01f2aace18f866d01b85ec4c52880033b75c878b4ee80e1e73c9c60e1c7000bbc8f2aace18f866d01b85ec4c52880055ea5c878b4ee80e1e73c9c60e1c7000d494Endpoint
✅ Valid Test Cases
Test 1: Parent Project with Parent Release
Description: Validates release belonging to parent project with explicit project path
Expected Result: ✅ SUCCESS
9ebb01de...matches path parameter5c878b4e...bbc8belongs to parent project9ebb01de...5c878b4e...d494is associated with the releaseSuccess Response:
{ "message": "AttachmentUsages Saved Successfully" }Test 2: Parent:Sub Project Hierarchy with Sub-Project Release
Description: Validates release belonging to sub-project in a two-level hierarchy
Expected Result: ✅ SUCCESS
9ebb01de...matches path parameterf2aace18...33b7belongs to parent9ebb01de...f2aace18...55eabelongs to sub-project or its descendants5c878b4e...d494is associatedSuccess Response:
{ "message": "AttachmentUsages Saved Successfully" }Test 3: Mixed Formats - Multiple Releases
Description: Tests both parent and sub-project releases in a single request
Expected Result: ✅ SUCCESS
Success Response:
{ "message": "AttachmentUsages Saved Successfully" }Test 4: Complete Request with All Fields
Description: Full request including selected, deselected, and concluded usages
Expected Result: ✅ SUCCESS
❌ Error Test Cases
Test 5: Wrong Parent Project ID in Key
Description: Project ID in key doesn't match path parameter
Expected Result: ❌ 400 Bad Request
Error Response:
{ "message": "Project ID mismatch in ignoredLicenses key 'wrongProjectId123456789abcdef-5c878b4ee80e1e73c9c60e1c7000bbc8_5c878b4ee80e1e73c9c60e1c7000d494': Root project ID 'wrongProjectId123456789abcdef' does not match path parameter project ID '9ebb01de944badd68a3f8fe916000a01'" }Test 6: Invalid Sub-Project in Hierarchy
Description: Sub-project doesn't belong to parent project
Expected Result: ❌ 400 Bad Request
Error Response:
{ "message": "Invalid project hierarchy in ignoredLicenses key '9ebb01de944badd68a3f8fe916000a01:invalidSubProject123456789-f2aace18f866d01b85ec4c52880055ea_5c878b4ee80e1e73c9c60e1c7000d494': Sub-project 'invalidSubProject123456789' does not belong to parent project '9ebb01de944badd68a3f8fe916000a01'" }Test 7: Release Doesn't Belong to Specified Project
Description: Release ID is valid but doesn't belong to the specified project
Expected Result: ❌ 400 Bad Request
Error Response:
{ "message": "Invalid release ownership in ignoredLicenses key '9ebb01de944badd68a3f8fe916000a01-wrongReleaseId123456789abc_5c878b4ee80e1e73c9c60e1c7000d494': Release 'wrongReleaseId123456789abc' does not belong to project '9ebb01de944badd68a3f8fe916000a01' or any of its sub-projects" }Test 8: Parent Release in Sub-Project Context (Cross-Assignment)
Description: Trying to assign a parent project's release to a sub-project
Expected Result: Depends on project structure
5c878b4e...bbc8only belongs to parent, not sub-projectPossible Error Response:
{ "message": "Invalid release ownership in ignoredLicenses key '9ebb01de944badd68a3f8fe916000a01:f2aace18f866d01b85ec4c52880033b7-5c878b4ee80e1e73c9c60e1c7000bbc8_5c878b4ee80e1e73c9c60e1c7000d494': Release '5c878b4ee80e1e73c9c60e1c7000bbc8' does not belong to project 'f2aace18f866d01b85ec4c52880033b7' or any of its sub-projects" }Test 9: Invalid Key Format - Missing Underscore
Description: Key format validation - missing required underscore separator
Expected Result: ❌ 400 Bad Request
Error Response:
{ "message": "Invalid key format in ignoredLicenses. Expected format: 'projectPath-releaseId_attachmentContentId' or 'releaseId_attachmentContentId'" }