refactor(robot-server): start pulling routers to top-level modules #7632
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.
Overview
This PR starts to re-organize the
robot-server
module a little bit to make various important imports less deep and to reduce time and cognitive load to go from "I need to change out /xyz endpoint works" to actually writing code.Overall principles:
/heath
goes inrobot_server/health
health/router.py
+health/models.py
is easier thanrouters/health.py
+models/health.py
__all__
Changelog
robot_server/service/app.py
torobot_server/app.py
robot_server/main.py
app.py
torobot_server/router.py
/health
logic torobot_server/health/
robot_server/service/legacy/models/health.py
robot_server/service/legacy/routers/health.py
/system
logic torobot_server/system/
robot_server/system/time.py
(Time utilities)robot_server/service/system/models.py
robot_server/service/system/router.py
verify_hardware
andget_hardware
Review requests
The riskiest changes here are:
app
exportI'd say we'd want to smoke test:
Risk assessment
Pretty low, provided we run the smoke tests above. Integration / unit test coverage is good for the endpoints that were moved