Skip to content

[Backport release-1.6] fix(linstor): use severity warning in piraeus-datastore alerts - #4740

Open
europrinter (yankawai) wants to merge 3 commits into
cozystack:release-1.6from
yankawai:backport/piraeus-alert-severity-1.6
Open

europrinter (yankawai) wants to merge 3 commits into
cozystack:release-1.6from
yankawai:backport/piraeus-alert-severity-1.6

Conversation

@yankawai

@yankawai europrinter (yankawai) commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Backport of the LINSTOR severity fix and its alert-rule guard from #3799 to release-1.6, together with the guard's follow-up #4812. Seven piraeus-datastore rules use warn, which the default Alerta alarm model does not accept, and they now use warning. Alert names, expressions and thresholds stay unchanged.

Cherry-picked 3ade16a380c9d03b83ff28ea02af3b800fdd1b0f and bd2cc0a749531433a237a9c8a6e21a6f21dee200 with their authors and cherry-pick references. The KEDA severity commit from the same main PR is left out because the KEDA rule it fixes does not exist on release-1.6. The follow-up from #4812 is cherry-picked too. It makes the guard catch a quoted kind or a kind followed by a comment, and fail on a rule group it cannot see into once template actions are stripped.

Validation

  • All nine checks in hack/alert-severity-contract.bats pass with hack/cozytest.sh on this branch. The wider discovery finds the same 39 rule files as before and no rule group comes out empty.
  • Against release-1.6 at da98ddc08 without the fix, the same contract fails on exactly the seven warn rules corrected here.
  • Delivery through Alertmanager and Alerta was not exercised.

Screenshots

Not a UI change.

Downstream repositories

The file-level trigger map was checked against both changed files: a rule file under packages/system/piraeus-operator/alerts/ and a new test under hack/. No existing tool, make target, API schema, package, output resource or documented workflow is renamed or changed. No companion repository update is required.

Release note

fix(linstor): backport accepted warning severity for seven piraeus-datastore alerts to release-1.6, with a regression guard for first-party alert rules

…re alerts

Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 3ade16a)
Alerta refuses an alert whose severity is not in its alarm model, so a
rule with such a label is dropped every time it fires and the alert never
reaches anyone. Seven piraeus-datastore rules used warn and the keda
at-max rule used info, and nothing in the tree caught either.

The contract collects every PrometheusRule and VMRule document under
packages, in alerts files and in chart templates, and fails on any
alerting rule whose labels.severity is missing or not in the accepted
list. Helm actions are stripped before parsing, so a templated rule is
still checked, and a file that cannot be parsed fails the run instead of
being skipped. Values are compared as whole words.

none stays out of the list because the Alertmanager config routes it to
a blackhole receiver. Vendored charts under packages/**/charts/** are out
of scope because they are re-vendored rather than edited.

Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Assisted-by: LLM
(cherry picked from commit bd2cc0a)
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56213823-fe65-47e4-8d18-38982737ae6e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size/L This PR changes 100-499 lines, ignoring generated files area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/bug Categorizes issue or PR as related to a bug labels Oct 4, 2026
…rces

The guard found rule files by an exact `kind: PrometheusRule` or
`kind: VMRule` line, so a quoted kind or one followed by a comment took the
file out of the check. A rule group whose rules all come from template
actions is empty once those are stripped, so it passed with nothing
checked. Discovery now accepts those spellings, and a rule document without
groups, or a group without a visible alert or recording rule, fails the run
the way a file that cannot be parsed does.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit dc814f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant