taskflow: run extensions through one dispatcher and tell them which phase they run in
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 22/100
Hướng nghiên cứu
Start with the two call sites that run extensions, CompleteTaskStep and SaveDraft, and the stopOnError and go func() logic they each duplicate. The issue asks for an extensions.Invocation context value, an orchestrator.Dispatcher with WithDispatcher, and an internal fire that handles guard and notify phases. Work is already under way in open PR #397, so coordinate there before starting. Done means both existing phases behave as before and POST_RESUME goes through the dispatcher.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Current Limitation
The orchestrator runs extensions from two call sites, CompleteTaskStep and SaveDraft. Each call site deep-copies the record and payload itself, and each decides for itself whether the run blocks or is asynchronous, using a stopOnError bool and a hand-written go func(). Adding the lifecycle phases in #395 this way would copy that logic into every new call site.
It also leaves two gaps:
- An extension can't tell which phase it is running in, or recognise a repeat of an event it already handled.
POST_RESUMEalways runs in a bare goroutine. A host can't bound its concurrency, recover its panics, or run it inline in tests, which currently need aWaitGroupto wait for it.
Suggested Improvement
Route every extension run through one dispatcher, with no behaviour change for the two existing phases:
extensions.Invocation{Phase, IdempotencyKey}on the context passed toExecute, read withextensions.InvocationFrom(ctx). The key is<task id>/<step id>/<seq>/<phase>and names the run of the step, whatever seq the row has moved on to.TaskExtensionis unchanged.orchestrator.Dispatcher(with aDispatcherFuncadapter) runs notify phases, set withWithDispatcher. The default is one goroutine per dispatch, as today.- An internal
fire(phase, …)looks up the phase's policy. A guard (PRE_RESUME) runs inline and returns the first error. A notify (POST_RESUME) is handed to the dispatcher with a context that is never cancelled. Deep copies are made in one place.
Version
53b0bd3
Additional Context
This is PR 1 of the rollout in #395. Telling a draft save apart from a submission (#327) stays separate.
- Ngôn ngữ chính
- Go
- Star
- 6
- Fork
- 8
- Merge trung bình
- 21 giờ 36 phút
- Pull request đã merge (30 ngày)
- 42
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenNSW/core
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
payment: test fixtures hardcode real gateway names (govpay/lankapay) instead of generic placeholdersĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
nsw-sl cleanup Type/Improvement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
remote: let the host inject a logger, and log with one consistent policyCó thể đã có người làm @mushrafmim đã nhận 5 ngày trước. Đang mởType/Improvement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
☢️ Bug v3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/import-export area/projects concern/ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
go-vikunja/vikunja#4455 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Dependabot PRs no longer merge automaticallyCó thể đã có người làm @dwisiswant0 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
projectdiscovery/urlfinder#160 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
database
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
chnm/legal-modernism#450 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày