-
Notifications
You must be signed in to change notification settings - Fork 344
[ENG-5862] SPAM - Fix Wiki Spamming #11171
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
base: feature/pbs-25-10
Are you sure you want to change the base?
[ENG-5862] SPAM - Fix Wiki Spamming #11171
Conversation
The issue described in the ticket is not entirely accurate. I found the domain "xawk1.com" on staging, and content containing this domain will not be banned even if the project is public (here is an example). And on the other side, if you repeat the steps from the ticket using some other domains, everything works as expected. However, the spam check will always be triggered because the
Probably changes made by |
…eck_resource_for_domains_postcommit
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.
@antkryt I'm a little confused exactly what this accomplishes, could you write some test cases to illustrate how you are changing the current behavior. I see that the tests are changed, but I don't see new test cases. A good test case here should show the spam content or spam domain of a wiki is checked when a project is made public.
@Johnetordoff I'm not sure that it's possible to write a test case to illustrate what I'm changing here, so I'll try to explain better. Both As you can see, tasks don't know anything about each other and changes that are made (it's two different parallel processes). So, if Also, I've changed signature of the As for checking spam during privacy change tests, we have bunch of those (see |
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.
Still not quite the behavior we are looking for, but correct techniques.
|
||
@mock.patch.object(settings, 'SPAM_SERVICES_ENABLED', True) | ||
@mock.patch('osf.external.spam.tasks._check_resource_for_domains') | ||
def test_check_resource_for_spam_postcommit_with_spammy_domains(self, mock_check_domains, project, user): |
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.
THe ticket instructions to reproduce the bug are:
- Create project
- Update wiki with spammy domain
- Make project public
These are the steps the tests should follow, you are testing behavior that is too specific we know checking for spam domans works, when a project is saved when public, but we need to check a project's wiki content too, not just it's desciption etc.
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.
Good new tests, thanks!
Purpose
verify if spammy domains are detected
Changes
QA Notes
You can test it with domain xakw1.com on staging3. Currently project won't be banned with this domain, regardless of whether it's public or not.
Documentation
Side Effects
Ticket
https://openscience.atlassian.net/browse/ENG-5862