-
Notifications
You must be signed in to change notification settings - Fork 812
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
Small fix for off-by-one rules limit enforcement #3616
Small fix for off-by-one rules limit enforcement #3616
Conversation
94dc9e7
to
a332bd5
Compare
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.
Thanks!
@mattmendick Could you fix the test |
Will you update the tests? |
Absolutely! Will work on this soon. Thanks for both of you taking a look! |
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, module test case and rebase on master
After a closer look I think I figured out the issue causing tests to fail. When |
pkg/ruler/api_test.go
Outdated
// define once so the requests build on each other so the number of rules can be tested | ||
router := mux.NewRouter() | ||
router.Path("/api/v1/rules/{namespace}").Methods("POST").HandlerFunc(a.CreateRuleGroup) | ||
|
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.
I don't understand this change. It's not run "once" - it's done again for each element in tc
.
And I can't see what practical difference moving it outside of Run()
makes.
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.
Right you are, definitely not going to work that way :)
@mattmendick do you think you will come back to this? |
I'd like to take another shot at this, many apologies for the length of time this has been taking, and I really appreciate all the guidance and help you all have been giving this! 🙏 |
Signed-off-by: Matt Mendick <[email protected]>
2da334e
to
987ca67
Compare
Based on #3615 (comment), rebased on top of master, and squashed to avoid DCO errors. |
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
What this PR does:
Fixes an off by one error where rules in a rule group were not able to be equal to the limit.
Which issue(s) this PR fixes:
#3615
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]