Skip to content

feat: support webhook payload passthrough and dynamic notification recipients#4667

Open
huanghongbo-hhb wants to merge 22 commits into
koderover:mainfrom
huanghongbo-hhb:feat/workflow-payload-pass-through-v2
Open

feat: support webhook payload passthrough and dynamic notification recipients#4667
huanghongbo-hhb wants to merge 22 commits into
koderover:mainfrom
huanghongbo-hhb:feat/workflow-payload-pass-through-v2

Conversation

@huanghongbo-hhb

@huanghongbo-hhb huanghongbo-hhb commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose unified webhook trigger vars for notifications: workflow.trigger.branch, target_branch, pr, commit_id, commit_sha, commit_message, committer, event
  • flatten webhook raw payload to payload.*
  • support dynamic_recipients for Mail / Feishu webhook / Feishu app / Feishu person / DingTalk / WeCom / MSTeams
  • preserve notification runtime templates in create / retry / manual execution
  • resolve current branch conflict with latest main

Verification

  • UAT verified {{.payload.user_id}}, {{.payload.user.email}}, {{.payload.commits.0.author.email}}
  • UAT verified workflow.trigger.* rendering in notification title/content
  • retry / manual execution keep runtime context and build outputs
  • latest main merged into feat/workflow-payload-pass-through-v2

This change is Reviewable

@PetrusZ

PetrusZ commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

改动涉及的范围太广了,上次也说过尽量以最小化的变动,来实现目标功能

WorkflowTaskCreatorUserID: c.workflowTask.TaskCreatorID,
WorkflowTaskCreatorMobile: c.workflowTask.TaskCreatorPhone,
WorkflowTaskCreatorEmail: c.workflowTask.TaskCreatorEmail,
WorkflowKeyVals: commonutil.BuildWorkflowRuntimeVariableKVs(c.workflowTask.WorkflowArgs, c.workflowTask.ProjectName, c.workflowTask.ProjectDisplayName, c.workflowTask.TaskID, c.workflowTask.TaskCreator, c.workflowTask.TaskCreatorAccount, c.workflowTask.TaskCreatorID, time.Unix(c.workflowTask.StartTime, 0)),

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.

这个是有什么作用?

MergeRequestID: mergeRequestID,
CommitID: commitID,
CommitSHA: commitID,
CommitMessage: *ev.PullRequest.Title,

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.

pr的title跟commit message有什么关系?

)
}

func RenderJobTaskWithGlobalVariables(task *commonmodels.JobTask, globalKeyMap map[string]string) error {

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.

这个替换全局变量跟通知任务有什么关系吗?

Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
@huanghongbo-hhb huanghongbo-hhb force-pushed the feat/workflow-payload-pass-through-v2 branch from e0451dd to e51cea0 Compare June 26, 2026 01:39
Signed-off-by: huanghongbo-hhb <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.

2 participants