-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Example about aggregate rules seems not to work correctly #1259
Comments
Please tell me why custom rule |
Hi there! And thanks for an excellent bug report 👍 I've cloned your repo and it does seem like there's an issue with custom aggregate rules. I'll report back as soon as I've found out what it could be. |
While custom aggregate rules would largely work before, those that report on the absence of data (like a rule named "allow") did not work. This as the aggregator sent nothing back in those caes — and contrary to the built-in rules, Regal had then no way of knowing in the next step that the aggregate report rules should be called even with no data. I'm not super happy about the way we communicate this back to the Go side, but there's a lot I'm not happy about with regards to how aggregate data is shuffled back and forth. Some effort to fix that will however have to wait until later. Fixes #1259 Signed-off-by: Anders Eknert <anders@styra.com>
That was more involved than I imagined. The issue turned out to be isolated to rules where no aggregated data was the actual violation, like in the example. Rules that actually did aggregate something first would however work as expected. I have a fix up now, and will push a patch release when that's been approved and merged. |
Just pushed v0.29.1 to address this. Let me know if you encounter any issues! |
Thank you so much! |
) While custom aggregate rules would largely work before, those that report on the absence of data (like a rule named "allow") did not work. This as the aggregator sent nothing back in those caes — and contrary to the built-in rules, Regal had then no way of knowing in the next step that the aggregate report rules should be called even with no data. I'm not super happy about the way we communicate this back to the Go side, but there's a lot I'm not happy about with regards to how aggregate data is shuffled back and forth. Some effort to fix that will however have to wait until later. Fixes StyraInc#1259 Signed-off-by: Anders Eknert <anders@styra.com>
Summary
Example about aggregate rules on https://docs.styra.com/regal/custom-rules#aggregate-rules seems not to work correctly.
Description
What happened?
I created a new repository https://github.com/shibataka000/regal-example and copied following custom rules on https://docs.styra.com/regal/custom-rules .
acme-corp-package
at-least-one-allow
AFAIK, custom rule
at-least-one-allow
reports error if there is no rule whose name isallow
and whose default value isfalse
.I ran following command.
regal lint .
Regal reports no error although there is no rule whose name is
allow
and whose default value isfalse
.What I expected to happen?
I expected that regal reports error about custom rule
at-least-one-allow
because there is no rule whose name isallow
and whose default value isfalse
.How to reproduce the issue
Version
The text was updated successfully, but these errors were encountered: