Skip to content

ci: emit real newlines in Slack release message - #9039

Merged
jay-418 merged 2 commits into
mainfrom
fix/slack-nightly-newlines
Sep 10, 2026
Merged

jay-418 merged 2 commits into
mainfrom
fix/slack-nightly-newlines

Conversation

@Derekf5

@Derekf5 Derekf5 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Nightly posts in #releases have shown a literal \n between every line since Aug 25 (example), instead of one line per download as before.

Cause. scripts/ci/format.sh slack builds its text with \n inside double-quoted bash strings, which bash does not expand, so the script emits the two characters \ n. Before #8955 the workflow interpolated that raw text into a hand-written JSON payload, so Slack's JSON parser decoded \n as a newline and the message rendered correctly by accident. #8955 switched to jq --arg text "$text", which correctly escapes the backslash to \\n, and Slack now displays the escape literally.

Fix. Expand the escapes in the script: echo "$text"printf '%b\n' "$text". The message contains no other backslashes, so nothing else changes. The jq step in release.yml is correct and untouched. The nightly-failure-notify message was never affected because it composes its text with printf format strings.

Test plan

  • Ran format.sh slack before/after with nightly env and piped through jq -Rs '{text: .}': before produces \\n in the JSON string, after produces \n.
  • format.sh job-summary output unchanged (the change is scoped to the slack) case).
  • Next scheduled nightly renders one line per download in #releases.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved Slack CI message formatting so interpreted escape sequences display correctly.

format.sh builds the Slack text with literal \n sequences, which bash does
not expand. That used to render correctly only because the workflow
interpolated the raw text into a hand-written JSON string, where Slack's
JSON parser decoded \n as a newline. Since #8955 the payload is built with
jq --arg, which correctly escapes the backslash, so #releases posts now
show a literal \n between every line.

Expand the escapes in the script itself so the output is correct
regardless of how the caller encodes it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 10, 2026 12:37
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 490ab260-0fce-4a8d-a8f6-76d1e82213fb

📥 Commits

Reviewing files that changed from the base of the PR and between 40b24d0 and 2eabb29.

📒 Files selected for processing (1)
  • scripts/ci/format.sh

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The CI formatter now uses printf '%b\n' for Slack output, which renders embedded newline escape sequences as line breaks.

Changes

Slack message formatting

Layer / File(s) Summary
Render escaped Slack messages
scripts/ci/format.sh
Slack output uses printf '%b\n' instead of echo, so embedded newline escapes render as line breaks.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to f9d68

Slack release notifications will display their intended line breaks, with no current merge-blocking correctness or availability risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: emitting actual newlines in the Slack release message through the CI formatting script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/slack-nightly-newlines

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is narrowly scoped to the Slack formatting path and aligns with the stated root cause without impacting other format outputs.

Pull request overview

Fixes Slack release notifications emitted by CI so they contain real newline characters rather than the literal \n escape sequence, restoring the expected “one line per download” formatting in #releases.

Changes:

  • Update scripts/ci/format.sh Slack formatter output to expand \n escapes into actual newlines via printf '%b\n'.
File summaries
File Description
scripts/ci/format.sh Emits Slack message text with real newlines by interpreting \n escape sequences when printing.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Derekf5
Derekf5 requested a review from jay-418 September 10, 2026 12:41

@jay-418 jay-418 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for taking the initiative on this @Derekf5!

@jay-418
jay-418 merged commit b9187ea into main Sep 10, 2026
9 checks passed
@jay-418
jay-418 deleted the fix/slack-nightly-newlines branch September 10, 2026 16:01
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.

3 participants