Skip to content

testbot: let Slack unfurl the PR link into a GitHub card - #1287

Closed
jiaenren wants to merge 1 commit into
mainfrom
jiaenr/testbot-slack-unfurl
Closed

testbot: let Slack unfurl the PR link into a GitHub card#1287
jiaenren wants to merge 1 commit into
mainfrom
jiaenr/testbot-slack-unfurl

Conversation

@jiaenren

@jiaenren jiaenren commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Description

The testbot review request posts as plain text with no PR preview card.

Two things in the payload prevented it:

  1. Slack unfurls links from a message's text field, not from links inside Block Kit blocks.
  2. Messages posted by a bot do not unfurl unless unfurl_links is set explicitly.

The blocks array duplicated text verbatim, so dropping it changes nothing about how the message reads. With unfurling enabled the GitHub app renders the card under the message.

Verification

bazel test //src/scripts/testbot:all //src/scripts/testbot/tests:all — 19 targets pass, including the -pylint siblings. Added a test asserting the payload enables unfurling and carries no blocks.

The rendered card can only be confirmed once this runs with the testbot bot token, since posting as a user unfurls regardless and would not exercise the bot path.

Issue - None

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Enhancements
    • Slack review notifications now use plain-text messages with link and media previews enabled.
    • Notifications no longer use Block Kit formatting, providing a simpler message presentation.

The review request posted no preview card. Two reasons: Slack unfurls
links from a message's `text`, not from inside Block Kit blocks, and
messages posted by a bot do not unfurl unless unfurl_links is set.

The blocks array duplicated `text` verbatim, so dropping it costs
nothing. With unfurling enabled the official GitHub Slack app --
already installed and unfurling PR links in #osmo-code-reviews --
renders the card under the message. No link_shared handler needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jiaenren
jiaenren requested a review from a team as a code owner August 11, 2026 21:21
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Slack review payload now sends plain text with link and media unfurling enabled. The test verifies these options and confirms that Block Kit blocks are absent.

Changes

Slack review payload

Layer / File(s) Summary
Plain-text payload and validation
src/scripts/testbot/create_pr.py, src/scripts/testbot/tests/test_create_pr.py
The payload enables link and media unfurling and omits Block Kit blocks. The test verifies both options and the absent blocks field.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: adelbertc, aruns-nv, cypres

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: enabling Slack to unfurl pull request links into GitHub preview cards.
✨ 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 jiaenr/testbot-slack-unfurl

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

@jiaenren

Copy link
Copy Markdown
Collaborator Author

Superseded by #1290, which combines this with the other open testbot changes.

@jiaenren jiaenren closed this Aug 11, 2026
@jiaenren
jiaenren deleted the jiaenr/testbot-slack-unfurl branch August 11, 2026 23:41
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