Repository navigation
ci: Run the alert-rule tests on every change to an alert - #647
Merged
Merged
Conversation
No workflow, Taskfile target or Makefile target ran test/alerts/test-*.sh, so a change to an alert's labels or expression merged untested. task test:alerts runs every test under test/alerts/ and fails when any fails, after running all of them. The Test Alerts workflow runs it when a pull request or a push to main touches an alert, a test, the workflow or the Taskfile. promtool and yq are pinned and checksummed, so the result does not move with the runner image.
ecv
approved these changes
Nov 12, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
Both alert-rule tests now run in CI on any change to an alert, its test, the workflow or the Taskfile. A label or expression change can no longer merge with its test red.
- The task runs every
test/alerts/test-*.shand fails at the end, so one run names every failing rule. With no test files, the unmatched glob makesbashfail, so the task does not pass on an empty set. - promtool and yq are pinned and checked against their published SHA-256.
Follow-ups:
- The workflow is path-filtered, so it cannot be a required check as written. A required check stays pending on PRs it skips. If it should block merges, add an always-run job that reports success when nothing under the filter changed.
scotwells
approved these changes
Nov 12, 2026
2 tasks done
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.
Follow-up to #646, from its review. No workflow, Taskfile target or Makefile target runs
test/alerts/test-*.sh, so neithertest-shell-sessions.shnortest-reconcile-storm.shgates a PR. So a change to an alert's labels or expression can merge with its test red. This PR runs the tests in CI.Summary
task test:alertsruns everytest/alerts/test-*.sh. It runs all of them, then fails if one failed, so one run shows every failing rule. Both tests run, and a new test joins by its file name.maintouchesconfig/components/alerts/,test/alerts/, the workflow orTaskfile.yaml. It followsvalidate-dashboards.yaml: the same path filter, concurrency and setup-task step.Test plan
ubuntu:24.04container as the runner runs them, are green onmain: both tests pass.teamlabel changed: the test names the wrong service and team. A wrong promtool checksum: the install step fails.actionlintreports no problem.Merge danger
A two-way door: a revert removes the job. The PR adds a check and changes no rule, test or build.
Related to #646