-
Notifications
You must be signed in to change notification settings - Fork 18.5k
api -> console_ns #28246
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
base: main
Are you sure you want to change the base?
api -> console_ns #28246
Conversation
|
/gemini review |
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.
Code Review
This pull request is a large-scale refactoring that replaces the use of api with console_ns across numerous controller files. The goal is to improve typing support, which is a valuable enhancement for the codebase's maintainability. The changes are consistent and have been applied correctly throughout all the modified files. Additionally, some minor style improvements and type-hinting fixes have been included, which further polish the code. Overall, this is a solid refactoring effort.
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 refactors the console API controllers to use console_ns instead of api for better typing support, as part of issue #24421. The change is purely a namespace/identifier replacement to improve type checking capabilities.
- Removes the unused
apiimport from all console controller files - Replaces all
api.*decorator and method calls withconsole_ns.*equivalents - Includes minor refactoring of some
RequestParserdeclarations to use method chaining
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| workspace/workspace.py | Updated decorator usage from api to console_ns |
| workspace/trigger_providers.py | Replaced api with console_ns, refactored parser declarations |
| workspace/tool_providers.py | Updated all api references to console_ns |
| workspace/plugin.py | Replaced decorators and refactored parser |
| workspace/models.py | Updated namespace references |
| workspace/model_providers.py | Replaced api with console_ns |
| workspace/members.py | Updated decorator namespace |
| workspace/endpoint.py | Replaced all API documentation decorators |
| workspace/agent_providers.py | Updated namespace usage |
| workspace/account.py | Replaced api with console_ns |
| version.py | Updated namespace and model references |
| tag/tags.py | Replaced decorator namespace |
| setup.py | Updated API documentation decorators |
| remote_files.py | Replaced api usage |
| ping.py | Updated namespace references |
| init_validate.py | Replaced model and response decorators |
| feature.py | Updated namespace usage |
| extension.py | Replaced api with console_ns, updated payload reference |
| explore/recommended_app.py | Updated decorator namespace |
| datasets/* | Multiple dataset-related files updated to use console_ns |
| auth/* | Authentication-related files updated |
| app/* | All app controller files refactored to use console_ns |
| apikey.py | Updated decorators and added type ignore comments |
| admin.py | Replaced api with console_ns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/gemini review |
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.
Code Review
This pull request is a large-scale refactoring that replaces the usage of api with console_ns across numerous controller files. This change improves code consistency and leverages the better typing support offered by console_ns. The refactoring is well-executed, with consistent search-and-replace changes, along with some minor style improvements like chained reqparse calls. I have reviewed the changes and found no issues. The codebase is now more consistent in its use of flask-restx namespaces.
|
/gemini review |
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.
Code Review
This pull request is a large-scale refactoring to replace the api object with console_ns for better typing support. The changes are mostly mechanical and look correct. I've found a few places where type: ignore was used to suppress type errors. I've suggested adding proper type hints instead, which aligns with the goal of this PR. Overall, this is a great improvement.
|
cc @crazywoola |
|
/gemini review |
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.
Code Review
This pull request is a large-scale refactoring to consistently use console_ns instead of api for flask-restx decorators and helpers across the console controllers. This is a great improvement for code consistency and also enables better typing support, as stated in the PR description.
The changes have been applied correctly and consistently across all modified files. I've reviewed the replacements of @api.doc, @api.expect, @api.response, api.payload, api.add_resource, and api.abort with their console_ns equivalents, and they are all correct.
I particularly appreciate the refactoring of the get_rag_pipeline decorator in api/controllers/console/datasets/wraps.py to use ParamSpec and TypeVar, which is a modern and clean way to type decorators in Python.
Overall, this is a solid refactoring that improves the codebase's quality and maintainability. I don't see any issues with the changes.
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
Copilot reviewed 57 out of 57 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Important
Fixes #<issue number>.Summary
part of #24421 , _ns has better typing support
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods