Skip to content

feat: support stage executor notifications for manual execution pause#4650

Open
huanghongbo-hhb wants to merge 3 commits intokoderover:mainfrom
huanghongbo-hhb:feat/manual-exec-stage-notify-pause-gate-v2
Open

feat: support stage executor notifications for manual execution pause#4650
huanghongbo-hhb wants to merge 3 commits intokoderover:mainfrom
huanghongbo-hhb:feat/manual-exec-stage-notify-pause-gate-v2

Conversation

@huanghongbo-hhb
Copy link
Copy Markdown
Contributor

@huanghongbo-hhb huanghongbo-hhb commented Apr 24, 2026

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:

  • it depended on the legacy stage-level Feishu config
  • it could not express a dedicated stage executor recipient role in workflow notifications

As a result, wait for manual execution notifications 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 pause event triggered by a manual execution stage:

  • notifications are now selected from workflow notify_ctls
  • only enabled notifications with notify_type containing pause are processed
  • supported channels:
    • feishu_person
    • mail

The notification trigger still happens when the stage enters manual execution pause.

2. Add a new dynamic recipient role: stage executor

This change adds support for a new recipient role: stage executor.

Recipient resolution for manual execution pause notifications now supports:

  • workflow executor
  • stage executor
  • explicitly selected users

stage executor is resolved dynamically from the current stage ManualExecUsers.

If ManualExecUsers contains 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 pause notifications triggered by manual execution stages:

  • Feishu person notifications:
    • resolve recipients to Zadig users
    • resolve Zadig users to Feishu users by phone number
    • send the manual execution stage card
  • Mail notifications:
    • resolve recipients to concrete Zadig users
    • send dedicated manual execution stage mail content

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:

  • the stage pause event always enters the manual-exec notification flow once
  • actual send behavior is decided by workflow notify controls

This keeps the trigger timing unchanged while making the send logic consistent with workflow notification settings.

Implementation details

Main updates include:

  • add is_stage_executor to the Feishu person notification user model
  • add stage_executor user type for mail notification recipients
  • extend workflow notify input parsing to preserve:
    • workflow executor
    • stage executor
  • update manual execution stage notification sending logic to:
    • filter notify controls by pause
    • resolve recipients dynamically
    • support both Feishu person and mail

Verification

Verified locally:

  • manual execution stage pause still triggers notification at the expected timing
  • pause not selected: manual execution pause notification is not sent
  • pause selected: manual execution pause notification is sent
  • Feishu person notification works for:
    • workflow executor
    • stage executor
    • explicit users
  • mail notification works for:
    • workflow executor
    • stage executor
    • explicit users

Local 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/workflowcontroller

This change is Reviewable

Signed-off-by: huanghongbo <huanghongbo@koderover.com>
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
@huanghongbo-hhb huanghongbo-hhb changed the title fix: gate manual execution stage notification by pause notify type feat: support stage executor notifications for manual execution pause Apr 24, 2026
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
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