feat: include pull request description in slack notifications#6540
Merged
Conversation
8195cc9 to
4447ab9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds pull/merge request descriptions to Atlantis’ internal pull request model and surfaces them in Slack webhook notifications (with truncation), updating parsers, fixtures, tests, and docs accordingly.
Changes:
- Add
Bodytomodels.PullRequestand populate it in GitHub/GitLab/Azure DevOps/Gitea parsing. - Include PR description as a Slack attachment field, truncating long descriptions rune-safely.
- Update test fixtures, parser tests, and docs to cover/reflect the new
Bodyfield.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| server/events/webhooks/slack_client.go | Adds PR description field to Slack attachments with truncation logic. |
| server/events/webhooks/slack_client_internal_test.go | Adds tests for presence/absence and truncation behavior of the Slack description field. |
| server/events/models/models.go | Introduces PullRequest.Body and documents its intended population behavior. |
| server/events/event_parser.go | Populates Body across supported VCS pull/merge request parsers. |
| server/events/event_parser_test.go | Updates/extends parser tests (incl. Gitea) to assert Body is parsed. |
| server/events/vcs/github/testdata/fixtures.go | Adds GitHub PR body to fixtures for parser tests. |
| server/events/vcs/azuredevops/testdata/fixtures.go | Adds Azure DevOps PR description to fixtures for parser tests. |
| runatlantis.io/docs/sending-notifications-via-webhooks.md | Documents Body in webhook payload example. |
be941f7 to
ae4a8ca
Compare
demon
reviewed
Jun 12, 2026
lukemassa
reviewed
Jun 13, 2026
53b5735 to
217dac0
Compare
Signed-off-by: Rym Rabehi <rym.rabehi@datadome.co> Signed-off-by: Rui Chen <rui@chenrui.dev>
217dac0 to
641eb08
Compare
chenrui333
approved these changes
Jun 27, 2026
Member
|
Thanks @rym-dd for your first contribution! |
|
Oh cool, you went with my suggestion :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
This PR aims to add the pull request description to the apply notifications sent through webhooks:
Bodyfield tomodels.PullRequestto carry the pull request descriptionDescriptionfield, only when it's not empty, and rune-safe truncated to 1000 characters to stay within Slack's message size limitsBodyautomatically since the wholeApplyResultis marshalled, so the payload example in the docs is updated to matchwhy
tests
createAttachments: theDescriptionfield is omitted when the body is empty, included when it's set, and rune-safe truncated when the body exceeds the limitPullRequest.Bodymake testpasses in theghcr.io/runatlantis/testing-envcontainer,goimportsandgofmtare clean, andgolangci-lintreports no issues on the touched packagesbefore
after
references