Skip to content

Correct notification routing for DEPLOYMENT_STARTED#5523

Merged
t-kikuc merged 2 commits intopipe-cd:masterfrom
JohnTitor:fix/route-deployment-started
Jan 31, 2025
Merged

Correct notification routing for DEPLOYMENT_STARTED#5523
t-kikuc merged 2 commits intopipe-cd:masterfrom
JohnTitor:fix/route-deployment-started

Conversation

@JohnTitor
Copy link
Contributor

@JohnTitor JohnTitor commented Jan 31, 2025

What this PR does:

This fixes the issue the DEPLOYMENT_STARTED event notification is routed unconditionally.

Why we need it:

Without this, users would receive that event notification even if they don't want.

Which issue(s) this PR fixes:

None

Does this PR introduce a user-facing change?: Yes

  • How are users affected by this change: Users can control the notification correctly.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

@codecov
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 26.43%. Comparing base (6f4d443) to head (fd6ce23).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/model/notificationevent.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5523      +/-   ##
==========================================
- Coverage   26.43%   26.43%   -0.01%     
==========================================
  Files         464      464              
  Lines       49786    49790       +4     
==========================================
  Hits        13163    13163              
- Misses      35569    35573       +4     
  Partials     1054     1054              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>
@JohnTitor JohnTitor force-pushed the fix/route-deployment-started branch from fd6ce23 to 2296b0c Compare January 31, 2025 04:47
t-kikuc
t-kikuc previously approved these changes Jan 31, 2025
Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

LTGM LGreatTM
Thank you so much!!!!

Copy link
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!
I commented on missing test cases; please check them.

Comment on lines +151 to +158
{
Type: model.NotificationEventType_EVENT_DEPLOYMENT_STARTED,
Metadata: &model.NotificationEventDeploymentStarted{
Deployment: &model.Deployment{
ApplicationName: "canary",
},
},
}: true,
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a test case to return false?

Suggested change
{
Type: model.NotificationEventType_EVENT_DEPLOYMENT_STARTED,
Metadata: &model.NotificationEventDeploymentStarted{
Deployment: &model.Deployment{
ApplicationName: "canary",
},
},
}: true,
{
Type: model.NotificationEventType_EVENT_DEPLOYMENT_STARTED,
Metadata: &model.NotificationEventDeploymentStarted{
Deployment: &model.Deployment{
ApplicationName: "canary",
},
},
}: true,
{
Type: model.NotificationEventType_EVENT_DEPLOYMENT_STARTED,
Metadata: &model.NotificationEventDeploymentStarted{
Deployment: &model.Deployment{
ApplicationName: "bluegreen",
},
},
}: false,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, added in edfb792 (#5523).

auto-merge was automatically disabled January 31, 2025 05:21

Head branch was pushed to by a user without write access

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>
@JohnTitor JohnTitor force-pushed the fix/route-deployment-started branch from 1ebc304 to edfb792 Compare January 31, 2025 05:22
@t-kikuc t-kikuc enabled auto-merge (squash) January 31, 2025 05:23
Copy link
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

LGTM!
Thank you for a great contribution!

@t-kikuc t-kikuc merged commit 3021db1 into pipe-cd:master Jan 31, 2025
11 checks passed
@JohnTitor JohnTitor deleted the fix/route-deployment-started branch January 31, 2025 05:28
github-actions bot pushed a commit that referenced this pull request Feb 17, 2025
* Correct notification routing for `DEPLOYMENT_STARTED`

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>

* Harden test case

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>

---------

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
github-actions bot pushed a commit that referenced this pull request Feb 17, 2025
* Correct notification routing for `DEPLOYMENT_STARTED`

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>

* Harden test case

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>

---------

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
t-kikuc added a commit that referenced this pull request Feb 17, 2025
* Correct notification routing for `DEPLOYMENT_STARTED` (#5523)

* Correct notification routing for `DEPLOYMENT_STARTED`

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>

* Harden test case

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>

---------

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

* Sort results of plan-preview (#5540)

* Sort results of plan-preview

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>

* Ensure the order of list piped

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>

* fix: lint

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>

* fix: move sorting to pipectl

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>

* fix: add testcase

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>

* fix: dev docs

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>

* add docs

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>

---------

Signed-off-by: kj455 <kaji.ibuki45@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

* Enhanced EventWatcher logs (#5558)

* Show push error log earlier than reporting

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* Use WarnLog in retry

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* clarify log messages

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* clarify log messages

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* add TestDoCalls for asserting counts

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* add eventIDs in log

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* enrich logs in updateValues

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* nits

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* Revert "add TestDoCalls for asserting counts"

This reverts commit de3f112.

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

---------

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

* update RELEASE to v0.50.2 with doc update (#5571)

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

---------

Signed-off-by: Yuki Okushi <okushi@canary-inc.jp>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
Signed-off-by: kj455 <kaji.ibuki45@gmail.com>
Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Co-authored-by: Yuki Okushi <okushi@canary-inc.jp>
Co-authored-by: Ibuki Kaji <38521709+kj455@users.noreply.github.com>
Co-authored-by: Tetsuya KIKUCHI <97105818+t-kikuc@users.noreply.github.com>
@t-kikuc
Copy link
Member

t-kikuc commented Feb 26, 2025

@JohnTitor

Hi, we released your PR in v0.50.2 last week! Thank you so much!

https://github.com/pipe-cd/pipecd/releases/tag/v0.50.2

@github-actions github-actions bot mentioned this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants