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

fix unintentionally return in validateRules #663

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Conversation

rmatsuoka
Copy link
Member

@rmatsuoka rmatsuoka commented Nov 22, 2024

validateRules have returned without checking all monitor rules.

validateRules have unintentionally returned without checking all monitor rules.
@@ -249,19 +249,19 @@ func isSameMonitor(a mackerel.Monitor, b mackerel.Monitor, flagNameUniquenessEna
return "", false
}

func validateRuleAnomalyDetectionScopes(v reflect.Value, label string) (bool, error) {
func validateRuleAnomalyDetectionScopes(v reflect.Value, label string) error {
Copy link
Member Author

@rmatsuoka rmatsuoka Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A boolean in returned values is not needed because we can know the validation result only by error checking.

@rmatsuoka rmatsuoka changed the title fix unintentionally return. fix unintentionally return in validateRules Nov 22, 2024
Copy link
Contributor

@yseto yseto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. seems good.

@rmatsuoka rmatsuoka merged commit d45e294 into master Nov 22, 2024
13 checks passed
@rmatsuoka rmatsuoka deleted the fix-validate-bug branch November 22, 2024 10:59
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

Successfully merging this pull request may close these issues.

2 participants