provide a command for maintainers to request damspam to be integrated in their project
damspam
works best when triggered from a webhook. This gives regular maintainers the ability to block spammers, which is normally an admin privilege.
But adding the webhook to the project is currently an admin privilege, given that the secret needs to be known at creation time, and can not be retrieved through the API.
@whot and I are proposing the following:
-
damspam request-webhook
is a new command that:- requires a project maintainer - or above - token (so we know that the request comes from a legit person)
- files an issue with a specific format
spambot integration in {namespace}/{project}
in the title in the fdo-bots repo - assigns the issue to @spambot
-
damspam process-webhook-request
is a new command, triggered by hookiedookie in the fdo-bots repo which:- checks that the issue is coming from a maintainer or owner of the project:
- if not, it closes the issue with:
hi, I'm a simple bot and this request must be filed by someone who's at least maintainer in the given project. thank you, please come again" :)
- if not, it closes the issue with:
- creates the webhook in the target project (the
GITLAB_TOKEN
in fdo-bots has admin access so it can do that) - also edits the internal file that needs to be edited so that the webhook gets validated in hookiedookie
- pushes the updates to the fdo-bots repo
- checks that the issue is coming from a maintainer or owner of the project:
This will trigger an automatic reload of the hookiedookie/damspam integration in the fdo-bots repo, and the project is now monitored by damspam