Separate server endpoints into different routers#595
Merged
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
tieneupin
approved these changes
May 28, 2025
Contributor
tieneupin
left a comment
There was a problem hiding this comment.
SPA, Tomo, and CLEM workflows run and trigger processing correctly to the extent that they can be tested on the test setup.
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.
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_formethod of thefastapi.APIRouterto 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_formethod for communication between the client and the backend, as that would require importing the instantiatedAPIRouterobjects, 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.yamlfile 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_objecthas to be called directly for use inmurfey.server.feedbackso that the_transport_objectused 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.