## What this PR does
follow-up to #3799, which added `hack/alert-severity-contract.bats`.
the guard had two blind spots. it found rule files by an exact `kind:
PrometheusRule` or `kind: VMRule` line, so a quoted kind or one followed
by a comment took the whole file out of the check. and a rule group
whose rules all come from template actions, for example an `include` of
a helper, is empty once those actions are stripped, so it passed with
nothing checked.
discovery now also matches a quoted kind and a kind followed by a
comment. a rule document without groups, or a group with no alert or
recording rule left after stripping, now fails the run and names the
file and the group, the same way a file that cannot be parsed already
does. a group of recording rules alone still passes.
on the current tree nothing changes. the wider discovery finds the same
43 files, no group comes out empty, and the guard stays green. three new
cases cover a quoted kind and a commented kind with a bad severity, a
group filled only by an `include`, and a group of recording rules.
against the old guard the first two fail and the third passes. dropping
the recording clause from the new check turns the recording case red,
and the tree check with it, since the tree has recording-only groups.
the suite passes under bats 1.14 with `set -u`, and the strict setup
audit stays clean.
### Screenshots
not a ui change.
### Downstream repositories
walked the trigger map against the diff. it touches only
`hack/alert-severity-contract.bats`, a unit test that no other
repository restates. no entry matches.
- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:
### Release note
```release-note
test(monitoring): the alert severity check now also catches rule files with a quoted or commented kind, and fails on a rule group it cannot see into instead of passing it unchecked
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Alert-rule source discovery now recognizes quoted rule kinds and kinds
followed by YAML comments.
* The alert severity contract now reports and rejects documents with no
groups and groups with no alert or recording rules after template
actions are removed.
* Recording-rule-only groups continue to pass the contract.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->