-
Notifications
You must be signed in to change notification settings - Fork 54
[RHDHPAI-1027] Add dynamic feedback status update endpoint #458
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
Merged
tisnik
merged 5 commits into
lightspeed-core:main
from
Jdubrick:add-dynamic-feedback-toggle
Aug 29, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6a48436
add endpoint for toggling feedback enablement for life of service
Jdubrick 25c4203
update format and apply linter to feedback toggle
Jdubrick 8ecd41f
add new endpoint to openapi json
Jdubrick ec5e7a7
move to PUT endpoint to set feedback status
Jdubrick d683993
update description to denote per-worker changes
Jdubrick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -570,3 +570,40 @@ class ErrorResponse(BaseModel): | |
| ] | ||
| } | ||
| } | ||
|
|
||
|
|
||
| class FeedbackStatusUpdateResponse(BaseModel): | ||
| """ | ||
| Model representing a response to a feedback status update request. | ||
|
|
||
| Attributes: | ||
| status: The previous and current status of the service and who updated it. | ||
|
|
||
| Example: | ||
| ```python | ||
| status_response = StatusResponse( | ||
| status={ | ||
| "previous_status": true, | ||
| "updated_status": false, | ||
| "updated_by": "user/test" | ||
| }, | ||
| ) | ||
| ``` | ||
| """ | ||
|
|
||
| status: dict | ||
|
|
||
| # provides examples for /docs endpoint | ||
| model_config = { | ||
| "json_schema_extra": { | ||
| "examples": [ | ||
| { | ||
| "status": { | ||
| "previous_status": True, | ||
| "updated_status": False, | ||
| "updated_by": "user/test", | ||
| }, | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
Comment on lines
+575
to
+609
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Make response shape explicit; fix example class name and booleans.
Apply: -class FeedbackStatusUpdateResponse(BaseModel):
+class FeedbackStatusUpdateResponse(BaseModel):
@@
- Example:
- ```python
- status_response = StatusResponse(
- status={
- "previous_status": true,
- "updated_status": false,
- "updated_by": "user/test"
- },
- )
- ```
+ Example:
+ ```python
+ status_response = FeedbackStatusUpdateResponse(
+ status={
+ "previous_status": True,
+ "updated_status": False,
+ "updated_by": "user/test",
+ }
+ )
+ ```
@@
- status: dict
+ status: "FeedbackStatusDelta"Add this model (top-level in this file): class FeedbackStatusDelta(BaseModel):
previous_status: bool = Field(..., description="State before the update")
updated_status: bool = Field(..., description="State after the update")
updated_by: str = Field(..., description="User ID of the updater")🤖 Prompt for AI Agents |
||
Oops, something went wrong.
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.
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.
🛠️ Refactor suggestion
Constrain response schema to explicit fields.
Publish stable keys for clients.
"FeedbackStatusUpdateResponse": { "properties": { "status": { - "additionalProperties": true, - "type": "object", - "title": "Status" + "type": "object", + "title": "Status", + "additionalProperties": false, + "properties": { + "previous_status": { "type": "boolean" }, + "updated_status": { "type": "boolean" }, + "updated_by": { "type": "string" } + }, + "required": ["previous_status", "updated_status", "updated_by"] } }, "type": "object", "required": [ "status" ], "title": "FeedbackStatusUpdateResponse", - "description": "Model representing a response to a feedback status update request.\n\nAttributes:\n status: The previous and current status of the service and who updated it.\n\nExample:\n ```python\n status_response = StatusResponse(\n status={\n \"previous_status\": true,\n \"updated_status\": false,\n \"updated_by\": \"user/test\"\n },\n )\n ```", + "description": "Model representing a response to a feedback status update request.\n\nAttributes:\n status: The previous and current status of the service and who updated it.\n\nExample:\n ```python\n status_response = FeedbackStatusUpdateResponse(\n status={\n \"previous_status\": true,\n \"updated_status\": false,\n \"updated_by\": \"user/test\"\n }\n )\n ```", "examples": [ { "status": { "previous_status": true, "updated_by": "user/test", "updated_status": false } } ] },🤖 Prompt for AI Agents