-
Notifications
You must be signed in to change notification settings - Fork 1
Separate server endpoints into different routers #595
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
Conversation
Calls to all these endpoints still need to be addressed
Getting close to narrowing down to just the endpoints that require access from both the instrument server and frontend
…ther than hard-coding the URLs
…d between the instrument server and frontend
…n and cannot be empty
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #595 +/- ##
==========================================
+ Coverage 30.18% 31.77% +1.59%
==========================================
Files 80 90 +10
Lines 10576 10700 +124
Branches 1409 1422 +13
==========================================
+ Hits 3192 3400 +208
+ Misses 7278 7187 -91
- Partials 106 113 +7 🚀 New features to boost your workflow:
|
…ckend servers to 'url_path_for'
…d the candidate list
…eedback' so that changes made to 'murfey.server._transport_object' upon startup carry over to the feedback functions, which are also imported and loaded upon startup
…presented in logs
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.
SPA, Tomo, and CLEM workflows run and trigger processing correctly to the extent that they can be tested on the test setup.
This should allow a split between routers that the instrument server needs to access and those that the front end needs, allowing auth to be handled differently in the two cases.
Switched to using
url_path_for
method of thefastapi.APIRouter
to construct the URLs from function names to allow easier renaming of URLs and prefixes.UPDATE 2025/05/28:
It is not possible to use the
url_path_for
method for communication between the client and the backend, as that would require importing the instantiatedAPIRouter
objects, leading to unnecessary dependency chains on the client side. Instead, a utility function was created to mimic the behaviour ofurl_path_for
. This is facilitated by aroute_manifest.yaml
file that contains a dictionary of all currently defined endpoint functions, their corresponding URL paths, and the path parameters they expect. A CLI has also been added to generate up-to-date route manifests for use. Future work will involve including the route manifest generation as part of the pre-commit hooks, and to push the up-to-date manifest tomurfey-frontend
.The
murfey.server.__init__
module has also been refactored to further minimise import chains. The server startup components are now inmurfey.server.run
, and the feedback callback and listening functions are now inmurfey.server.feedback
.murfey.server._transport_object
has to be called directly for use inmurfey.server.feedback
so that the_transport_object
used in the feedback callback mechanisms is correctly initialised as server startup progresses.Fixes for the CLEM workflow from PR #594 have also been incorporated as part of this PR. Merging this resolves that PR.