fix: add responding error information when obtain pipeline template detail failed#33628
fix: add responding error information when obtain pipeline template detail failed#33628
Conversation
…m service including remote template service and database, return responding error message.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refines the error handling mechanisms for retrieving RAG pipeline templates within the application. It ensures that when a template cannot be found, either from remote services or internally, a clear and informative error message is returned to the user or logged for debugging. This change prevents silent failures, provides better feedback to API consumers, and improves the overall robustness and diagnosability of the pipeline template retrieval process. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Pyrefly DiffNo changes detected. |
1 similar comment
Pyrefly DiffNo changes detected. |
There was a problem hiding this comment.
Code Review
This pull request effectively improves error handling when fetching pipeline template details. The changes ensure that when a template isn't found, a proper 404 error is returned to the client, and exceptions are raised internally for better error propagation instead of silently returning None. Additionally, a new warning log has been added to improve observability when a template cannot be located after all retrieval attempts.
The implementation is solid. I've added one suggestion to truncate the response body in an exception message to prevent log spamming.
For future consideration, I noticed that in api/services/rag_pipeline/pipeline_template/remote/remote_retrieval.py, the class docstring and a log message seem to be copy-pasted from a 'recommended app' feature and could be updated to refer to 'pipeline templates' for better clarity. Since these are outside the changed lines of this PR, I couldn't add specific comments.
api/services/rag_pipeline/pipeline_template/remote/remote_retrieval.py
Outdated
Show resolved
Hide resolved
Pyrefly DiffNo changes detected. |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the RAG pipeline template detail retrieval flow to avoid returning 200 with a null body when a template can’t be obtained from upstream sources (remote service and/or database), instead returning an error response.
Changes:
- Add a 404 error response from the console API when a pipeline template detail lookup returns no result.
- Improve service-side logging when built-in template detail retrieval yields no result.
- Change remote template-detail fetching to raise an exception on non-200 responses (enabling fallback behavior and better diagnostics).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
api/services/rag_pipeline/rag_pipeline.py |
Adds warning logging when built-in template detail retrieval returns no result. |
api/services/rag_pipeline/pipeline_template/remote/remote_retrieval.py |
Raises on non-200 upstream responses for template detail fetches (instead of returning None). |
api/controllers/console/datasets/rag_pipeline/rag_pipeline.py |
Returns a 404 error payload when template detail retrieval returns no template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pyrefly DiffNo changes detected. |
Pyrefly DiffNo changes detected. |
1 similar comment
Pyrefly DiffNo changes detected. |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #33624 by ensuring the pipeline template detail endpoint does not return 200 with a null/empty body when retrieval fails, and adds additional logging/error signaling around upstream template retrieval.
Changes:
- Return
404from the console API when a pipeline template detail cannot be retrieved. - Update remote retrieval to raise on non-200 upstream responses (enabling fallback behavior) and enrich docstrings.
- Add warning logging when built-in template detail is not found after retrieval attempts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
api/services/rag_pipeline/rag_pipeline.py |
Adds docstring clarity and a warning when built-in template detail retrieval returns no result. |
api/services/rag_pipeline/pipeline_template/remote/remote_retrieval.py |
Raises an error on non-200 upstream responses (instead of returning None), affecting fallback/logging behavior. |
api/controllers/console/datasets/rag_pipeline/rag_pipeline.py |
Returns a 404 error payload when get_pipeline_template_detail returns no template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
api/services/rag_pipeline/pipeline_template/remote/remote_retrieval.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Pyrefly DiffNo changes detected. |
1 similar comment
Pyrefly DiffNo changes detected. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Pyrefly DiffNo changes detected. |
1 similar comment
Pyrefly DiffNo changes detected. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to address issue #33624 by ensuring the pipeline template detail endpoint no longer returns 200 with a null body when retrieval fails, and by improving error visibility when upstream template retrieval fails.
Changes:
- Add a 404 response when a pipeline template detail lookup returns no result.
- Log a warning when built-in template detail retrieval returns an empty result.
- Treat non-200 responses from the remote template service as errors (raise) so the DB fallback path is exercised.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
api/services/rag_pipeline/rag_pipeline.py |
Adds warning logging when template detail retrieval returns empty for built-in mode. |
api/services/rag_pipeline/pipeline_template/remote/remote_retrieval.py |
Raises on non-200 remote responses to enable fallback logic and preserve upstream error details in exceptions/logs. |
api/controllers/console/datasets/rag_pipeline/rag_pipeline.py |
Returns a 404 + error payload when template detail is missing instead of 200, null. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pyrefly DiffNo changes detected. |
1 similar comment
Pyrefly DiffNo changes detected. |
…m service including remote template service and database, return responding error message.
Pyrefly DiffNo changes detected. |
1 similar comment
Pyrefly DiffNo changes detected. |
Pyrefly DiffNo changes detected. |
1 similar comment
Pyrefly DiffNo changes detected. |
fixex #33624
Important
Fixes #<issue number>.Summary
When obtain pipeline template detail failed from upstream service including remote template service and database, return responding error message.
Screenshots
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods