feat(seinodetask): wire sidecar-backed kinds (PR 3/5)#285
Merged
Conversation
Third slice of the SeiNodeTask MVP implementation. Wires the four
remaining MVP kinds — GovVote, GovSoftwareUpgrade, AwaitCondition,
AwaitNodesAtHeight — through the existing sidecarExecution machinery.
Zero sidecar-side changes; everything lives in the controller.
Scope discipline: prototype-first. Per the workstream conversation, we
deliberately avoid task-to-task output currying (the Argo-style pattern)
and keep tasks as independent units of work. Sidecar-derived structured
outputs (txHash, proposalId, observedValue, currentHeight) are NOT
extracted. The CRD's status.outputs typed fields stay on the schema —
forward-compatible — but are intentionally left unset for sidecar-backed
kinds. Downstream coordination in PR 4 will use chain queries (chain
as the coordination medium), not status carry-over.
Changes:
- internal/task/task.go: 2 new registry entries (gov-vote,
gov-software-upgrade) using the existing sidecarTask[T] generic
helper, fireAndForget=false so we wait for chain inclusion.
- internal/controller/nodetask/controller.go: extend taskParamsForKind
to dispatch the 4 new kinds. AwaitNodesAtHeight maps to
sidecar.AwaitConditionTask{Condition: height} rather than the
deployment-scoped controller-side task — keeps CR.status.task.id
identical to the sidecar task ID for observability, and avoids the
fan-out fixture for a fan-of-one. AwaitCondition is height-only at
the sidecar today; CRD CEL already gates the union to that case.
- internal/controller/nodetask/controller.go: bound sidecar HTTP calls
with explicit context.WithTimeout (30s for Execute / SubmitTask, 15s
for Status / GetTask). Closes the gap the network-specialist flagged:
the shared http.Client has no Timeout, so without an explicit ctx
deadline a wedged sidecar pod could pin a reconcile worker.
- internal/controller/nodetask/controller.go: populateOutputs is
unchanged for sidecar-backed kinds; only UpdateNodeImage still
populates status.outputs (it's a controller-side completion
attestation, not task-to-task currying).
- Tests: per-kind dispatcher coverage (round-trip JSON, field-name
parity with the sidecar TaskBuilder structs), an inline
fakeSidecarClient fixture, full R1/R2/R3 reconcile for GovVote with
the fake sidecar, sidecar-failure path, and a regression guard that
status.outputs.govVote stays nil on Complete.
|
You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace. To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third slice of the SeiNodeTask MVP implementation. Wires the four sidecar-backed kinds (GovVote, GovSoftwareUpgrade, AwaitCondition, AwaitNodesAtHeight) through the existing
sidecarExecution[T]machinery. Zero sidecar-side changes; everything lives in the controller.Workstream
Council workstream — System tier — for the SeiNodeTask MVP (design merged at #277):
--per-node-selector+--fanout-modefor runner-level fan-out + chain-side lookups for downstream coordination)Scope discipline (locked in conversation)
Prototype-first. We deliberately avoid task-to-task output currying (the Argo-style pattern) and keep tasks as independent units of work. Sidecar-derived structured outputs (
txHash,proposalId,observedValue,currentHeight) are NOT extracted in this PR. The CRD'sstatus.outputstyped fields stay on the schema — forward-compatible — but are intentionally left unset for sidecar-backed kinds. Downstream coordination in PR 4 will use chain queries (chain as the coordination medium), not status carry-over.This preserves the existing controller philosophy AND keeps us on Chaos Mesh without needing Argo's parameter passing. If the prototype proves valuable and we hit real limits, formalizing structured sidecar outputs becomes a follow-up issue.
Changes
internal/task/task.go: 2 new registry entries (gov-vote,gov-software-upgrade) using the existingsidecarTask[T]generic helper,fireAndForget=falseso we wait for chain inclusion.internal/controller/nodetask/controller.go::taskParamsForKind: extended to dispatch the 4 new kinds.AwaitNodesAtHeightmaps tosidecar.AwaitConditionTask{Condition: height}rather than the deployment-scoped controller-side task — keepsCR.status.task.ididentical to the sidecar task ID for observability, and avoids the fan-out fixture for a fan-of-one.AwaitConditionis height-only at the sidecar today; CRD CEL already gates the union to that case.internal/controller/nodetask/controller.go::driveTask: bound sidecar HTTP calls with explicitcontext.WithTimeout— 30s for Execute / SubmitTask, 15s for Status / GetTask. Closes the gap the network-specialist flagged: the sharedhttp.Clienthas no Timeout, so without an explicit ctx deadline a wedged sidecar pod could pin a reconcile worker.populateOutputsis unchanged for sidecar-backed kinds; onlyUpdateNodeImagestill populatesstatus.outputs(it's a controller-side completion attestation, not task-to-task currying).Cross-review (local, pre-push)
kubernetes-specialist + sei-network-specialist — parallel dispatch:
sidecarTask[T],fireAndForget=falsePOST /v0/tasksalready covered by controller SAAwaitNodesAtHeight→sidecar.AwaitConditionTask{height}status.outputsextraction for sidecar-backed kindspopulateOutputsswitch only handles UpdateNodeImagecontext.WithTimeout(30s Execute, 15s Status)POST /v0/taskscorrectly subject to TokenReview+SAR; bypass list matchesZero MISMATCH. Zero MISSING.
Network-specialist deferred items (for PR 5 cluster verification)
POST /v0/tasksfrom SeiNodeTaskReconciler.Decisions flagged for reviewers
AwaitNodesAtHeightmapped tosidecar.AwaitConditionTask{Condition: height}(not the deployment-scoped controller-side task). Trade-off: cleaner observability + symmetry vs. mild redundancy with future multi-node fan-out. Single-target CRD makes this the right call today.Memovalidation for pre-existingtaskID=tags is deferred to the sidecar's existingsign_and_broadcast.go:154rejection — no controller-layer CEL.fakeSidecarClientis inlined incontroller_test.go(not promoted to a sharedtasktestpackage). Revisit when a second controller needs it.Test plan
make buildpassesgo test ./internal/task/ ./internal/controller/nodetask/— both pass, all 13 reconciler tests + per-kind dispatcher coveragemake lintbaseline unchanged (141 pre-existing issues; zero new from this PR)inclusionPollTimeoutis 60s, butSubmitTaskreturns fast — our 30s is on the sync submit path, which is correct)AwaitNodesAtHeightrouting decision is the right one-way door🤖 Generated with Claude Code