-
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
Open
d-j-hatton
wants to merge
70
commits into
main
Choose a base branch
from
auth-split
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,262
−6,055
Conversation
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
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:
|
…'url_path_for()' function instead; this will keep server and client-side dependencies separate
…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
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_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 to
murfey-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.