Skip to content

Commit 0fc3bee

Browse files
committed
feat: return host task from remove-host
Updates the remove host workflow to track its status with a host-scoped task. This task is also now returned from the remove-host API endpoint. PLAT-347
1 parent bdd4154 commit 0fc3bee

File tree

13 files changed

+276
-74
lines changed

13 files changed

+276
-74
lines changed

api/apiv1/design/host.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,12 @@ var ListHostsResponseExample = map[string]any{
253253
}
254254

255255
var RemoveHostResponse = g.Type("RemoveHostResponse", func() {
256+
g.Attribute("task", Task, func() {
257+
g.Description("The task that tracks the overall host removal operation.")
258+
})
256259
g.Attribute("update_database_tasks", g.ArrayOf(Task), func() {
257260
g.Description("The tasks that will update databases affected by the host removal.")
258261
})
259262

260-
g.Required("update_database_tasks")
263+
g.Required("task", "update_database_tasks")
261264
})

api/apiv1/gen/control_plane/service.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/apiv1/gen/http/control_plane/client/types.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/apiv1/gen/http/control_plane/server/types.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/apiv1/gen/http/openapi.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/apiv1/gen/http/openapi.yaml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/apiv1/gen/http/openapi3.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/apiv1/gen/http/openapi3.yaml

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Changed
2+
body: The `remove-host` API response now includes a `task` that tracks the progress of the entire remove host operation.
3+
time: 2026-01-14T16:34:06.805619-05:00

clustertest/cluster_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,15 @@ func (c *Cluster) Remove(t testing.TB, hostID string) {
101101
HostID: controlplane.Identifier(hostID),
102102
})
103103
require.NoError(t, err)
104-
require.NotNil(t, resp, "RemoveHost response should not be nil")
105-
require.NotNil(t, resp.UpdateDatabaseTasks, "UpdateDatabaseTasks should always be present (empty slice if no databases)")
104+
require.NotNil(t, resp)
105+
require.NotNil(t, resp.Task)
106+
require.NotNil(t, resp.UpdateDatabaseTasks)
107+
108+
_, err = c.client.WaitForHostTask(t.Context(), &controlplane.GetHostTaskPayload{
109+
HostID: controlplane.Identifier(hostID),
110+
TaskID: resp.Task.TaskID,
111+
})
112+
require.NoError(t, err)
106113

107114
delete(c.hosts, hostID)
108115
c.client = hostsClient(t, c.hosts)

0 commit comments

Comments
 (0)