Skip to content

feat: add Decline (veto) notification — DeploymentDeclined event type 16 - #172

Merged
mayank-devtron merged 2 commits into
mainfrom
feat/deployment-approval-declined-notification
Sep 10, 2026
Merged

mayank-devtron merged 2 commits into
mainfrom
feat/deployment-approval-declined-notification

Conversation

@mayank-devtron

@mayank-devtron mayank-devtron commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds notifier support for the new DeploymentDeclined event (type 16) — the super-admin veto action in the deployment-approval flow. When a super-admin declines a pending approval request, the orchestrator emits event 16 and this lets the notifier render Slack / SES / SMTP notifications for it.

How

Mirrors the existing DeploymentCancelled (13) pattern exactly — Decline is the same shape as Cancel, just a different actor/wording:

  • types.ts — EVENT_TYPE.DeploymentDeclined = 16 and a ParseDeploymentDeclinedEvent interface (identical fields to ParseDeploymentCancelledEvent)
  • mustacheHelper.ts — a parse branch identical to the cancelled one; added to the parseEvent return union and to the CI/CD material-parsing exclusion guard
  • templates/{slack,ses,smtp}/CD/16.mustache — byte-identical to the cancelled 13.mustache templates except the wording (❌→🚫, Cancelled→Declined)
  • notificationService.ts — sendNotificationV2 now treats 16 as an approval-family event so it reads event.payload.providers (like 4/5/7/10/11/12). Without this, decline events fell through to the settings path, found no settings, and were dropped — the bug behind "notification not received".

Net diff is additive (+84/−4, 6 files); no existing event handling is changed. tsc passes clean.

Related

Part of the cross-repo deployment-approval Decline (veto) feature:

  • Backend: devtron-labs/devtron-enterprise#3390
  • Frontend: devtron-labs/devtron-fe-lib#1262

Test plan

  • Trigger a super-admin decline on a pending deployment-approval request
  • Confirm the SES/SMTP email reaches every eligible approver and the requester, rendering declined-by user, app/env/pipeline, image tag, and optional comment/tags
  • Slack is not wired for decline yet (no orchestrator fallback to the "Deployment approval" rule) — email only for now; see devtron-labs/devtron-enterprise#3390

🤖 Generated with Claude Code

Add event type 16 for deployment approval decline (veto by super-admin).
Follows the same pattern as DeploymentCancelled (event 13):
- New enum value and parsed event interface in types.ts
- Parsing branch in mustacheHelper.ts
- Slack/SES/SMTP Mustache templates (16.mustache)
- Excluded from CI/CD material parsing guard

Uses standard notification routing (not the approval-specific path),
matching the convention for cancelled events (13-15).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mayank-devtron
mayank-devtron force-pushed the feat/deployment-approval-declined-notification branch from c9fd24c to d56d10e Compare September 1, 2026 21:41
…path

sendNotificationV2 only read event.payload.providers for the approval/
approved event types, so declined events (16) fell through to the
settings path, found no settings, and were dropped. Add DeploymentDeclined
to that list so it uses the providers the orchestrator attaches (eligible
approvers + requester) and renders the event-16 templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mayank-devtron
mayank-devtron marked this pull request as ready for review September 7, 2026 03:57
@mayank-devtron
mayank-devtron merged commit c1fe733 into main Sep 10, 2026
5 checks passed
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.

3 participants