[TRTLLMINF-38][feat] Pass PR number to CI failure analysis agent#12849
[TRTLLMINF-38][feat] Pass PR number to CI failure analysis agent#12849dpitman-nvda merged 2 commits intoNVIDIA:mainfrom
Conversation
📝 WalkthroughWalkthroughThe Jenkins pipeline's failure handling now extracts a PR number from the GitHub PR API URL and passes it as an additional argument to the pipeline failure analysis utility function. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
jenkins/L0_MergeRequest.groovy (1)
1360-1363: Harden PR number extraction to avoid malformed values.Line 1362 can return non-numeric tails for non-canonical URLs. Prefer extracting digits specifically from
/pulls/{id}.Proposed refactor
- def prNumber = null - if (globalVars[GITHUB_PR_API_URL]) { - prNumber = globalVars[GITHUB_PR_API_URL].tokenize('/').last() - } + def prNumber = null + def githubPrApiUrl = globalVars[GITHUB_PR_API_URL] + if (githubPrApiUrl) { + def match = (githubPrApiUrl =~ /\/pulls\/(\d+)(?:$|[\/?])/) + if (match.find()) { + prNumber = match.group(1) + } + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@jenkins/L0_MergeRequest.groovy` around lines 1360 - 1363, prNumber extraction currently takes the URL tail which can include non-numeric values; change the logic that sets prNumber (variable prNumber using globalVars[GITHUB_PR_API_URL]) to run a regex match for the canonical pulls segment (e.g. match /pulls?/(\d+) or /pull/(\d+)) and assign the captured digits as the prNumber (or null if no match) so only numeric PR IDs are returned and malformed URLs are ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@jenkins/L0_MergeRequest.groovy`:
- Around line 1360-1363: prNumber extraction currently takes the URL tail which
can include non-numeric values; change the logic that sets prNumber (variable
prNumber using globalVars[GITHUB_PR_API_URL]) to run a regex match for the
canonical pulls segment (e.g. match /pulls?/(\d+) or /pull/(\d+)) and assign the
captured digits as the prNumber (or null if no match) so only numeric PR IDs are
returned and malformed URLs are ignored.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 81b60d86-9b6b-46e1-9622-86a2091ab5e9
📒 Files selected for processing (1)
jenkins/L0_MergeRequest.groovy
Extract the PR number from globalVars[GITHUB_PR_API_URL] using a regex match on /pulls?/(\d+) and pass it to analyzePipelineFailureWithAgent() so the agent can query the GitHub MCP server for PR details and code diffs when diagnosing failures. Malformed URLs yield null gracefully. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Derek Pitman <dpitman@nvidia.com>
4e30f4c to
96b8600
Compare
|
/bot run |
|
PR_Github #42711 [ run ] triggered by Bot. Commit: |
|
PR_Github #42711 [ run ] completed with state
|
|
/bot run |
|
PR_Github #42749 [ run ] triggered by Bot. Commit: |
|
PR_Github #42749 [ run ] completed with state |
Extract the PR number from globalVars[GITHUB_PR_API_URL] and pass it to analyzePipelineFailureWithAgent() so the agent can query the GitHub MCP server for PR details and code diffs when diagnosing failures.
Summary by CodeRabbit
Description
It's more efficient to provide the CI failure analzyer agent with the PR number directly in the invocation versus having it try to decipher that information from the Jenkins logs. This PR gets that information and appends it to the model request.
The agent is being updated with GitHub read access in separate changes.
Test Coverage
N/A, this is CI-related but we are updating our agent evals accordingly
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.