Improve SPDX license import error handling and add development configurations#3927
Closed
sharad-31 wants to merge 4 commits intoeclipse-sw360:mainfrom
Closed
Improve SPDX license import error handling and add development configurations#3927sharad-31 wants to merge 4 commits intoeclipse-sw360:mainfrom
sharad-31 wants to merge 4 commits intoeclipse-sw360:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request improves the robustness of the SPDX license import workflow and introduces several configuration updates to support local development and testing.
The main improvement enhances the reliability of the SPDX license import process by introducing explicit request status tracking and improved error handling in the license import logic.
Additionally, this PR includes configuration updates for local Docker setups, Keycloak test configuration, and Maven lifecycle mapping adjustments to improve the developer experience.
Changes
1. Improve SPDX License Import Error Handling
Updated the method
LicenseDatabaseHandler.importAllSpdxLicenses()to improve reliability and error reporting during SPDX license import.Key improvements:
RequestStatus requestStatusto track the success or failure of the import operation.null.This prevents situations where the system could incorrectly report a successful import when the import operation actually failed.
2. Docker Configuration for Local Development
Added a
docker-compose.override.ymlconfiguration to simplify local development by defining CouchDB credentials.This allows developers to run SW360 locally with Docker without additional manual configuration.
3. Keycloak Organization Mapping Test Configuration
Added
orgmapping.propertiesunder:This configuration file provides test mappings for organization mapping functionality, including:
This helps validate organization mapping behavior in tests.
4. Maven Lifecycle Mapping Fix for IDE Builds
Added lifecycle mapping configuration in
keycloak/pom.xmlto preventm2efrom executing thecopy-dependenciesgoal during incremental IDE builds.This resolves IDE warnings and improves developer workflow when building the Keycloak module in Eclipse-based environments.
5. Code Cleanup
Removed unused imports from:
This improves code cleanliness and removes unnecessary compiler warnings.
6. Development Environment Improvements
Added
.vscode/settings.jsonfor improved Java build configuration when using VSCode.Files Modified
licenses-core/src/main/java/org/eclipse/sw360/licenses/db/LicenseDatabaseHandler.javabackend/attachments/src/test/java/org/eclipse/sw360/attachments/TestAttachmentClient.javadocker-compose.override.ymlkeycloak/event-listeners/src/test/resources/orgmapping.propertieskeycloak/pom.xml.vscode/settings.jsonIssue
Related to: #3781
Issue: This pull request contributes improvements related to the ongoing work on integrating LicenseDB as the single source of truth for license and obligation data in SW360.
This PR improves robustness of the SPDX license import process and adds configuration improvements to support local development and testing.
Suggest Reviewer
Kindly requesting review from:
@GMishx
@deo002
How To Test
Start SW360 locally using Docker.
Verify CouchDB configuration works using:
Trigger the SPDX license import process.
Validate the following scenarios:
Successful Import
RequestSummaryreportsSUCCESS.Import Failure
addOrOverwriteLicenses()fails or returnsnull, the request status becomesFAILURE.Mismatch Handling
Keycloak Tests
orgmapping.properties.Checklist
Must: