-
Notifications
You must be signed in to change notification settings - Fork 2
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
Issue #26: Faulty reloading parsing #105
Conversation
… an unreadable configuration file
…cer into mdimjasevic/26-faulty-reloading-parsing
test/Fencer/Rules/Test.hs
Outdated
assertBool "unexpected definitions" | ||
(((==) `on` show) | ||
(sortOn domainDefinitionId <$> result) | ||
(Right $ sortOn domainDefinitionId definitions)) |
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.
It's a little hard to read these lines. I'd probably use do-notation, but even just
assertBool "unexpected definitions" $
((==) `on` show)
(sortOn domainDefinitionId <$> result)
(Right $ sortOn domainDefinitionId definitions)
is already more readable.
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.
That's a fair point! I addressed it with let
s in an upcoming commit.
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.
@effectfully: Any remaining issues to be addressed?
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 good.
This PR addresses the following question from issue #26 : What happens if at reloading, one rule (out of several) in one domain (out of several) can't be parsed?
Ratelimit keeps the original rules and this PR adds a test to Fencer to confirm it matches the behavior.
I have two remarks:
Fencer.Main.main
would have to be reimplemented. Given that there is no much benefit in such a server test, I added a rule reloading test only.mdimjasevic/26-cant-read-file
branch. Therefore, please review PR Issue #26: Support handling configuration files without read permissions #102 first.