Skip to content

Join wrapped changelog entries in generated release notes - #98

Open
Subhransu-De wants to merge 3 commits into
mainfrom
fix/release-notes-unwrap
Open

Subhransu-De wants to merge 3 commits into
mainfrom
fix/release-notes-unwrap

Conversation

@Subhransu-De

Copy link
Copy Markdown
Owner

What changed

GitHub release bodies keep single line breaks. The changelog is hard-wrapped at 100 columns, so the v0.1.0 release notes broke every entry mid-sentence. I fixed the published v0.1.0 notes by hand, changing whitespace only.

cargo xtask release-notes now joins each list item's indented continuation lines onto the item, so future releases render correctly. Fenced code blocks are left untouched. CHANGELOG.md itself stays wrapped.

Checks

  • cargo test -p xtask --locked: 11 passed, including the new wrapped_entries_become_single_lines.
  • cargo clippy -p xtask --all-targets --locked -- -D warnings: clean.
  • Regenerated the v0.1.0 notes with the change. They are identical to the hand-fixed published notes.
  • User-visible changes are documented.

Note

From claude-opus-5-5

GitHub release bodies keep single line breaks, so the 100-column changelog
rendered each entry broken mid-sentence. release-notes now joins each list
item's indented continuation lines, leaving code blocks untouched.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T16:28:31.424292Z c5e31df New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81dd7c6a73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/release.rs Outdated
Comment on lines +141 to +145
if line.trim_start().starts_with("```") {
in_code = !in_code;
}
let continues_item = !in_code
&& line.starts_with(" ")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve indented closing fences

When a fenced code block is nested under a changelog bullet, its closing fence is also indented. This loop flips in_code to false before classifying that same line, so the closing delimiter is treated as a continuation and appended to the final code line. The generated release notes then contain an unclosed fence, causing the remainder to render as code; delimiter lines need to be excluded from continuation joining.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in dfa3fa3. A fence line is now classified before the code state flips, so an indented closing fence is never joined onto the code above it. The new test nested_blocks_and_indented_fences_are_kept covers a fenced block nested under a bullet.

Note

From claude-opus-5-5

Comment thread xtask/src/release.rs Outdated
}
let continues_item = !in_code
&& line.starts_with(" ")
&& !line.trim_start().starts_with(['-', '*'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve all nested Markdown list markers

When a changelog entry contains a nested ordered list or a + bullet, these valid Markdown markers pass this exclusion and are appended to the preceding line, flattening the sublist in the generated release notes. Since nested - and * items are deliberately preserved, the continuation classifier should likewise recognize the other list markers instead of treating them as wrapped prose.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in dfa3fa3. An indented line that starts its own Markdown block is no longer joined onto the item above. That covers ordered items (1. and 2)), + bullets, quotes, table rows and headings, alongside - and *. The new test nested_blocks_and_indented_fences_are_kept covers them.

Note

From claude-opus-5-5

A closing fence is now classified before the code state flips, and ordered,
plus, quote, table and heading lines start their own block instead of being
joined onto the item above.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfa3fa31c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/release.rs Outdated
let mut lines: Vec<String> = Vec::new();
let mut in_code = false;
for line in body.lines() {
let fence = line.trim_start().starts_with("```");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve tilde-fenced code blocks

When a changelog entry uses a valid tilde fence (~~~), this check never enters code-block state, so each two-space-indented code and delimiter line can satisfy continues_item and be collapsed into one line, destroying the fenced block in the generated release notes. Fresh evidence after the earlier fence fix is that the updated check still recognizes only backtick fences; it should recognize tilde fences and their matching closers as well.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in c5e31df. Both ``` and ~~~ fences now open a code block, and a block closes only on the same kind of fence that opened it. The new test tilde_fences_are_kept_and_only_close_their_own_kind covers a tilde block that contains a backtick line.

Note

From claude-opus-5-5

Both backtick and tilde fences now open a code block, and only the same
kind closes it.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c5e31df285

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/release.rs
Comment on lines +143 to +146
let continues_item = open_fence.is_none()
&& fence.is_none()
&& line.starts_with(" ")
&& !starts_block(line.trim_start())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve indented code blocks

When a release entry uses an indented Markdown code block—for example, a blank line followed by multiple lines indented six spaces under - Example:—the first code line is retained, but every following code line satisfies continues_item and is appended to the preceding one. This removes the code block's line structure in the published release notes; recognize indented code blocks or restrict joining to the continuation indentation used for prose.

Useful? React with 👍 / 👎.

Comment thread xtask/src/release.rs
Comment on lines +180 to +182
|| ["- ", "* ", "+ ", "> ", "| ", "#"]
.iter()
.any(|marker| line.starts_with(marker))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve compact pipe tables

When a nested table omits the optional space after its opening pipe, such as |Name|Value| followed by |---|---|, neither row matches the "| " marker. The delimiter row is therefore appended to the header row (and the header may also be appended to preceding text), destroying a valid GitHub Markdown table in the generated notes; treat any leading | as a block marker.

Useful? React with 👍 / 👎.

Comment thread xtask/src/release.rs
Comment on lines +167 to +171
fn fence_marker(line: &str) -> Option<&'static str> {
let line = line.trim_start();
["```", "~~~"]
.into_iter()
.find(|marker| line.starts_with(marker))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match complete closing-fence syntax

When a code block uses a four-character outer fence to show a three-character fence, or contains a line such as ```not-a-closer, fence_marker reduces both lines to the same three-character marker and closes the block early. Markdown requires the closing run to be at least as long as the opener and permits only trailing whitespace, so subsequent indented code lines can be joined and the real closer can reopen the state; retain the delimiter length and validate closing-fence syntax.

Useful? React with 👍 / 👎.

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.

1 participant