feat: support stage executor notifications for manual execution pause#4650
Open
huanghongbo-hhb wants to merge 3 commits intokoderover:mainfrom
Open
feat: support stage executor notifications for manual execution pause#4650huanghongbo-hhb wants to merge 3 commits intokoderover:mainfrom
huanghongbo-hhb wants to merge 3 commits intokoderover:mainfrom
Conversation
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
When a workflow stage is configured as manual execution, Zadig pauses the workflow before entering that stage.
Previously, the manual-execution-stage notification logic had two limitations:
stage executorrecipient role in workflow notificationsAs a result,
wait for manual executionnotifications could not be configured consistently through workflow notification settings, especially for Feishu person notifications and mail notifications.What changed
1. Use workflow notify controls for manual execution pause notifications
For the
pauseevent triggered by a manual execution stage:notify_ctlsnotify_typecontainingpauseare processedfeishu_personmailThe notification trigger still happens when the stage enters manual execution pause.
2. Add a new dynamic recipient role:
stage executorThis change adds support for a new recipient role:
stage executor.Recipient resolution for manual execution pause notifications now supports:
stage executoris resolved dynamically from the current stageManualExecUsers.If
ManualExecUserscontains the workflow executor role, it will also be expanded at runtime.Final recipients are deduplicated before sending.
3. Support both Feishu person and mail for manual execution pause notifications
For
pausenotifications triggered by manual execution stages:4. Remove dependency on legacy stage-level Feishu config as the send gate
Entering manual execution pause no longer depends on the old stage-level Feishu notification config to decide whether to trigger notification sending.
Instead:
This keeps the trigger timing unchanged while making the send logic consistent with workflow notification settings.
Implementation details
Main updates include:
is_stage_executorto the Feishu person notification user modelstage_executoruser type for mail notification recipientspauseVerification
Verified locally:
pausenot selected: manual execution pause notification is not sentpauseselected: manual execution pause notification is sentLocal validation:
go test -vet=off ./pkg/microservice/aslan/core/workflow/service/workflow ./pkg/microservice/aslan/core/common/service/instantmessage ./pkg/microservice/aslan/core/common/service/workflowcontrollerThis change is