Skip to content

fix(ci): stop Discord notifier from posting blank bot comments - #1080

Merged
kwit75 merged 1 commit into
rocketride-org:developfrom
mithileshgau:fix/RR-1079-discord-blank-bot-comments
Jun 3, 2026
Merged

fix(ci): stop Discord notifier from posting blank bot comments#1080
kwit75 merged 1 commit into
rocketride-org:developfrom
mithileshgau:fix/RR-1079-discord-blank-bot-comments

Conversation

@mithileshgau

@mithileshgau mithileshgau commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The Discord notifier workflows stored the discord-msg-id tracking 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.
  • Wrapped the marker in a collapsible <details> block (summary: 🤖 Internal: Discord sync marker) so the tracking comment is no longer empty/confusing.
  • Relaxed the detection regex from a full-body anchor (^<!-- … -->\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

  • Tests added or updated
  • Tested locally
  • ./builder test passes

Validation run locally:

  • actionlint (with embedded shellcheck) on both workflows — no issues
  • YAML parse of both workflows — valid
  • gitleaks protect --staged (repo config) — no leaks
  • Detection regex confirmed to match both the new <details> body and legacy bare-marker comments

Checklist

  • Commit messages follow conventional commits
  • No secrets or credentials included
  • Wiki updated (if applicable)
  • Breaking changes documented (if applicable)

Linked Issue

Fixes #1079

Summary by CodeRabbit

Release Notes

  • Chores
    • Enhanced Discord message ID tracking logic for GitHub issues and pull requests with improved marker detection
    • Updated linked GitHub comments to display collapsible details blocks containing instructional information and message identifiers
    • Improved synchronization of Discord notification references across concurrent workflow runs

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>
@mithileshgau
mithileshgau requested a review from kwit75 as a code owner June 3, 2026 01:14
@github-actions github-actions Bot added the ci/cd CI/CD and build system label Jun 3, 2026
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 47996a4c-b63a-4ed6-bd49-5fa6f478506e

📥 Commits

Reviewing files that changed from the base of the PR and between c3b7720 and e214612.

📒 Files selected for processing (2)
  • .github/workflows/discord-issues.yml
  • .github/workflows/discord-pr.yml

📝 Walkthrough

Walkthrough

Both Discord notification workflows (PR and issue) simplify marker detection to match <!-- discord-msg-id:<digits> --> without strict whitespace/anchor requirements, then wrap the marker in a <details> HTML block to provide visible comment content instead of posting blank bot comments.

Changes

Discord Message ID Marker Handling

Layer / File(s) Summary
Simplify marker detection across both workflows
.github/workflows/discord-issues.yml, .github/workflows/discord-pr.yml
Marker-matching regex in initial DISCORD_MSG_ID extraction, stale comment detection, and race-condition detection updated to a simpler <!-- discord-msg-id:<digits> --> pattern without anchor/whitespace constraints in both workflows.
Wrap marker in details block for visible content
.github/workflows/discord-issues.yml, .github/workflows/discord-pr.yml
New comment body format changed from bare HTML marker to <details>/<summary> block containing instructional text plus the embedded marker, ensuring bot comments display visible content instead of rendering blank.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • rocketride-org/rocketride-server#699: Updates workflow logic for <!-- discord-msg-id:<digits> --> marker discovery with loosened marker matching, aligned with similar fixes across Discord notification workflows.
  • rocketride-org/rocketride-server#614: Modifies discord-pr.yml marker handling for how the workflow finds and creates the stored Discord message ID in PR comments.
  • rocketride-org/rocketride-server#638: Updates Discord message-ID persistence logic including marker regex and race/duplicate handling in both Discord notification workflows.

Suggested labels

ci/cd

Suggested reviewers

  • kwit75
  • joshuadarron
  • stepmikhaylov

Poem

🐰 A marker wrapped in <details> bright,
No more blank comments in the night!
The regex loosens, simpler and free,
Discord and GitHub dance in harmony. ✨

🚥 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 summarizes the main fix: preventing blank bot comments from Discord notifiers, which matches the core change across both workflow files.
Linked Issues check ✅ Passed The PR fulfills issue #1079's requirements by wrapping the Discord marker in a collapsible details block instead of posting bare HTML comments, and by relaxing regex detection to find the ID within the new format.
Out of Scope Changes check ✅ Passed All changes are scoped to the two Discord workflow files and directly address the marker format and detection logic to prevent blank bot comments, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@asclearuc

Copy link
Copy Markdown
Collaborator

LGTM, but I leave approval to @kwit75 because GitHub actions is his area of responsibility.

@kwit75 kwit75 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@kwit75
kwit75 merged commit 1f55765 into rocketride-org:develop Jun 3, 2026
21 checks passed
@mithileshgau
mithileshgau deleted the fix/RR-1079-discord-blank-bot-comments branch June 8, 2026 15:53
mithileshgau pushed a commit to mithileshgau/rocketride-server that referenced this pull request Jun 8, 2026
…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>
kwit75 pushed a commit that referenced this pull request Jul 2, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI/CD and build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): Discord notifier posts blank github-actions bot comments on every PR and issue

3 participants