Repository navigation
fix(ci): prevent diagnostic output from escaping code fences - #1259
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
🟢 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.