feat(poc): GSoC 2026 - Thrift to Spring direct injection migration PoC (Users module)#3984
Draft
Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Draft
feat(poc): GSoC 2026 - Thrift to Spring direct injection migration PoC (Users module)#3984Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Conversation
23ed492 to
4ecd0bf
Compare
4ecd0bf to
c80f6ea
Compare
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.
GSoC 2026 PoC: Remove Apache Thrift - Direct Spring Service Injection (Users Module)
What this does and why
Every call between SW360's REST server and a backend service currently goes through Apache Thrift over HTTP. For something as simple as
getAllUsers(), the flow is:The REST server and backend run on the same host in every deployment. None of that protocol machinery is earning its complexity. This project replaces it with direct Spring bean injection:
The external REST API is completely unchanged. This is an internal restructuring only.
What's in this PoC
I used the Users module to validate the pattern before proposing it for all 23 modules.
Sw360UserHandler- new plain Java interfaceReplaces the Thrift-generated
UserService.Iface. Method signatures are kept identical soUserHandler.javacan adopt it with a one-word change,implements UserService.Ifacebecomesimplements Sw360UserHandler. No business logic changes anywhere in the handler.UserHandlerBean- the migrated handlerThis is what
backend/users/UserHandler.javalooks like after migration. The entire diff is:Every method body is untouched.
UserServlet.javagets deleted, it only existed to wrap this handler in aTServlet.DirectInjectionUserService- REST service layer after migrationBefore:
After:
REST controllers are not touched at all.
Data model (
User,RequestStatus,UserGroup)Thrift-generated structs extend
TBaseand carryread(TProtocol)/write(TProtocol)/_Fieldsenum. After migration they become plain POJOs with Jackson annotations. All getter/setter names are preserved so the hundreds of existing call sites compile without changes. Enum ordinal values match the Thrift definition exactly so existing CouchDB data deserializes without a migration.DirectInjectionTest- 7 passing@SpringBootTesttestsFull CRUD coverage through the injection chain. Runs in under 250ms; no network, no serialization, no Thrift binary on the classpath. Current tests mock
ThriftClientsvia@MockBean; after migration they mockSw360UserHandlerdirectly, which is simpler and removes the Thrift dependency from the test classpath entirely.How to run
No CouchDB, Docker, or Thrift binary required.
Open questions for mentors
Module merge strategy - should the 23 backend WAR modules be restructured as library JARs imported by
rest/resource-server, or should their source be physically moved intorest/resource-server/src/main/java/? Option A keeps each module's history clean and PRs reviewable in isolation. Option B reduces Maven module count significantly. This decision affects everypom.xmlchange in the migration so I'd like to confirm the preferred approach before starting.Data model package naming - the generated structs currently live in
org.eclipse.sw360.datahandler.thrift.*. After migration they're plain POJOs. Should they stay in thethriftpackage to avoid touching ~500 import statements, or move to something likedatahandler.model.*for clarity? Whichever direction is preferred, I want to set it in the first module PR so it's consistent throughout.SW360Exception- checked or unchecked? - currently it extendsTException(checked). After migration it becomes a plain Java exception. Making it unchecked removes significant try-catch boilerplate from callers but requires touching method signatures across all 23 modules. The preference here shapes how the REST service layer handles errors throughout the entire migration.Long-running operations - the current Thrift read timeout is 10 minutes, presumably for things like FOSSology scan triggers and clearing report generation. After migration that timeout no longer exists at the protocol level. Are there SLAs or timeout requirements for those operations that need to be preserved via
@Asyncwith explicit task tracking, or is removing the timeout acceptable?