-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(ci): close the carry gate on an unclosed HTML comment #3343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 33306
🤖 get_repo_knowledge executed:
get_repo_knowledge lidge-jun/opencodex /tmp/coderabbit-repo-knowledge/lidge-jun-opencodex-7afea732/learnings /tmp/coderabbit-repo-knowledge/lidge-jun-opencodex-7afea732/conventionsLength of output: 15213
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 15606
🌐 Web query:
GitHub Flavored Markdown specification HTML comment <!--> inline code<!--behavior💡 Result:
In GitHub Flavored Markdown (GFM), which is based on the CommonMark specification, the handling of
<!--depends entirely on its position and context within the document [1][2]. 1. HTML Block Comments: If a line begins with<!--(optionally preceded by up to three spaces), it is classified as an HTML block (specifically, Type 2) [1][3]. The parser treats this as the start of an HTML block, and it will continue to consume lines until it encounters the closing string-->[1][3]. Because this is treated as a block-level element, it can interrupt paragraphs [4][3]. 2. Inline Comments: If<!--appears anywhere else on a line (e.g., preceded by text), it is not treated as the start of an HTML block [1][5]. In these cases, it is simply treated as raw text [1][6]. Markdown parsers generally do not provide a standard mechanism for inline HTML comments to be "hidden" or parsed as structural comments; they are treated as literal text content within the paragraph [1][6]. 3. Behavior of<!-->: The string<!-->is not a standard HTML comment opener. A valid HTML comment must begin with<!--and end with-->[1][3]. If you write<!-->, it does not satisfy the requirements for an HTML block, and it will be rendered as literal text in the final output [1][3]. 4. Inline Code<!--: When you wrap<!--in backticks (e.g.,<!--), the Markdown parser treats it as an inline code span [7]. The characters inside the backticks are escaped or rendered as literal code, meaning they will never be interpreted as an HTML comment, regardless of where they appear in the document [7]. In summary,<!--only functions as a structural HTML comment if it starts a line (potentially with minor indentation) and is followed later by-->[1][3]. Any other usage, or usage inside code spans, results in the characters being treated as literal text [1][6][7].Citations:
Preserve visible carry claims after inline code and invalid comment-like text.
At
.github/scripts/pr-carry-attribution.cjs:75,HTML_COMMENT_REruns beforeINLINE_CODE_RE. It therefore consumes`<!--` Supersedes `#2797`.through end-of-text, soassessCarryAttributionreturns nomissing_coauthor_creditfailure. It also consumes<!--> Supersedes#2797., which GFM renders as literal text. Replace the sequential regexes with a left-to-right tokenizer that handles inline code before valid HTML comments. Add both regression cases to.github/scripts/pr-carry-attribution.test.cjsand expect one attribution failure for each. Obtain explicit security review for this.github/**automation change.🤖 Prompt for AI Agents
Sources: Path instructions, MCP tools