Skip to content

fix(pipedv1): use correct event for deployment notification mentions - #7382

Open
Vishakha7-Kumari wants to merge 1 commit into
pipe-cd:masterfrom
Vishakha7-Kumari:fix-notification-mentions
Open

Vishakha7-Kumari wants to merge 1 commit into
pipe-cd:masterfrom
Vishakha7-Kumari:fix-notification-mentions

Conversation

@Vishakha7-Kumari

@Vishakha7-Kumari Vishakha7-Kumari commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Fixes Slack mention resolution for completed deployments in pipedv1.

In reportDeploymentCompleted, the succeeded and failed branches were resolving mention accounts/groups using EVENT_DEPLOYMENT_CANCELLED, even though the actual notification events are EVENT_DEPLOYMENT_SUCCEEDED and EVENT_DEPLOYMENT_FAILED.

Why

Because of this, mentions configured under deploymentNotification.mentions for DEPLOYMENT_SUCCEEDED and DEPLOYMENT_FAILED were being ignored, and the cancelled-event mentions were used instead.

The legacy piped implementation already handles this correctly (pkg/app/piped/controller/scheduler.go:736,751), so this brings pipedv1 in line with it.

Also adds a regression test covering succeeded, failed, and cancelled deployments.

Which issue(s) this PR fixes

Fixes #

Does this PR introduce a user-facing change?

  • How are users affected: Users will now get the mentions configured for deployment succeeded/failed events, instead of the cancelled-event mentions.
  • Is this a breaking change: No
  • How to migrate: N/A

The succeeded and failed branches of reportDeploymentCompleted resolved
the Slack mention accounts and groups using EVENT_DEPLOYMENT_CANCELLED,
while the notification itself was sent as EVENT_DEPLOYMENT_SUCCEEDED /
EVENT_DEPLOYMENT_FAILED. As a result, mentions configured for the
succeeded and failed events were silently ignored, and the mentions
configured for the cancelled event were used instead.

Pass the matching event to getApplicationNotificationMentions, mirroring
the legacy piped implementation, and add a regression test covering all
three completed statuses.

Signed-off-by: Vishakha7-Kumari <singhdaisy669@gmail.com>
Copilot AI lite review requested due to automatic review settings September 15, 2026 09:47
@Vishakha7-Kumari
Vishakha7-Kumari requested review from a team as code owners September 15, 2026 09:47
@netlify

netlify Bot commented Sep 15, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit fddf160
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6aa91444301218000826e4b1

@Vishakha7-Kumari Vishakha7-Kumari changed the title tmp test fix(pipedv1): use correct event for deployment notification mentions Sep 15, 2026

Copilot AI 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.

🟢 Approval recommended

No unresolved review comments remain, and regression coverage was added.

Pull request overview

Updates deployment notifications to use status-specific mention events, with regression coverage.

Changes:

  • Correct success and failure event lookups.
  • Add tests for success, failure, and cancellation mentions.
File summaries
File Summary
pkg/app/pipedv1/controller/scheduler.go Uses matching notification event types.
pkg/app/pipedv1/controller/scheduler_test.go Tests event-specific mention selection.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants