Skip to content

Conversation

@stbenjam
Copy link
Member

@stbenjam stbenjam commented Nov 5, 2025

Rename 'query_params' parameter to 'url' in get_test_details_report tool and add explicit instruction to pass URLs verbatim without modification. This prevents the LLM from incorrectly reformatting query parameters like 'dbGroupBy=LayeredProduct'.

Summary by CodeRabbit

Release Notes

  • Refactor
    • The test details report tool now accepts full URLs as input instead of individual query parameters.
    • Improved error handling to provide clearer feedback when required URL information is missing.

Rename 'query_params' parameter to 'url' in get_test_details_report
tool and add explicit instruction to pass URLs verbatim without
modification. This prevents the LLM from incorrectly reformatting
query parameters like 'dbGroupBy=LayeredProduct'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@openshift-ci-robot
Copy link

Pipeline controller notification
This repository is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. Review these jobs and use /test <job> to manually trigger optional jobs most likely to be impacted by the proposed changes.

@stbenjam stbenjam changed the title fix(chat): prevent LLM from modifying test_details URL parameters TRT-2393: fix(chat): prevent LLM from modifying test_details URL parameters Nov 5, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 5, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 5, 2025

@stbenjam: This pull request references TRT-2393 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

In response to this:

Rename 'query_params' parameter to 'url' in get_test_details_report tool and add explicit instruction to pass URLs verbatim without modification. This prevents the LLM from incorrectly reformatting query parameters like 'dbGroupBy=LayeredProduct'.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

The get_test_details_report tool's input parameter is renamed from query_params to url, with URL construction logic adjusted to accept both full URLs and plain query parameters. Error handling and metadata descriptions are updated to reflect this change.

Changes

Cohort / File(s) Summary
Tool input parameter refactoring
chat/sippy_agent/tools/sippy_test_details.py
Renamed TestDetailsInput field from query_params: str to url: str; updated URL construction to handle full URLs (extracting query strings) or plain query parameters; adjusted error messages to reference url_input variable; refined tool metadata description.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review URL parsing logic to ensure it correctly handles both full URLs and query-only inputs
  • Verify error message updates accurately reflect the new parameter semantics
  • Confirm edge cases are handled (missing parameters, malformed URLs, query string trimming)

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Go Error Handling ❓ Inconclusive The custom check assesses Go error handling patterns, but the PR modifies Python code (sippy_test_details.py), not Go files. Clarify whether Go error handling checks apply to this PR. If Go files should be reviewed, verify adherence to Go error handling patterns. If only Python is modified, apply Python-specific checks instead.
Excessive Css In React Should Use Styles ❓ Inconclusive The pull request modifies only Python backend code with no React/JSX components or CSS styling present. This check is not applicable as the modified file is a Python module without React components, inline CSS, or styling code.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: renaming a parameter from query_params to url and adding instructions to prevent LLM modification of test_details URL parameters.
Sql Injection Prevention ✅ Passed The pull request modifies HTTP API request handling in sippy_test_details.py with no SQL operations, database connections, or string concatenation into SQL queries present.
Single Responsibility And Clear Naming ✅ Passed The TestDetailsInput class has clear naming and single responsibility for collecting input parameters. The url parameter rename improves semantic clarity. SippyTestDetailsTool maintains focused responsibility for fetching test details with appropriate method names.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot requested review from deepsm007 and sosiouxme November 5, 2025 14:50
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 5, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 5, 2025

@stbenjam: This pull request references TRT-2393 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

In response to this:

Rename 'query_params' parameter to 'url' in get_test_details_report tool and add explicit instruction to pass URLs verbatim without modification. This prevents the LLM from incorrectly reformatting query parameters like 'dbGroupBy=LayeredProduct'.

Summary by CodeRabbit

Release Notes

  • Refactor
  • The test details report tool now accepts full URLs as input instead of individual query parameters.
  • Improved error handling to provide clearer feedback when required URL information is missing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
chat/sippy_agent/tools/sippy_test_details.py (1)

63-76: Consider validating query parameters are non-empty.

The URL parsing logic correctly handles full URLs, paths, and plain query params. However, an empty or whitespace-only input would be treated as valid query params, potentially creating a malformed API URL.

Consider adding validation after extracting query params:

         else:
             # It's just query params
             query_params = url_input
+        
+        if not query_params:
+            return {"error": "No query parameters provided"}
 
         # Ensure query params don't start with ? or &

Alternatively, you could make the URL detection more explicit:

-        if url_input.startswith('http') or url_input.startswith(':/'):
+        if '://' in url_input or url_input.startswith('/'):

This would more precisely detect full URLs (containing ://) versus paths.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between f78f207 and f34a5cb.

📒 Files selected for processing (1)
  • chat/sippy_agent/tools/sippy_test_details.py (3 hunks)
🔇 Additional comments (3)
chat/sippy_agent/tools/sippy_test_details.py (3)

21-34: LGTM! Clear instructions to prevent LLM modification.

The updated description with "passed verbatim without modification" directly addresses the PR objective of preventing the LLM from reformatting query parameters.


39-40: LGTM! Field rename improves clarity.

Renaming from query_params to url makes the parameter more semantically clear for the LLM, and the explicit "without any modifications" instruction reinforces the PR objective.


72-72: LGTM! Error message correctly references the new variable.

@smg247
Copy link
Member

smg247 commented Nov 5, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smg247, stbenjam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 5, 2025

@stbenjam: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit aa5f04f into openshift:main Nov 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants