Skip to content

[BUGFIX] alertmanager: accept sortMode status in the AlertTable schema - #940

Merged
jgbernalp merged 1 commit into
perses:mainfrom
s3onghyun:fix/perses-am-sortmode-status
Nov 16, 2026
Merged

jgbernalp merged 1 commit into
perses:mainfrom
s3onghyun:fix/perses-am-sortmode-status

Conversation

@s3onghyun

Copy link
Copy Markdown
Contributor

Description

The AlertTable column editor offers a "Status (firing → resolved)" sort mode (ColumnSortMode in alert-table-model.ts includes 'status', and alert-table-sorting.ts handles case 'status'), but alert-table.cue only allowed "alphabetical" | "numeric" | "severity". A panel saved with this sort mode fails schema validation:

✗ sort-mode-status.json (model-valid): Expected valid data but validation failed: spec.columns.0.sortMode: 3 errors in empty disjunction

This PR:

  • adds "status" to the AlertTable sortMode schema;
  • adds the matching StatusSort constant to the Go SDK;
  • adds status to the sortMode list in docs/alertmanager/model.md, as noted in the [DOC] alertmanager: add plugin documentation #934 review;
  • adds alert-table/tests/valid/sort-mode-status.json and alert-table/tests/invalid/unknown-sort-mode.json.

The fixtures use the schemas/<schema>/tests/{valid,invalid} layout from #933, with file names that don't collide with it, so the two PRs merge in either order.

Tests: percli plugin test-schemas --plugin.path=alertmanager (percli v0.55.1) passes; with the old schema, the valid fixture fails with the error above. make test-schemas-plugins passes, and go vet passes on the SDK.

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.

The AlertTable editor offers a "Status (firing → resolved)" column sort mode and the
runtime sorts on it, but the CUE schema only allowed alphabetical, numeric and severity,
so a panel saved with this mode failed schema validation.

Add "status" to the schema, the Go SDK (StatusSort) and the model docs, with a valid
and an invalid schema test.

Signed-off-by: Joshua (OpenClaw) <s3onghyun@users.noreply.github.com>
@jgbernalp
jgbernalp added this pull request to the merge queue Nov 16, 2026
@jgbernalp

Copy link
Copy Markdown
Contributor

Thnx @s3onghyun !

Merged via the queue into perses:main with commit 04db2cc Nov 16, 2026
18 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.

2 participants