Move API services to their own package #12548
Merged
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.
This should tidy up a bit the manager modules and the codebase around the API.
In order to share the controller logic between the legacy UWSGI controllers and the FastAPI controllers during the migration, I started creating these Service classes that wrapped the actual logic for every endpoint operation. These classes were usually living in the same module as the corresponding manager, but they clearly were more API-oriented so now they live in their own package under
lib/galaxy/webapps/galaxy/services/
.The idea of wrapping the route operation logic in these classes is to keep the actual API route operation as thin as possible and concentrate on adding the FastAPI stuff (like OpenAPI route documentation) in the
lib/galaxy/webapps/galaxy/api/
package. Hopefully, this will mean that if there is a new fancy API framework in the future we can directly reuse those services (actual galaxy logic) and just focus on how to provide the inputs and outputs as the framework likes it.Apart from just moving around some code, the older
Services
have been unified a bit to follow the newest approach like avoiding dependencies onapp
and some general cleanup.How to test the changes?
License