Skip to content

CS-11141: Allow X-Grafana-Device-Id in realm-server CORS preflight#4835

Merged
lukemelia merged 1 commit into
mainfrom
cs-11141-error-trying-to-delete-a-job-from-grafana
May 14, 2026
Merged

CS-11141: Allow X-Grafana-Device-Id in realm-server CORS preflight#4835
lukemelia merged 1 commit into
mainfrom
cs-11141-error-trying-to-delete-a-job-from-grafana

Conversation

@lukemelia
Copy link
Copy Markdown
Contributor

Summary

  • Grafana auto-attaches X-Grafana-Device-Id to button-panel POSTs. Chrome was rejecting the preflight for _grafana-complete-job (and the other _grafana-* operator actions) because that header was not in Access-Control-Allow-Headers.
  • Added X-Grafana-Device-Id to the @koa/cors allowHeaders list in packages/realm-server/server.ts.

Fixes CS-11141.

Test plan

  • On staging, open Grafana → Job Queue dashboard, click the "complete job" action on a row, and confirm the request succeeds (no CORS error in DevTools network tab).
  • Spot-check that the other _grafana-* operator actions (reindex, full-reindex, add-credit, upsert-realm-user-permission) still work from their button panels.

🤖 Generated with Claude Code

Grafana auto-attaches this header to button-panel POSTs, so the
preflight for `_grafana-complete-job` (and the other `_grafana-*`
operator actions) was being blocked by Chrome.

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

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates realm-server CORS configuration so Grafana button-panel operator POSTs can pass Chrome preflight when Grafana attaches X-Grafana-Device-Id.

Changes:

  • Adds X-Grafana-Device-Id to the realm-server @koa/cors allowed request headers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/realm-server/server.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Host Test Results

    1 files      1 suites   3h 16m 44s ⏱️
2 658 tests 2 636 ✅ 15 💤 0 ❌ 7 🔥
5 354 runs  5 310 ✅ 30 💤 7 ❌ 7 🔥

Results for commit 754f730.

For more details on these errors, see this check.

Realm Server Test Results

    1 files      1 suites   11m 9s ⏱️
1 365 tests 1 365 ✅ 0 💤 0 ❌
1 444 runs  1 444 ✅ 0 💤 0 ❌

Results for commit 754f730.

@lukemelia lukemelia requested review from a team and habdelra May 14, 2026 21:30
@lukemelia lukemelia merged commit 623d331 into main May 14, 2026
97 of 99 checks passed
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.

3 participants