-
Notifications
You must be signed in to change notification settings - Fork 161
feat(BA-1453): Add missing session status_history
API
#4543
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
feat(BA-1453): Add missing session status_history
API
#4543
Conversation
status_history
APIstatus_history
API
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.
Pull Request Overview
This PR introduces a new session API endpoint for retrieving a session’s status history.
- Implements
get_status_history
in the service layer. - Registers and wires up the corresponding processor.
- Exposes a
GET /{session_name}/status-history
endpoint in the HTTP API.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/ai/backend/manager/services/session/service.py | Add get_status_history method and imports |
src/ai/backend/manager/services/session/processors.py | Register get_status_history ActionProcessor |
src/ai/backend/manager/services/session/actions/get_status_history.py | Define action/result dataclasses for status history |
src/ai/backend/manager/api/session.py | Add HTTP handler and route for /status-history |
changes/4543.feature.md | Document the new status history endpoint |
Comments suppressed due to low confidence (1)
src/ai/backend/manager/api/session.py:1633
- There are no tests covering the new
GET /{session_name}/status-history
endpoint. Consider adding unit or integration tests to verify authorization, parameter parsing, and the returned payload format.
async def get_status_history(request: web.Request, params: Any) -> web.Response:
result = await root_ctx.processors.session.get_status_history.wait_for_complete( | ||
GetStatusHistoryAction( | ||
session_name=session_name, | ||
owner_access_key=request["keypair"]["access_key"], |
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.
The owner_access_key
passed to the action is hardcoded from request["keypair"]
instead of using the owner_access_key
variable returned by get_access_key_scopes
. Replace this with owner_access_key=owner_access_key
.
owner_access_key=request["keypair"]["access_key"], | |
owner_access_key=owner_access_key, |
Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@ | |||
Add missing `GET /status_history` endpoint to the session REST API |
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.
The feature doc uses /status_history
(underscore), but the code registers /status-history
(hyphen). Update the documentation to reflect the actual route.
Copilot uses AI. Check for mistakes.
src/ai/backend/manager/services/session/actions/get_status_history.py
Outdated
Show resolved
Hide resolved
8dcd99f
to
42840bb
Compare
Co-authored-by: octodog <mu001@lablup.com>
This PR is primarily for adding a new feature, so it seems appropriate not to backport it for now, even if there is a dangling SDK method. |
resolves #4518 (BA-1453)
Tested manually.
Example test code
Result
Checklist: (if applicable)
📚 Documentation preview 📚: https://sorna--4543.org.readthedocs.build/en/4543/
📚 Documentation preview 📚: https://sorna-ko--4543.org.readthedocs.build/ko/4543/