Skip to content

fix(ci): prevent diagnostic output from escaping code fences - #1259

Merged
Trott merged 1 commit into
nodejs:mainfrom
Trott:fence
Nov 26, 2026
Merged

Trott merged 1 commit into
nodejs:mainfrom
Trott:fence

Conversation

@Trott

@Trott Trott commented Nov 26, 2026

Copy link
Copy Markdown
Member

Choose a fence longer than any backtick run in the diagnostic so embedded fences cannot expose diagnostic content as Markdown or HTML.

Add regression tests for embedded fences and ordinary output.

Choose a fence longer than any backtick run in the diagnostic so embedded
fences cannot expose diagnostic content as Markdown or HTML.

Add regression tests for embedded fences and ordinary output.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the CI diagnostic formatting change.

No open issues 🎉

What changed in this PR

Updates CI diagnostic formatting so Markdown code fences cannot be prematurely closed by backtick runs contained in diagnostic output.

Changes:

  • Dynamically selects a fence one backtick longer than the longest backtick run in the diagnostic.
  • Adds regression coverage for ordinary, empty, inline-backtick, embedded-fence, and long-run output.
File Description
test/​unit/​ci_utils.test.js Adds regression tests covering ordinary output and diagnostics containing embedded backtick fences.
lib/​ci/​ci_utils.js Updates diagnostic formatting to generate a code fence longer than any backtick run in the output.

Review effort: Lite

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.11%. Comparing base (bbfe7c2) to head (8fd6416).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1259      +/-   ##
==========================================
+ Coverage   67.09%   67.11%   +0.01%     
==========================================
  Files          69       69              
  Lines       14303    14309       +6     
==========================================
+ Hits         9597     9603       +6     
  Misses       4706     4706              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Trott
Trott merged commit e05ba26 into nodejs:main Nov 26, 2026
11 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.

2 participants