-
-
Notifications
You must be signed in to change notification settings - Fork 127
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 new infraction filters for the infraction rescheduler #510
Add new infraction filters for the infraction rescheduler #510
Conversation
As this is used in the new bot infraction rescheduler
Ok. I'll add tests for those validation failures. |
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.
From an initial glance, should we have to worry about both the type
and types
parameters being used together?
I'm not sure, but I don't think so. At the moment, I'm 99% sure doing so behaves mostly as someone would expect. If you specify both We could add an error condition for mixing of parameters like that, but if we do, we might want to do so for the |
I would personally prefer strict parameter validation, although I'm not sure about others. It would go something like:
|
… invalid If the before time is after the after time, or if both `type` and `types` are specified
e651d96
to
b9f2589
Compare
The check was backwards, enforcing that no results must ever be returned Relevant tests have been added that actually fetch an infraction with the right times so that I'm sure it's not still broken
…ters Expires and permanent=false are permitted and tested for. Expires_before also filters the database for permanent=false explicitly
Since Otherwise, |
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.
Looks/tests good to me! Any issues I've missed should surface when we implement the bot side of things.
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.
Tested and all looks good to me!
Backwards compatible too, so can be merged before the bot PR
Add
permanent
,types
,expires_before
, andexpires_before
as filter options for thebot/infractions
endpoint. This let's us filter for only in-flight infractions to expire, and also lets us put limits on how far in the future we reschedule infractions if we desire to.