fix(ci): stop Discord notifier from posting blank bot comments - #1080
Conversation
Store the discord-msg-id marker inside a collapsible <details> block instead of a bare HTML comment, so the tracking comment no longer renders as an empty "No description provided" comment on every PR and issue. Relax the detection regex to match the marker anywhere, keeping backward compatibility with existing bare-marker comments. Fixes rocketride-org#1079 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughBoth Discord notification workflows (PR and issue) simplify marker detection to match ChangesDiscord Message ID Marker Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No description provided. |
|
LGTM, but I leave approval to @kwit75 because GitHub actions is his area of responsibility. |
kwit75
left a comment
There was a problem hiding this comment.
LGTM — clean fix for the blank bot comments. Root cause is the bare <!-- discord-msg-id:N --> HTML comment rendering empty on GitHub; wrapping it in a visible <details> marker block (with the machine-readable id still inside) + loosening the lookup regex from anchored ^...$ to a substring test() so it still matches inside the larger body is the right call. Nicely applied symmetrically to both discord-issues.yml and discord-pr.yml, and the bot-author guard keeps the substring match safe from false positives. CI green. Merging.
…er.sh The marker format (the <!-- discord-msg-id:N --> pattern, its <details> payload, and the ID extraction) was duplicated across discord-pr.yml, discord-issues.yml, and discord-discussions.yml — which is why the rocketride-org#1080 blank-comment fix had to be re-applied to discussions separately. Move the contract into the already-shared discord-helper.sh: - DISCORD_MARKER_PATTERN — the jq test() regex (passed via --arg) - render_discord_marker — emits the <details>-wrapped comment body - extract_discord_marker — reads a body on stdin, prints the message ID All three workflows now call these helpers, so future marker changes happen in one place. Race-guard lookups switch from `gh api --jq` to `gh api | jq --arg` (gh's --jq can't take --arg); behavior under `bash -e` is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ments (#1185) * fix(ci): stop Discord discussions notifier from posting blank bot comments Apply the same fix as #1080 (PRs/issues) to discord-discussions.yml, which was missed in that change. Store the discord-msg-id marker inside a collapsible <details> block instead of a bare HTML comment, so the tracking comment no longer renders as an empty github-actions[bot] comment on every discussion. Relax the marker-detection regex to match anywhere, keeping backward compatibility with existing bare-marker comments. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(ci): centralize Discord sync-marker contract in discord-helper.sh The marker format (the <!-- discord-msg-id:N --> pattern, its <details> payload, and the ID extraction) was duplicated across discord-pr.yml, discord-issues.yml, and discord-discussions.yml — which is why the #1080 blank-comment fix had to be re-applied to discussions separately. Move the contract into the already-shared discord-helper.sh: - DISCORD_MARKER_PATTERN — the jq test() regex (passed via --arg) - render_discord_marker — emits the <details>-wrapped comment body - extract_discord_marker — reads a body on stdin, prints the message ID All three workflows now call these helpers, so future marker changes happen in one place. Race-guard lookups switch from `gh api --jq` to `gh api | jq --arg` (gh's --jq can't take --arg); behavior under `bash -e` is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(ci): align extract_discord_marker regex with DISCORD_MARKER_PATTERN Use grep -oE 'discord-msg-id:[0-9]+' so the extractor requires one-or-more digits, matching the [0-9]+ in DISCORD_MARKER_PATTERN. Keeps the centralized marker contract self-consistent (no behavioral change — digitless input still yields an empty ID). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Mithilesh Gaurihar <mithileshgaurihar@Mithileshs-MacBook-Pro.local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
discord-msg-idtracking marker as a bare HTML comment (<!-- discord-msg-id:NNN -->), which GitHub renders as a blank "No description provided"github-actions[bot]comment on every PR and issue.<details>block (summary:🤖 Internal: Discord sync marker) so the tracking comment is no longer empty/confusing.^<!-- … -->\s*$) to a substring match (<!-- … -->) so it still finds the ID inside the new block — and remains backward compatible with existing bare-marker comments already on open PRs/issues.Type
fix (CI / GitHub Actions)
Testing
./builder testpassesValidation run locally:
actionlint(with embeddedshellcheck) on both workflows — no issuesgitleaks protect --staged(repo config) — no leaks<details>body and legacy bare-marker commentsChecklist
Linked Issue
Fixes #1079
Summary by CodeRabbit
Release Notes