[DX-5482] Further adjust Alertgate - #2855
Conversation
… the selected alert set, combinable with both `--alerts` and label selection. A name that does not resolve is an error, and excluding the whole selection exits `2`. - Rename `--no-fail-fast` to `--fail-fast`, on by default. Pass `--fail-fast=false` to wait for the full window and its coverage proof. - When alerts are selected by labels, print each matched rule on its own line before the planned run time, so it is clear what was actually selected. - Round an observation window with a subsecond part up to the next whole second (by extending `to`), so a plan never reads `window 9m59.99445781s`. - Drop the warning that `transitionGrace` exceeds a quarter of the window; it was noise, not an actionable condition.
|
👋 Tofel, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
📊 API Diff Results
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Log mode can block reading a forbidden stdin exclusion, and exclusion read errors identify the wrong flag.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Enhances Alertgate selection controls, fail-fast configuration, and observation-window reporting.
Changes:
- Adds
--exclude-alertsfor named and label-based selections. - Renames the fail-fast flag and prints label-selected rules.
- Rounds subsecond windows and removes transition-grace warnings.
| File | Description |
|---|---|
grafana-alertcheck/README.md |
Documents alert exclusions. |
internal/gate/watch.go |
Applies exclusions during watch setup. |
internal/gate/watch_test.go |
Tests watch selection behavior. |
internal/gate/schedule.go |
Rounds windows and simplifies summaries. |
internal/gate/schedule_test.go |
Tests timing summaries and rounding. |
internal/gate/labels.go |
Implements exclusions and selection output. |
internal/gate/labels_test.go |
Tests exclusion resolution and output. |
internal/gate/check.go |
Integrates exclusions and rounded windows. |
internal/gate/check_test.go |
Tests updated check behavior. |
docs/reference/cli.md |
Updates the CLI reference. |
docs/index.md |
Updates introductory usage guidance. |
docs/how-alerts-are-evaluated.md |
Documents timing and fail-fast changes. |
docs/architecture.md |
Updates fail-fast architecture notes. |
cmd/watch.go |
Adds watch exclusion parsing. |
cmd/watch_test.go |
Tests conflicting stdin sources. |
cmd/common.go |
Registers the exclusion flag. |
cmd/check.go |
Adds exclusion and fail-fast CLI handling. |
cmd/check_test.go |
Tests changed check flags. |
.changeset/v0.1.8.md |
Records release changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


Add
--exclude-alerts <file|->: an enumerated list subtracted from…the selected alert set, combinable with both--alertsand label selection. A name that does not resolve is an error, and excluding the whole selection exits2.Rename
--no-fail-fastto--fail-fast, on by default. Pass--fail-fast=falseto wait for the full window and its coverage proof.When alerts are selected by labels, print each matched rule on its own line before the planned run time, so it is clear what was actually selected.
Round an observation window with a subsecond part up to the next whole second (by extending
to), so a plan never readswindow 9m59.99445781s.Drop the warning that
transitionGraceexceeds a quarter of the window; it was noise, not an actionable condition.