[TRTLLMINF-45][infra] Upload rendered HTML failure analysis#13526
[TRTLLMINF-45][infra] Upload rendered HTML failure analysis#13526dpitman-nvda merged 4 commits intoNVIDIA:mainfrom
Conversation
…ce URL Replace the plain-text failure_analysis.txt upload with a self-rendering failure_analysis.html: a small HTML page that embeds the analysis markdown JSON-encoded and parses it client-side via marked.js from cdn.jsdelivr.net. Anyone with the link gets a rendered view in their browser, no extra tooling. Upload uses --content-type text/html so SwiftStack serves it correctly. The Swift-style URL is also written into currentBuild.description as an HTML anchor. The upstream PR_Github wrapper (in trtllm-github-ci) reads this via the build handle and includes the link in the GitHub PR comment when the L0 pipeline finishes unsuccessfully — so authors don't have to dig through Jenkins to find the analysis. Signed-off-by: Derek Pitman <dpitman@nvidia.com>
|
/bot run |
📝 WalkthroughWalkthroughThe pipeline failure analysis artifact generation changed from plain-text format to HTML format. The artifact is now generated as Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@jenkins/L0_MergeRequest.groovy`:
- Around line 1433-1435: The S3 destination URI built in the concatenated shell
command (the aws s3 cp call that constructs "s3://${bucket}/${key}") must be
quoted to avoid shell-splitting; update the string concatenation so the command
emits the destination as a quoted string (e.g. "'s3://${bucket}/${key}'" or wrap
with single quotes) when constructing the aws s3 cp invocation in the Jenkins
pipeline code that builds the command.
- Around line 1407-1413: The current code directly injects untrusted markdown
via marked.parse(...) into element.innerHTML and embeds raw JSON from
groovy.json.JsonOutput.toJson(analysis) inside an inline <script>, enabling XSS;
fix by (1) including pinned, integrity-checked CDN references for marked and
DOMPurify, (2) calling DOMPurify.sanitize(marked.parse(...)) and assigning that
sanitized string to document.getElementById('md').innerHTML instead of the raw
parse output, and (3) escaping '<' in the JSON before embedding (e.g. replace
"<" with "\\u003c" in the string returned by JsonOutput.toJson(analysis)) or,
better, avoid inline script-inserted JSON and place the escaped JSON in a data-*
attribute or use textContent to safely parse—update occurrences of marked.parse,
innerHTML assignment, and JsonOutput.toJson(analysis) accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 950b43ed-17fc-4e4e-9efd-5f3c062d4e1d
📒 Files selected for processing (1)
jenkins/L0_MergeRequest.groovy
|
PR_Github #45783 [ run ] triggered by Bot. Commit: |
The CI agent's analysis text is derived from build logs, which can include attacker-controlled PR content, so it must be treated as untrusted at render time. Three hardenings on the failure_analysis.html upload: 1. marked and DOMPurify are pinned to specific versions and loaded with subresource integrity hashes so a CDN compromise can't inject code. 2. The analysis JSON is embedded in a `<script type="application/json">` data block and read via textContent + JSON.parse. Every `<` in the JSON is rewritten to its JSON unicode escape so a payload cannot smuggle a closing script tag and break out of the data block. 3. marked's parsed HTML is run through DOMPurify before innerHTML assignment, stripping event-handler attributes and other XSS vectors that marked itself would otherwise allow through by default. Also single-quote the s3:// destination URI in the aws s3 cp command so future shell-metacharacter values in JOB_NAME or BUILD_NUMBER can't cause word-splitting. Defensive — current values are already safe. Signed-off-by: Derek Pitman <dpitman@nvidia.com>
|
@coderabbitai Have the issues been addressed? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 21095 🏁 Script executed: Length of output: 7292
✅ Issue 1 — XSS via
|
|
PR_Github #45783 [ run ] completed with state
|
CI failure-analysis text frequently contains literal tildes (~/path, ~50ms, regex anchors, ...) that are not intended as markup. marked's default GFM strikethrough tokenizer wraps these in <del>, garbling the output. Override the del tokenizer to never match while leaving other GFM extensions enabled. Signed-off-by: Derek Pitman <dpitman@nvidia.com>
|
Well if nothing else this was a great test run of the new workflow (Markdown version of the report on SwiftStack), but I had to push some changes (and I see a small formatting issue with tildes and strikethrough, just updated that). Will retry after merging main. |
|
/bot run |
|
PR_Github #45800 [ run ] triggered by Bot. Commit: |
|
PR_Github #45800 [ run ] completed with state |
Summary by CodeRabbit
Description
Replace the plain-text failure_analysis.txt upload with a self-rendering failure_analysis.html: a small HTML page that embeds the analysis markdown JSON-encoded and parses it client-side via marked.js from cdn.jsdelivr.net. Anyone with the link gets a rendered view in their browser, no extra tooling. Upload uses --content-type text/html so SwiftStack serves it correctly.
The Swift-style URL is also written into currentBuild.description as an HTML anchor. The upstream PR_Github wrapper (in trtllm-github-ci) reads this via the build handle and includes the link in the GitHub PR comment when the L0 pipeline finishes unsuccessfully — so authors don't have to dig through Jenkins to find the analysis.
Test Coverage
N/A, CI change
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.