updates (#1562-4): drive the orchestrator — poll ticker + maintenance-window scheduler #1566

Closed
opened 2026-09-17 15:23:45 +00:00 by matou-build-agent · 2 comments

Parent: #1562 — carrying contract: ADR 0248

Missing link 3: no production caller invokes Orchestrator.Poll/Rollout on a schedule — the only production route into rollout() is RetryByHand (internal/controlapi/updates.go, which deliberately omits Poll/Rollout "pending a human decision"). The window gate window.Contains (internal/update/rollout.go) exists but nothing drives it; ModeAuto never fires on its own.

Build. A poll ticker + maintenance-window scheduler in the control-plane composition (control-plane/cmd/control-plane/whole_composition.go): poll the channel, classify by kind, auto-apply in the window under ModeAuto, fire operator-approved queued releases at the window, honour the ADR 0067 two-attempt budget then quarantine.

Acceptance (seam, fake clock + source):

  • signed release newer than current, ModeAuto, inside the window → rolls out with no operator action, history records applied;
  • same release outside the window → nothing deploys until the window opens;
  • a feature release → waits for Approve, and an approved release fires at the next window.

Filed by agent under ADR 0174 (#1562 decomposition) — child of the fleet auto-update lane. Contract: ADR 0248. Veto anytime.

## Parent: #1562 — carrying contract: ADR 0248 **Missing link 3:** no production caller invokes `Orchestrator.Poll`/`Rollout` on a schedule — the only production route into `rollout()` is `RetryByHand` (`internal/controlapi/updates.go`, which deliberately omits `Poll`/`Rollout` "pending a human decision"). The window gate `window.Contains` (`internal/update/rollout.go`) exists but nothing drives it; `ModeAuto` never fires on its own. **Build.** A poll ticker + maintenance-window scheduler in the control-plane composition (`control-plane/cmd/control-plane/whole_composition.go`): poll the channel, classify by kind, auto-apply in the window under `ModeAuto`, fire operator-approved queued releases at the window, honour the ADR 0067 two-attempt budget then quarantine. **Acceptance (seam, fake clock + source):** - signed release newer than current, `ModeAuto`, inside the window → rolls out with no operator action, history records applied; - same release outside the window → nothing deploys until the window opens; - a feature release → waits for Approve, and an approved release fires at the next window. --- *Filed by agent under ADR 0174 (#1562 decomposition) — child of the fleet auto-update lane. Contract: ADR 0248. Veto anytime.*
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=26027
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=26027 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1566 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1566,
  "status": "success",
  "commits": [
    "ae79ee48758906a2d47eee40ff9abcc7a0f8ac4c"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/updates_scheduler.go",
    "control-plane/cmd/control-plane/updates_scheduler_test.go",
    "control-plane/cmd/control-plane/whole_composition.go"
  ],
  "tests": [
    {
      "command": "go test ./control-plane/cmd/control-plane/ -run TestUpdateScheduler -count=1",
      "exit_code": 0
    },
    {
      "command": "go test -race ./control-plane/cmd/control-plane/ -run TestUpdateScheduler -count=1",
      "exit_code": 0
    },
    {
      "command": "go test ./control-plane/cmd/control-plane/ ./internal/update/... ./internal/controlapi/ -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci gate on push (gofmt/build/vet/test/golangci-lint, main module + broker)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "signed release newer than current, ModeAuto, inside the window → rolls out with no operator action, history records applied": "TestUpdateScheduler_AutoAppliesInsideWindow (updates_scheduler_test.go): one scheduler.tick() inside the 02:00–04:00 window rolls out a KindSecurity release with no Approve; HistoryFor(\"sec-1\").Outcome == OutcomeApplied and State().Current.Revision == \"sec-1\". Driver: updates_scheduler.go tick() → up.Poll then up.Rollout over State().Automatic.",
    "same release outside the window → nothing deploys until the window opens": "TestUpdateScheduler_WaitsOutsideWindowThenApplies: a tick at 12:00 leaves current at \"old-rev\" with the release waiting in State().Automatic (Rollout returns WaitingForWindow, nothing deployed); advancing the fake clock into the window then applies it. The window gate is update/rollout.go window.Contains, driven by the scheduler.",
    "a feature release → waits for Approve, and an approved release fires at the next window": "TestUpdateScheduler_FeatureWaitsForApproveThenFiresAtWindow: a KindFeature release is classified Pending by Poll and never rolled out by the scheduler (State().Automatic/Queued empty); after up.Approve it queues; a tick out of window still waits; a tick once the window opens applies it (HistoryFor(\"feat-1\") == OutcomeApplied)."
  },
  "summary": "Added the control-plane poll ticker + maintenance-window scheduler (updateScheduler) that polls the pinned channel and drives every ready release through the orchestrator's window-gated Rollout, so ModeAuto and operator-approved releases fire on their own.",
  "reason": "ADR 0248 link 3 — the missing production caller for Orchestrator.Poll/Rollout; the scheduler owns only the WHEN, leaving the ADR 0017 classification, the window gate and the ADR 0067 budget/quarantine inside the orchestrator.",
  "blockers": []
}
**close-report** for #1566 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1566, "status": "success", "commits": [ "ae79ee48758906a2d47eee40ff9abcc7a0f8ac4c" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/updates_scheduler.go", "control-plane/cmd/control-plane/updates_scheduler_test.go", "control-plane/cmd/control-plane/whole_composition.go" ], "tests": [ { "command": "go test ./control-plane/cmd/control-plane/ -run TestUpdateScheduler -count=1", "exit_code": 0 }, { "command": "go test -race ./control-plane/cmd/control-plane/ -run TestUpdateScheduler -count=1", "exit_code": 0 }, { "command": "go test ./control-plane/cmd/control-plane/ ./internal/update/... ./internal/controlapi/ -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci gate on push (gofmt/build/vet/test/golangci-lint, main module + broker)", "exit_code": 0 } ], "criteria": { "signed release newer than current, ModeAuto, inside the window → rolls out with no operator action, history records applied": "TestUpdateScheduler_AutoAppliesInsideWindow (updates_scheduler_test.go): one scheduler.tick() inside the 02:00–04:00 window rolls out a KindSecurity release with no Approve; HistoryFor(\"sec-1\").Outcome == OutcomeApplied and State().Current.Revision == \"sec-1\". Driver: updates_scheduler.go tick() → up.Poll then up.Rollout over State().Automatic.", "same release outside the window → nothing deploys until the window opens": "TestUpdateScheduler_WaitsOutsideWindowThenApplies: a tick at 12:00 leaves current at \"old-rev\" with the release waiting in State().Automatic (Rollout returns WaitingForWindow, nothing deployed); advancing the fake clock into the window then applies it. The window gate is update/rollout.go window.Contains, driven by the scheduler.", "a feature release → waits for Approve, and an approved release fires at the next window": "TestUpdateScheduler_FeatureWaitsForApproveThenFiresAtWindow: a KindFeature release is classified Pending by Poll and never rolled out by the scheduler (State().Automatic/Queued empty); after up.Approve it queues; a tick out of window still waits; a tick once the window opens applies it (HistoryFor(\"feat-1\") == OutcomeApplied)." }, "summary": "Added the control-plane poll ticker + maintenance-window scheduler (updateScheduler) that polls the pinned channel and drives every ready release through the orchestrator's window-gated Rollout, so ModeAuto and operator-approved releases fire on their own.", "reason": "ADR 0248 link 3 — the missing production caller for Orchestrator.Poll/Rollout; the scheduler owns only the WHEN, leaving the ADR 0017 classification, the window gate and the ADR 0067 budget/quarantine inside the orchestrator.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1566
No description provided.