-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add rule files support #10
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! We will reuse this config in PMM: https://github.com/percona/pmm-managed/blob/1a54a66408dd3573f0d1da5bb832c1a679cea931/services/management/ia/rules_service.go#L88-L105
- Rename test package - Use `yaml.v3` - Rename file - USe `Rule` instead of `RuleNode`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except the comment. 👍
It will be nice to have more tests, probably we can copy them from https://github.com/prometheus/prometheus/blob/main/pkg/rulefmt/rulefmt_test.go
But I can do it myself later.
Co-authored-by: Artem Gavrilov <charlieblackwood7@gmail.com>
func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error { | ||
var s string | ||
if err := unmarshal(&s); err != nil { | ||
return err | ||
} | ||
dur, err := ParseDuration(s) | ||
func (d *Duration) UnmarshalYAML(node *yaml.Node) error { | ||
dur, err := ParseDuration(node.Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, I was wrong! Sorry, but can you please revert this change and use yaml.v2
everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rollback to yaml.v2
, I was wrong regarding it. Also we updated CI in main
branch, so it makes sense to rebase this branch.
@loafoe ^
No description provided.