Skip to content

[TRTLLMINF-38][feat] Pass PR number to CI failure analysis agent#12849

Merged
dpitman-nvda merged 2 commits intoNVIDIA:mainfrom
dpitman-nvda:add-github-pr-analysis
Apr 17, 2026
Merged

[TRTLLMINF-38][feat] Pass PR number to CI failure analysis agent#12849
dpitman-nvda merged 2 commits intoNVIDIA:mainfrom
dpitman-nvda:add-github-pr-analysis

Conversation

@dpitman-nvda
Copy link
Copy Markdown
Collaborator

@dpitman-nvda dpitman-nvda commented Apr 8, 2026

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

  • Chores
    • Improved pipeline failure diagnostics by enhancing error analysis with pull request context information.

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.

@dpitman-nvda dpitman-nvda requested review from a team as code owners April 8, 2026 15:47
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Pipeline Failure Logging
jenkins/L0_MergeRequest.groovy
Modified failure handler to derive PR number from GitHub API URL and pass it to analyzePipelineFailureWithAgent function call.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: passing the PR number to the CI failure analysis agent for improved efficiency.
Description check ✅ Passed The PR description covers the main objective and rationale, though some template sections (Test Coverage, checklist items) are minimal or use placeholders.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
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.

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9fed1ef and 4e30f4c.

📒 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>
@dpitman-nvda dpitman-nvda force-pushed the add-github-pr-analysis branch from 4e30f4c to 96b8600 Compare April 8, 2026 15:58
@dpitman-nvda
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #42711 [ run ] triggered by Bot. Commit: 5013ad4 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #42711 [ run ] completed with state SUCCESS. Commit: 5013ad4
/LLM/main/L0_MergeRequest_PR pipeline #33405 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@dpitman-nvda
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #42749 [ run ] triggered by Bot. Commit: 5013ad4 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #42749 [ run ] completed with state SUCCESS. Commit: 5013ad4
/LLM/main/L0_MergeRequest_PR pipeline #33427 completed with status: 'SUCCESS'

CI Report

Link to invocation

@dpitman-nvda dpitman-nvda merged commit 70805eb into NVIDIA:main Apr 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants