Skip to content

[WaitApproval] Notify events of Approved/WaitApproval in Piped side #5632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

t-kikuc
Copy link
Member

@t-kikuc t-kikuc commented Mar 6, 2025

What this PR does:

Instead of triggering the events exactly at start/end of the approval, trigger them at start/end of the stage.

  • WaitApproval Event: Trigger at the same timing as StageStarted
  • Approved Event: Trigger at the same timing as StageSucceeded
    • approver field will be passed from a plugin indirectly via metadataStore

Why we need it:

Instead of #5613, this PR does not add RPCs for simplicity of the interface.

Which issue(s) this PR fixes:

Part of #5367

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 19.67213% with 49 lines in your changes missing coverage. Please review.

Project coverage is 26.62%. Comparing base (424894c) to head (8d8e2d0).
Report is 82 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/pipedv1/controller/scheduler.go 0.00% 32 Missing ⚠️
pkg/app/pipedv1/trigger/deployment.go 0.00% 13 Missing ⚠️
pkg/app/pipedv1/controller/controller.go 0.00% 3 Missing ⚠️
pkg/app/pipedv1/controller/planner.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5632      +/-   ##
==========================================
+ Coverage   26.58%   26.62%   +0.04%     
==========================================
  Files         477      478       +1     
  Lines       50657    50818     +161     
==========================================
+ Hits        13465    13531      +66     
- Misses      36134    36221      +87     
- Partials     1058     1066       +8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

if err != nil {
s.logger.Error("failed to get the list of users", zap.Error(err))
}
approver, _ := s.metadataStore.StageGet(stage.Id, "pipecd.dev.Approver") // TODO: Make the key to be a const.
Copy link
Member Author

Choose a reason for hiding this comment

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

[help wanted]
How about not notifying if 'approver' is empty?
For the situation like the stage ended due to reasons other than approvals.

Copy link
Contributor

github-actions bot commented Apr 6, 2025

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 6, 2025
Copy link
Contributor

This PR was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.

@github-actions github-actions bot closed this Apr 13, 2025
@github-actions github-actions bot deleted the plugin/notifier/1_notify-in-piped branch April 13, 2025 00:46
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.

1 participant