-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Log the rule which is the cause of blocking #1460
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.
Thanks for the PR!
I think ideally we should bubble up the info a bit further so the logs are associated with the request, and that we can even potentially return it through extended errors, or a blocky HTTP API, which would allow the blocky CLI to let you know what the rule is without needing to check logs.
To do that I'd probably update ListCache.Match
to return a map[string]string
which would use the group names as keys, and the rule that caused the block as value. From there, the compiler should show you what else needs to be updated up the stack, and down the stack you'd need to bridge Match
and the code you've added in the caches.
That being said I think a debug like this is already a big UX improvement and can be merged if you don't want to take on extra work! No pressure either way!
In that case just fixing the lint errors is good, hopefully my suggestions do the trick :)
Co-authored-by: ThinkChaos <[email protected]>
e3f0ebc
to
8eff14f
Compare
Agree. I just was afraid of changing
Thanks for suggestions, I'll take it.
Let's do not close the issue, but merge this PR as is. I will try to propagate the info in separate PR a little bit later. |
Sure works for me! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1460 +/- ##
==========================================
+ Coverage 93.88% 94.22% +0.34%
==========================================
Files 78 78
Lines 6361 5007 -1354
==========================================
- Hits 5972 4718 -1254
+ Misses 300 198 -102
- Partials 89 91 +2 ☔ View full report in Codecov by Sentry. |
Part of #1458
Examples: