brand kit: apply deploys the gateway only — brand-consuming oneshots on other nodes stay stale (ADR 0007 're-applies everywhere') #1212

Closed
opened 2026-09-04 09:13:59 +00:00 by ben · 2 comments
Owner

What is broken

ApplyBrandKit deploys Nodes: []clan.NodeID{gateway} only (comment: theming artifacts are control-plane infrastructure on the gateway). But brand-consuming oneshots run ON THE NODE HOLDING THE SERVICE (nextcloud-brand, mattermost-brand, and every future svc: surface on a catalogue port — PortPlacement.Node is any machine). A post-founding kit change therefore re-themes only gateway-resident services; anything on a helper/ruled host keeps the stale brand until some UNRELATED deploy happens to touch that node. ADR 0007's contract is "changing it re-applies everywhere" — this is drift the operator cannot see or force.

Masked today because Nextcloud/Mattermost co-host on the gateway in every driven world.

What to build

The brand apply deploys every node that holds a brand-consuming surface (derivable from the placements the config repo already records), or the full fleet if that set is not cheaply derivable — ruled honestly, not guessed. The deploy set must be computed on the failure path too: a node that is offline at apply time must surface as not-yet-applied (P12 ops event or coverage row), never silently claimed.

Acceptance criteria

  • A kit change with a service placed on a non-gateway node re-runs that node's brand oneshot without any unrelated deploy.
  • A test proves the failure path: placement on node B + apply → node B's brand conf carries the new bytes and the oneshot unit is retriggered; the old gateway-only behaviour reds it.
  • Unreachable nodes at apply time are reported, not silently skipped.

Why it matters now

Hard blocker for the brand-reach arc (full surface registration): the catalogue ports are placed by PortPlacement.Node and may live anywhere on the fleet.

Blocked by

None — can start immediately.

## What is broken `ApplyBrandKit` deploys `Nodes: []clan.NodeID{gateway}` only (comment: theming artifacts are control-plane infrastructure on the gateway). But brand-consuming oneshots run ON THE NODE HOLDING THE SERVICE (`nextcloud-brand`, `mattermost-brand`, and every future `svc:` surface on a catalogue port — `PortPlacement.Node` is any machine). A post-founding kit change therefore re-themes only gateway-resident services; anything on a helper/ruled host keeps the stale brand until some UNRELATED deploy happens to touch that node. ADR 0007's contract is "changing it re-applies everywhere" — this is drift the operator cannot see or force. Masked today because Nextcloud/Mattermost co-host on the gateway in every driven world. ## What to build The brand apply deploys every node that holds a brand-consuming surface (derivable from the placements the config repo already records), or the full fleet if that set is not cheaply derivable — ruled honestly, not guessed. The deploy set must be computed on the failure path too: a node that is offline at apply time must surface as not-yet-applied (P12 ops event or coverage row), never silently claimed. ## Acceptance criteria - [ ] A kit change with a service placed on a non-gateway node re-runs that node's brand oneshot without any unrelated deploy. - [ ] A test proves the failure path: placement on node B + apply → node B's brand conf carries the new bytes and the oneshot unit is retriggered; the old gateway-only behaviour reds it. - [ ] Unreachable nodes at apply time are reported, not silently skipped. ## Why it matters now Hard blocker for the brand-reach arc (full surface registration): the catalogue ports are placed by `PortPlacement.Node` and may live anywhere on the fleet. ## Blocked by None — can start immediately.

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

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

close-report for #1212 — status success

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

envelope
{
  "issue": 1212,
  "status": "success",
  "commits": [
    "ed3e6c4f2a1e0cd2f523a0fbb8efcb83a31dcc8d",
    "15f494ec2781db932cd974ce9e623c51c9d0effb"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/crossorchestrator_integration_test.go",
    "control-plane/cmd/smoke-fleet/main.go",
    "dashboard/src/lib/api/generated.ts",
    "internal/clan/branddeploy.go",
    "internal/clan/branddeploy_test.go",
    "internal/controlapi/settings.go",
    "internal/vm/manager.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/ -run TestBrandDeployNodes -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./control-plane/cmd/control-plane/ -run TestCrossOrchestrator_BrandKit -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/ ./internal/controlapi/ ./control-plane/cmd/control-plane/ -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c bash -c 'go build ./... && go vet ./internal/clan/... ./internal/controlapi/... ./control-plane/cmd/control-plane/... ./control-plane/cmd/smoke-fleet/...'",
      "exit_code": 0
    },
    {
      "command": "pre-push gate (whole-tree go build+test+lint) on git push origin HEAD:refs/heads/main",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A kit change with a service placed on a non-gateway node re-runs that node's brand oneshot without any unrelated deploy": "clan.BrandDeployNodes (internal/clan/branddeploy.go) derives the deploy set from the config-repo inventory placements — gateway + every node holding a brand-consuming catalogue service (files/chat); ApplyBrandKit (compose.go) now deploys that whole set. Proven by TestCrossOrchestrator_BrandKitApplyReachesHelperPlacedService: files placed on node-b => the single apply Deploy scopes {gateway, node-b}, no unrelated deploy.",
    "A test proves the failure path: placement on node B + apply -> node B's brand conf carries the new bytes and the oneshot unit is retriggered; the old gateway-only behaviour reds it": "TestCrossOrchestrator_BrandKitApplyReachesHelperPlacedService asserts (1) node-b is in the deploy scope (the old Nodes:{gateway} scope reds this) and (2) the committed idss/brand/svc-nextcloud/nextcloud-theming.conf carries the new accent #2e7d32 — the path node-b's nextcloud-brand oneshot restart-triggers on, so deploying node-b retriggers it.",
    "Unreachable nodes at apply time are reported, not silently skipped": "ApplyBrandKit captures the DeployResult and copies res.Skipped into the coverage report's new Unreached[] (controlapi.BrandKitCoverageReport + openapi.yaml unreached + regenerated dashboard client). Proven by TestCrossOrchestrator_BrandKitApplyReportsUnreachableNodes: node-b non-evaluating at apply time => report.Unreached contains node-b, apply does not error (the old code discarded res -> reds)."
  },
  "summary": "The brand-kit apply now deploys every node holding a brand-consuming surface (derived from config-repo placements), reporting unreachable nodes as not-yet-applied, instead of the gateway alone.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1212 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1212, "status": "success", "commits": [ "ed3e6c4f2a1e0cd2f523a0fbb8efcb83a31dcc8d", "15f494ec2781db932cd974ce9e623c51c9d0effb" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/crossorchestrator_integration_test.go", "control-plane/cmd/smoke-fleet/main.go", "dashboard/src/lib/api/generated.ts", "internal/clan/branddeploy.go", "internal/clan/branddeploy_test.go", "internal/controlapi/settings.go", "internal/vm/manager.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/clan/ -run TestBrandDeployNodes -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./control-plane/cmd/control-plane/ -run TestCrossOrchestrator_BrandKit -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/clan/ ./internal/controlapi/ ./control-plane/cmd/control-plane/ -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci -c bash -c 'go build ./... && go vet ./internal/clan/... ./internal/controlapi/... ./control-plane/cmd/control-plane/... ./control-plane/cmd/smoke-fleet/...'", "exit_code": 0 }, { "command": "pre-push gate (whole-tree go build+test+lint) on git push origin HEAD:refs/heads/main", "exit_code": 0 } ], "criteria": { "A kit change with a service placed on a non-gateway node re-runs that node's brand oneshot without any unrelated deploy": "clan.BrandDeployNodes (internal/clan/branddeploy.go) derives the deploy set from the config-repo inventory placements — gateway + every node holding a brand-consuming catalogue service (files/chat); ApplyBrandKit (compose.go) now deploys that whole set. Proven by TestCrossOrchestrator_BrandKitApplyReachesHelperPlacedService: files placed on node-b => the single apply Deploy scopes {gateway, node-b}, no unrelated deploy.", "A test proves the failure path: placement on node B + apply -> node B's brand conf carries the new bytes and the oneshot unit is retriggered; the old gateway-only behaviour reds it": "TestCrossOrchestrator_BrandKitApplyReachesHelperPlacedService asserts (1) node-b is in the deploy scope (the old Nodes:{gateway} scope reds this) and (2) the committed idss/brand/svc-nextcloud/nextcloud-theming.conf carries the new accent #2e7d32 — the path node-b's nextcloud-brand oneshot restart-triggers on, so deploying node-b retriggers it.", "Unreachable nodes at apply time are reported, not silently skipped": "ApplyBrandKit captures the DeployResult and copies res.Skipped into the coverage report's new Unreached[] (controlapi.BrandKitCoverageReport + openapi.yaml unreached + regenerated dashboard client). Proven by TestCrossOrchestrator_BrandKitApplyReportsUnreachableNodes: node-b non-evaluating at apply time => report.Unreached contains node-b, apply does not error (the old code discarded res -> reds)." }, "summary": "The brand-kit apply now deploys every node holding a brand-consuming surface (derived from config-repo placements), reporting unreachable nodes as not-yet-applied, instead of the gateway alone.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1212
No description provided.