Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Grizzly expects 'name' instead of 'title' in AlertRuleGroup JSON definition #507

Open
1 of 5 tasks
sondrekip opened this issue Dec 18, 2024 · 0 comments
Open
1 of 5 tasks

Comments

@sondrekip
Copy link

version

11.0.x

language

  • Go
  • Java
  • PHP
  • Python
  • Typescript

Describe your bug

According to the RuleGroup definition, the RuleGroup object inclues a title field but no name field. However, Grizzly expects the intermediate JSON representation of an AlertRuleGroup to contain a name field. As a result, processing AlertRuleGroup resources with Grizzly will fail unless a name field is manually added to the exported JSON.

This will generate a rule group:

import { RuleGroupBuilder } from "@grafana/grafana-foundation-sdk/alerting";
let rulegroup = new RuleGroupBuilder('rulegroup')
console.log(JSON.stringify(rulegroup.build(), null, 2))

Processing it with npx tsx rulegroup.ts > rulegroup.json will produce

{
  "title": "rulegroup"
}

Exporting with grr export -k AlertRuleGroup rulegroup.json . will return
FATAL parse error in 'rulegroup.json': UID not specified.

On the other hand, the following JSON can be exported successfully:

{
  "name": "rulegroup"
}

What did you expect to happen?

A RuleGroup object defined according to specification should be exported using grizzly successfully and return AlertRuleGroup.rulegroup added.

@sondrekip sondrekip added the bug Something isn't working label Dec 18, 2024
@Duologic Duologic removed the bug Something isn't working label Feb 17, 2025
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

No branches or pull requests

2 participants