-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Dump the rule for ACL formula warnings #639
Dump the rule for ACL formula warnings #639
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.
As an incremental change, I think I'm ok with this.
Fundamentally logging rule failures like this isn't as helpful as it could be, ideally someone related to the document itself could be getting notified. In general a user won't have access to server logs, or know to ask someone to look at them.
Separately, the example error you gave, with ".includes", is also the one I've seen lead to errors. It seems innocuous, and a pain to have to write "X and Y in X" rather than just "Y in X". What if we decided to define "Y in null" and as "false" for access rules? We can, since access rules are not actually evaluated by python, and the error message is already different to the error you'd get in python.
@paulfitz Something like my latest commit? I don't know where I can write test for this piece of code. I may take a look tomorrow if you think it is worth. |
When an ACL formula fails to be run, a warning is printed. However, it is painful to know which formula is concerned by the warning.
309e882
to
9ae9bfd
Compare
Thank you! I added the tests. Also I took the liberty to made some changes to your tests, in order to split it into several smalls one, with the hope its fine like this. |
I also saw that if the RHS of
The ACL formula engine works as in Python, I guess that's fine. I added some tests to check this behavior: |
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.
Looking good, a few suggestions.
1a71774
to
c98ffc3
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 @fflorent! Test failures look unrelated - flaky tests that probably need some more careful wait conditions somewhere, but not your responsibility.
Great! Also thanks for your suggestion here, that will be much more convenient for cases when an array is expected but is nullish (like an empty cell). |
When an ACL formula fails to be run, a warning is printed. However, it is painful to know which formula is concerned by the warning.
It is especially painful when this error is printed in production logs.
This fix prints the formula in the warning.
Also (and that may be controversial), I print the whole stack trace instead of just the error message. This helps to understand which keywork is concerned by the error. But in the other hand, it may spam the logs. I would understand if you ask me to rollback this part.
The log how it used to be
The log as it will be if accepted