Slack message content and previews
Understand how P4 Code Review formats Slack notifications and what content is included in messages.
Slack notifications include structured information about reviews, comments, and changes to help users quickly understand activity without leaving Slack.
Message types
P4 Code Review sends two types of Slack notifications:
Review summary messages
Review summary messages are sent when a review is created.
These messages provide an overview of the review, including information such as:
-
Review ID and title.
-
Review author.
-
Review description.
-
Associated files.
-
Links to the review in P4 Code Review.
The review summary message starts the Slack thread for that review.
Reply messages
Reply messages are sent when activity occurs on an existing review.
Reply messages can include:
-
Comments.
-
Comment replies.
-
Review state changes.
-
Additional review updates.
Reply messages are posted as threaded replies to the original review summary message.
This keeps all related review activity grouped together in a single Slack conversation.
Message content
The content included in a Slack notification depends on the event that triggered it.
Notifications can include:
-
Review ID and title.
-
Review author.
-
Review description.
-
Comment text.
-
Review status information.
-
Links to the review in P4 Code Review.
Different notification types display different information depending on the review activity being reported.
File information in messages
Slack messages can include file-related information from the review.
Review summary messages
Review summary messages can display a list of affected files.
The number of files displayed is controlled by the summary_file_limit setting.
Reply messages
Reply messages can include file names associated with the comment, reply, or review activity.
This provides additional context without requiring users to open the review.
File display options
You can control how files appear in messages:
-
summary_file_limit- Controls the maximum number of files displayed in review summary messages. -
Include file names in summary - Controls whether file names are displayed in review summary messages.
-
Include file names in replies - Controls whether file names are displayed in reply messages. These settings help balance notification detail and message size.
For information about configuring these options, see Configure Slack.
Image previews
P4 Code Review can include image previews in Slack notifications.
Image previews allow users to view screenshots and other image attachments directly in Slack.
How image previews work
When a comment contains an image attachment:
-
P4 Code Review uploads the image to Slack.
-
Slack processes the uploaded image.
-
The image is displayed inline within the notification.
Users can view the image directly in Slack without opening P4 Code Review.
Supported attachments
Image previews are supported for web-safe image formats. Non-image attachments are not displayed inline.
Behaviour and limits
Image previews are subject to the configured attachment size limits.
Large images may take longer for Slack to process and display.
If Slack cannot process the image immediately:
-
P4 Code Review retries the upload.
-
If the image remains unavailable, the notification is delivered without the image preview.
Notification delivery is not blocked if an image preview cannot be generated.
Message formatting
Slack notifications use structured message blocks to present review information clearly and consistently.
Message formatting is designed to:
-
Highlight key review information.
-
Present updates in a consistent layout.
-
Display links to reviews.
-
Support inline image previews.
-
Make review activity easy to scan and understand.
The exact content and layout can vary depending on the notification type.
Bot user settings
Slack messages are sent using a bot identity.
You can configure:
-
Bot name.
-
Bot icon.
-
Whether the bot identity is enabled.
-
Whether to force a user-style message header.
These settings control how messages appear in Slack.
For information about configuring bot settings, see Configure Slack.
Threaded notifications
P4 Code Review uses Slack threads to organize review activity.
Initial review notification
When a review is created:
-
P4 Code Review posts a review summary message.
-
The message becomes the parent of the review thread.
Subsequent review activity
When additional review activity occurs:
-
New comments are posted as replies.
-
Comment replies are posted as replies.
-
Review state changes are posted as replies.
-
Additional review updates are posted as replies.
This keeps all review activity grouped within a single conversation and reduces channel noise.
Notes
-
Message content varies depending on the review event.
-
File information depends on the configured display settings.
-
Image previews are available only for supported image attachments.
-
Non-image attachments are not displayed inline.
-
Notifications are still delivered if image previews cannot be generated.