fix(licensedb): add persistence for license and obligation sync#3851
Open
ADITYA-CODE-SOURCE wants to merge 6 commits intoeclipse-sw360:mainfrom
Open
fix(licensedb): add persistence for license and obligation sync#3851ADITYA-CODE-SOURCE wants to merge 6 commits intoeclipse-sw360:mainfrom
ADITYA-CODE-SOURCE wants to merge 6 commits intoeclipse-sw360:mainfrom
Conversation
…d service - Add LicenseDBProperties.java with OAuth and connection config - Add LicenseDbClient.java for LicenseDB REST API - Add LicenseDbService.java for license/obligation sync - Add LicenseDBConfig, LicenseDBController, LicenseDBRestClient, LicenseDBService - Update SW360Constants and sw360.thrift with LICENSEDB enum - Update sw360.properties in 3 locations - Add LicenseDBConstantsTest.java unit tests - Fix conflict in Sw360LicenseService.java This is a clean implementation of LicenseDB integration for GSoC 2026. No CI workflow changes or unrelated files included.
- Fix Sw360LicenseService.java syntax errors from conflict resolution - Fix LicenseDBProperties.java to use correct constant name - Remove non-existent setter calls from LicenseDbService.java - Constants already exist in SW360Constants.java
- Restore uploadLicense method in Sw360LicenseService.java - Add ObligationType and ObligationLevel imports to LicenseDBService.java - Fix enum references to use correct class names instead of nested types
- Add import for times() - Add import for verify() - These were missing causing test compilation failure
- Add @ConditionalOnProperty to LicenseDBConfig, LicenseDBRestClient, LicenseDBService, and LicenseDBController - This prevents Spring from trying to create LicenseDB beans when licensedb.enabled=false (default), fixing test context failures - The RestTemplate bean is no longer required when LicenseDB is disabled
- Inject Sw360LicenseService and Sw360ObligationService - Call createLicense() in syncLicenses() to persist licenses - Call createObligation() in syncObligations() to persist obligations - Handle duplicate/existing entries gracefully Fixes eclipse-sw360#3766
c67c140 to
57e7c74
Compare
Contributor
Author
|
@GMishx @KoukiHama @arunazhakesan @ag4ums |
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
syncLicenses()andsyncObligations()now persist data to databaseSw360LicenseServiceandSw360ObligationServicefor persistenceChanges
Sw360LicenseServiceandSw360ObligationServiceas dependencies inLicenseDBServicesyncLicenses()to callsw360LicenseService.createLicense()for each licensesyncObligations()to callsw360ObligationService.createObligation()for each obligationTesting
/api/license-db/syncendpoint and verify data is persisted in databaseFixes #3766