Repository navigation
server: remove the Reconciler interface - #532
Conversation
Lets the server and CLI tests run a real TaskReconciler against a fake Substrate.
Replace fakeReconciler, fakeSubstrate and fakeMainReconciler with a TaskReconciler running against substratetest. Add TaskReconciler.Client, which the server will use to read actor state.
NewServer takes a *controller.TaskReconciler and reads actor state through its client. Options.Reconciler and Options.Substrate are gone, and ax-server now exits if it can't create the Substrate client. Fixes google#514.
janetkuo
left a comment
There was a problem hiding this comment.
LGTM. As I brought up in #514 (comment), now that Server holds *controller.TaskReconciler directly, CreateTask, SuspendTask, and ResumeTask don't need to funnel through a single Reconcile call by mutating task.Status.Phase in memory. We can split out explicit Suspend / Resume methods in a small follow-up PR. @yongruilin @mayawang happy to put up a quick PR if that sounds good.
ref: #514 (comment) |
|
This looks good to me. Feel free to follow up with a follow up PR to follow up from #514 (comment). |
* controller: replace Reconcile with Suspend and Resume The server calls Suspend or Resume instead of setting the task's phase for Reconcile to read. The reconciler no longer writes the phase; the server decides it. ReconcileDelete becomes Delete. Fixes #534. * docs: update AGENTS.md and the substrate skill Describe the explicit Suspend/Resume/Delete flow, and list substratetest, which the server and CLI tests have used since #532.
Fixes #514.
server.NewServernow takes the*controller.TaskReconcilerdirectly and reads actor state through its client, soax-serverwires a single value.server.Reconciler,Options.Reconciler,Options.Substrate, and the nil checks they required.ax-servernow exits if it can't create the Substrate client, instead of running without reconciliation.internal/substrate/substratetest, an in-memory Substrate control API. The server and CLI tests now drive a realTaskReconcileragainst it, replacingfakeReconciler,fakeSubstrateandfakeMainReconciler.Reviewing commit by commit is easiest:
TaskReconciler.Clientgetter.