-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Slack to the list of filtered web crawlers #5285
Add Slack to the list of filtered web crawlers #5285
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.
Can we add a couple tests to cover these?
I'd say since these are so easy to test, it'd be worth just piling a few in here.
Again, if not, I'd be happy to take over from here.
src/sentry/filters/web_crawlers.py
Outdated
# Slack - see https://api.slack.com/robots | ||
r'Slack', | ||
# Twitter - see https://dev.twitter.com/cards/getting-started#crawling | ||
r'Twitterbot', |
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.
So it seems that this is already being covered by L30 above. No?
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.
Yup I think you're right! I'll get rid of that.
@mattrobenolt got it, I'll throw some tests in there this afternoon. |
@mattrobenolt I removed the Twitter filter and added unit tests. I figured I'd add tests for Twitter as well just to be sure. |
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.
Awesome! Thanks. 🍦
This adds Slack to the list of filtered web crawlers. Slack lists 3 different user agents for their crawlers and the
Slack
regex covers all 3 (https://api.slack.com/robots).Filtering Twitter's crawler was suggested in #5284, but this should already be filtered by the generic
bot[\/\s\)\;]
regex. I added tests for this just to ensure that it is actually filtered.Fixes #5284