Skip to content

Add cancel button for active indexing jobs (CS-11135)#4836

Closed
lukemelia wants to merge 1 commit into
mainfrom
cs-11135-add-button-to-cancel-active-indexing-job-in-grafana
Closed

Add cancel button for active indexing jobs (CS-11135)#4836
lukemelia wants to merge 1 commit into
mainfrom
cs-11135-add-button-to-cancel-active-indexing-job-in-grafana

Conversation

@lukemelia
Copy link
Copy Markdown
Contributor

@lukemelia lukemelia commented May 14, 2026

Summary

  • Adds a per-row Cancel action on the Active Indexing panel (indexing.json) for currently-running indexing jobs.
  • The button POSTs to the existing _grafana-complete-job endpoint with the row's reservation_id; the handler (handle-remove-job.ts) already resolves it via findJobIdForReservationId and calls forceCancelJobById. No server-side change required.
  • Mirrors the existing Cancel running reservation pattern in job-queue.json's Running Jobs panel, so all the auth + confirmation plumbing matches what we ship today.

Linear: CS-11135

Test plan

  • Apply dashboards locally (packages/observability/scripts/apply.sh against a local Grafana) and confirm the Active Indexing panel renders a red Cancel cell instead of a hidden column.
  • Start an indexing job locally, click Cancel, confirm the prompt, and verify the row disappears and the job is marked rejected (result.status = 418) with finished_at set.
  • Verify no regression on the Running Jobs panel in job-queue.json.

🤖 Generated with Claude Code

Surface the reservation_id column on the Active Indexing panel as a
"Cancel" action, mirroring the Running Jobs pattern in job-queue.json.
The button POSTs to the existing _grafana-complete-job endpoint with the
reservation_id query param, which already calls forceCancelJobById.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Grafana preview

Preview deployed for 1 dashboard in the staging Grafana.
Cross-dashboard drill-throughs still point at the canonical staging dashboards.

Dashboards:

Preview is torn down automatically when this PR is closed or merged.

(Run: https://github.com/cardstack/boxel/actions/runs/25877458051)

@github-actions
Copy link
Copy Markdown
Contributor

Observability diff (vs staging)

Show diff
diff --git a/tmp/remote-canon.1hFnGi/dashboards/boxel-status/indexing.json b/tmp/committed-canon.OhDATU/dashboards/boxel-status/indexing.json
index 23fa4b3..a4a9e79 100644
--- a/tmp/remote-canon.1hFnGi/dashboards/boxel-status/indexing.json
+++ b/tmp/committed-canon.OhDATU/dashboards/boxel-status/indexing.json
@@ -69,6 +69,10 @@
           "uid": "cef5v5sl9k7i8f"
         },
         "description": "System-wide operator action: queue a full reindex across every realm. The button disables itself while a `full-reindex` orchestration job is already pending or running. Per-realm reindex moved to the Realms dashboard. Click POSTs with `Authorization: Bearer ${grafana_secret}` (substituted from SSM at apply time, CS-10929).",
+        "fieldConfig": {
+          "defaults": {},
+          "overrides": []
+        },
         "gridPos": {
           "h": 8,
           "w": 24,
@@ -714,8 +718,57 @@
               },
               "properties": [
                 {
-                  "id": "custom.hidden",
-                  "value": true
+                  "id": "actions",
+                  "value": [
+                    {
+                      "confirmation": "Cancel running indexing job (reservation ${__value.raw})? The worker will stop processing it.",
+                      "fetch": {
+                        "body": "",
+                        "headers": [
+                          [
+                            "Authorization",
+                            "Bearer ${grafana_secret}"
+                          ]
+                        ],
+                        "method": "POST",
+                        "queryParams": [
+                          [
+                            "reservation_id",
+                            "${__value.raw}"
+                          ]
+                        ],
+                        "url": "${realm_server}_grafana-complete-job"
+                      },
+                      "oneClick": false,
+                      "title": "Cancel reservation ${__value.raw}",
+                      "type": "fetch"
+                    }
+                  ]
+                },
+                {
+                  "id": "mappings",
+                  "value": [
+                    {
+                      "options": {
+                        "from": 0,
+                        "result": {
+                          "color": "red",
+                          "index": 0,
+                          "text": "Cancel"
+                        },
+                        "to": 9999999999999
+                      },
+                      "type": "range"
+                    }
+                  ]
+                },
+                {
+                  "id": "displayName",
+                  "value": "Action"
+                },
+                {
+                  "id": "custom.filterable",
+                  "value": false
                 }
               ]
             },

(Run: https://github.com/cardstack/boxel/actions/runs/25877458009)

@lukemelia lukemelia marked this pull request as draft May 14, 2026 18:25
@lukemelia lukemelia closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant