Skip to content

feat!: workflow store found by scope, remove deprecated APIs (contract v0.8.0) - #187

Merged
fahimfaisaal merged 5 commits into
mainfrom
feat/workflow-store-split
Nov 9, 2026
Merged

fahimfaisaal merged 5 commits into
mainfrom
feat/workflow-store-split

Conversation

@fahimfaisaal

Copy link
Copy Markdown
Member

Summary

Workflow store becomes its own object, found by scope. Queue knows only its scope. Deprecated APIs removed. Stacked on #185.

store := redisq.NewWorkflowStore(qs) ──registers by ScopeID──► contract registry
w.WithQueue(q)                         q: ScopeID() + QueueID() only
task taken  ─► contract.LookupWorkflowStore(scope) ─► store.Runnable / DepResult
task ends   ─► store.FinishTask(queueID, ackID, end)
GET /workflows ─► registered stores + in-memory stores
 // contract v0.8.0
-type WorkflowAcknowledgeable interface { Scoped; WorkflowStore() WorkflowStore; FinishTask(ackID, e) }
 type WorkflowStore interface {
     ...
+    FinishTask(queueID, ackID string, e TaskEnd) (pushed []string, ok bool)
 }
+func RegisterWorkflowStore(s) error   // ErrScopeRegistered, ErrInvalidStore
+func UnregisterWorkflowStore(s); func LookupWorkflowStore(scope) (WorkflowStore, bool); func WorkflowStores() []WorkflowStore
  • Durable task with no registered store: not run, not acked (redelivered), error on Errs()/handler once per scope per minute.
  • Plain jobs and in-memory tasks unchanged.
  • wf: job-ID prefix reserved for workflow tasks: plain Add with such an ID returns false.
  • Removed: WithPersistentQueue, WithPersistentPriorityQueue, WithDistributedQueue, WithDistributedPriorityQueue, NewDistributedQueue, NewDistributedPriorityQueue, their handle types, IExternalBaseQueue.NumPending.
  • Spec redis-storage.md 1.8.0 (FinishTask is a store operation, §9 entry); openapi 1.5.1 (text only).
  • Commits: 5f08515 contract, 03b90a7 removals, d36769b store by scope, b8a17ac review fixes.

Evidence

  • go build ./..., go vet ./..., go test -race ./..., cd contract && go test ./...: pass. All example modules vet.
  • New tests (appended): store lookup by scope runs + finishes a durable task with right queue/ack ID; no store → not run, not acked, error, runs after registration (single-pop and batch paths, cancel while waiting); /workflows lists registered store; registry errors; reserved wf: IDs; WithQueueCapacity on a durable handle.
  • Cross-repo integration with the redisq and sqliteq branches (built with local replaces):
    • sqliteq, folder + single-file: workflow with undo ends compensated.
    • redisq, separate processes: worker without store refuses the task; worker with store completes it; OpenWorkflow finds it.
  • Reviewed: per-repo code review, cross-repo contract review, security check; findings fixed in b8a17ac.

Merge Danger

Door: one-way once tagged (contract v0.8.0, varmq v1.11.0 remove API); two-way until then.

Blast Radius: breaking

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@fahimfaisaal
fahimfaisaal added this pull request to stack #188 November 9, 2026 16:16
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.48485% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
workflow_finish.go 94.44% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Base automatically changed from docs/repo-sync to main November 9, 2026 16:47
WorkflowAcknowledgeable removed: a queue names only its scope (Scoped).
WorkflowStore gains FinishTask(queueID, ackID, end). Process registry
(Register/Unregister/LookupWorkflowStore, WorkflowStores,
ErrScopeRegistered) lets adapters register stores without importing varmq.
Root varmq does not build until the core follows.
Drop WithPersistent*/WithDistributed* binders, NewDistributed*, the
Persistent/Distributed queue handles and IExternalBaseQueue.NumPending.
Examples and tests use WithQueue / NewQueue.
Durable tasks look their store up in the contract registry by the queue's
scope and finish through store.FinishTask(queueID, ackID, end). A task with
no registered store is not run and not acked; the worker reports the error.
/workflows lists registered stores plus in-memory ones. Requires contract
v0.8.0. Spec 1.8.0, changelog.
Reserve the wf: job ID prefix for workflow tasks, rate-limit the missing
store error, treat storage with no Queue ID as storeless, refuse nil or
unscoped stores in the registry, fix openapi 1.5.1 and spec 1.8.0 wording.
@fahimfaisaal
fahimfaisaal force-pushed the feat/workflow-store-split branch from 1a8cb7e to 9ba8fc1 Compare November 9, 2026 16:47
@fahimfaisaal
fahimfaisaal merged commit c75ed52 into main Nov 9, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant