mirror of
https://github.com/certimate-go/certimate.git
synced 2026-04-26 05:05:56 +03:00
[PR #926] [MERGED] v0.4 workflow migrations #1079
Labels
No labels
announcement
backlog
bug
declined
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
invalid
pull-request
question
stale
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/certimate#1079
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/certimate-go/certimate/pull/926
Author: @fudiwei
Created: 8/14/2025
Status: ✅ Merged
Merged: 8/22/2025
Merged by: @fudiwei
Base:
next← Head:dev📝 Commits (10+)
f440103fix(ui): lost animation effect when the drawer closesc7b88cbfeat(ui): add onDocumentChange handler in WorkflowDesigner139746bfeat(ui): node outputs adapt to new workflow designer089aed2feat(ui): drop legacy workflow designer, and adapt to the new one79667c0feat(migration): workflow draft and content migrationsdd7aa78refactor: rename some fields6c6b3ddfeat(ui): search by id089d66drefactor: rename some fields50136ddfix(ui): node validation error1098dccfeat: workflow engine adapt to new designer📊 Changes
271 files changed (+5469 additions, -18551 deletions)
View changed files
📝
internal/applicant/applicant.go(+9 -8)📝
internal/certificate/service.go(+29 -31)➕
internal/certificate/service_deps.go(+19 -0)📝
internal/deployer/deployer.go(+4 -4)📝
internal/domain/certificate.go(+1 -2)📝
internal/domain/dtos/workflow.go(+6 -0)📝
internal/domain/workflow.go(+162 -132)📝
internal/domain/workflow_output.go(+13 -6)📝
internal/domain/workflow_run.go(+6 -6)📝
internal/notify/notifier.go(+4 -4)📝
internal/repository/access.go(+2 -2)📝
internal/repository/acme_account.go(+2 -2)📝
internal/repository/certificate.go(+4 -5)📝
internal/repository/workflow.go(+13 -11)📝
internal/repository/workflow_log.go(+2 -2)📝
internal/repository/workflow_output.go(+8 -59)📝
internal/repository/workflow_run.go(+43 -6)📝
internal/rest/handlers/certificate.go(+12 -9)📝
internal/rest/handlers/statistics.go(+4 -3)📝
internal/rest/handlers/workflow.go(+8 -6)...and 80 more files
📄 Description
该 PR 包含以下内容变更:
备注
关于新的工作流节点执行器
👀 展开查看
v0.3.x 中提供了
NodeProcessor这一抽象类型,但实现方式上有所欠缺,导致节点执行器本身还需要关注输入输出、日志记录等与执行自身无关的事情。新版实现中重新梳理了业务,并由此抽象出了
WorkflowEngine、NodeExecutor、NodeExecutionContext、NodeExecutionResult等接口,并配合 AOP(面向切面编程)的设计模式,使得节点执行器更专注于执行自身,将与之无关的逻辑放至上层调度器中实现。关于新的工作流任务调度器
👀 展开查看
v0.3.x 中的
WorkflowDispatcher+WorkflowInvoker实现过于复杂,导致了以下两点问题:WorkflowInvoker对节点执行逻辑侵入过深,出现了大量类似于 /internal/workflow/processor/processor.go#L39-L45、/internal/workflow/processor/processor.go#L69-L77 这样的分支条件判断,可读性较差,也不利于后续新的节点类型,尤其是分支节点。WorkflowDispatcher利用了较多的锁和管道结构,本意是想在内存中实现完整的工作流任务流转。但可读性较差,尤其是为了支持可取消的上下文而存在大量雷同但又不尽相同的 ctx.Err 判断代码。新版实现试图解决上述问题,同时不再试图将任务流转完全放至内存中进行,而是利用数据库本身已有的数据结构来完成。同时,对进程意外中断而导致的执行挂起也有了自动恢复能力(目前暂时的实现方式是将其全部标记为已取消)。
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.