[FEATURE] Table: migrate Grafana absolute thresholds to cellSettings - #808
Merged
AntoineThebaud merged 1 commit intoSep 16, 2026
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Threshold migration loses field-override scope and mishandles base ranges for negative values.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds Grafana absolute-threshold migration to Perses Table conditional cell formatting.
Changes:
- Converts threshold steps into ordered
Rangecell settings. - Maps threshold colors to text or background colors.
- Adds an Uptime migration fixture.
File summaries
| File | Description |
|---|---|
table/schemas/migrate/migrate.cue |
Implements threshold conversion. |
table/schemas/migrate/tests/thresholds-color-text-absolute/input.json |
Provides Grafana input coverage. |
table/schemas/migrate/tests/thresholds-color-text-absolute/expected.json |
Defines expected Perses output. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
shahrokni
self-requested a review
September 11, 2026 11:11
colivi
force-pushed
the
feat/table-migrate-thresholds-color-text
branch
2 times, most recently
from
September 12, 2026 14:51
f3e0aba to
e340365
Compare
| const timeRange = getPrometheusTimeRange(context.timeRange); | ||
| const step = getRangeStep(timeRange, minStep, undefined, context.suggestedStepMs); // TODO: resolution | ||
|
|
||
| // `spec.instant` is a per-query override: `true` forces instant, `false` forces range. |
Contributor
There was a problem hiding this comment.
I guess these changes in the prometheus plugin are not relevant/related to this PR and should be removed?
Map fieldConfig.defaults.thresholds (absolute) to Range cellSettings when color.mode is thresholds and cellOptions is color-text (or color-background). Table migrate only — no prometheus plugin changes. Signed-off-by: colivi <charles.olivi@gmail.com>
colivi
force-pushed
the
feat/table-migrate-thresholds-color-text
branch
from
September 16, 2026 13:34
130653c to
47ffe58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add the necessary logic into the Table migration schema to remap the Grafana table "fieldConfig.defaults.thresholds" (absolute mode) into Perses "cellSettings" with "Range" conditions.
When
How
Test
Screenshots
N/A — migrate schema only (no UI change).
Checklist
following "catalog_entry" values: "FEATURE", "ENHANCEMENT", "BUGFIX", "BREAKINGCHANGE", "DOC","IGNORE".
UI Changes