Skip to content

feat: Add plan webhook support - #5978

Open
hjk1996 wants to merge 6 commits into
runatlantis:mainfrom
hjk1996:add-plan-webhook-support
Open

feat: Add plan webhook support#5978
hjk1996 wants to merge 6 commits into
runatlantis:mainfrom
hjk1996:add-plan-webhook-support

Conversation

@hjk1996

@hjk1996 hjk1996 commented Nov 22, 2025

Copy link
Copy Markdown

what

  • Added event-aware webhook wiring to support both plan and apply (typed Event + ConfiguredSender, event set on payload, filtered dispatch).
  • Updated project runner to send plan/apply webhooks with the correct event and adjusted Slack attachment text to use the event name.
  • Extended webhook tests to cover plan configs and event filtering.

why

To deliver plan results through the webhook pipeline, and to make webhook payloads/messages clearly identify which event triggered them.

tests

  • Added webhook tests for plan config and event filtering
  • Ran locally: go test ./server/events/webhooks (passes)

references

@dosubot dosubot Bot added feature New functionality/enhancement go Pull requests that update Go code labels Nov 22, 2025
Signed-off-by: hjk1996 <dunhill741@naver.com>
@hjk1996
hjk1996 force-pushed the add-plan-webhook-support branch from 6b9da0f to 4a49034 Compare November 22, 2025 09:43
Comment thread server/events/project_command_runner.go

if err != nil {
return "", "", fmt.Errorf("%s\n%s", err, strings.Join(outputs, "\n"))
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might be worth capturing any error that occurs here and emitting an error log.

Suggested change
webhookSendErr := p.Webhooks.Send(ctx.Log, webhooks.EventResult{ Event: webhooks.ApplyEvent,
Workspace: ctx.Workspace,
User: ctx.User,
Repo: ctx.Pull.BaseRepo,
Pull: ctx.Pull,
Success: err == nil,
Directory: ctx.RepoRelDir,
ProjectName: ctx.ProjectName,
})
if webhookSendErr != nil {
ctx.Log.Err("error sending apply webhook; %v", webhookSendErr)
}
if err != nil {
return "", "", fmt.Errorf("%s\n%s", err, strings.Join(outputs, "\n"))
}

@abborg abborg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Webhook send failures could be emitted as logs, but as it's not currently done for the apply webhook, I don't see it as a blocker for this change.

@chrisjaimon2012

Copy link
Copy Markdown

Would be nice to have this feature merged at the soonest
Should documentation updates be included as well? runatlantis.io/docs/sending-notifications-via-webhooks.md

@dennislapchenko

Copy link
Copy Markdown

Really looking for this feature.
This will allow merging MRs without actual module changes.

@shblue21

Copy link
Copy Markdown
Contributor

This is a necessary feature. Our organization really needs notifications for Atlantis plans as well.

@monali45

Copy link
Copy Markdown

This is one of the feature our org is looking for, are there any plans to merge this in next release ?

@github-actions github-actions Bot added the docs Documentation label Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation feature New functionality/enhancement go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants