api: `spam detected` when owner is creating issues
Summary
When creating issues, there are some spam detection as not to spam a public project. The problem currently is, that if the project is set to public then this feature is activated even for the owner of the project.
So e.g. my situation was, that I needed to create 5.000 issues using the API, my project was public and I keep getting spam detected
.
After reading up a little on it, I see that it is to not spam public repos.
So I make the project private, and bam, no more spam detected
.
Steps to reproduce
- Create public project
- Create a API key using the owner account of the project
- Try to create issues which triggers the spam detection using the owner API key
- You get blocked
- Make the project private
- Try again
- Success, you can now create issues which otherwise would have been spam detection.
Example Project
E.g. this issue would case this bug: eyJhb/ptpw-offenders#5322
What is the current bug behavior?
Described above.
What is the expected correct behavior?
Check if user is a owner, member, collaborator etc. and allow it.
Relevant logs and/or screenshots
None.
Output of checks
This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Will check if I can find anything and make a MR.