coala/corobo

spam plugin should implement check_configuration

jayvdb opened this issue · 10 comments

MAX_LINES = 1 is invalid, as it will mean anyone writing one line is spamming, which is silly.

MAX_MSG_LEN <= length of BOT_PREFIX is invalid, as means invoking a command is spamming, which is silly.

@jayvdb Can I be assigned this issue?

Sure. i've sent you an invite to join @coala.

@jayvdb I am a college fresher right now and I am just getting familiar with python and git. I understand some of the issue but not all of it. Could you please explain it in more detail?

Ping @nvzard for help , here or on gitter room for coboro

Guide at http://errbot.io/en/latest/user_guide/plugin_development/configuration.html

The existing config (https://github.com/coala/corobo/blob/master/plugins/spam.py#L13)

is

    CONFIG_TEMPLATE = {
        'MAX_MSG_LEN': constants.MAX_MSG_LEN,
        'MAX_LINES': constants.MAX_LINES
    }

And those constants are at https://github.com/coala/corobo/blob/master/plugins/constants.py

so effectively the config default is

    CONFIG_TEMPLATE = {
        'MAX_MSG_LEN': 1000,
        'MAX_LINES': 20,
    }

The first config validation we need is to ensure that the user never sets MAX_LINES to 1 or 0 , as that causes the bot to go into meltdown.

Just try to validate that one to begin with. Then you can try validating MAX_MSG_LEN.

@jayvdb I am not sure where exactly am I supposed to write the validation.

You add it to spam.py's check_configuration.

First you need to install and run corobo.
If you cant do that, you may want to find another issue to work on.

Errbot isn't being detected on my system. And running corobo by the docker image shows something like this: https://pastebin.com/kLDFqJn3

@CodeSparkle
To setup corobo, just create a virtualenv and install all the deps in requirements.txt and test-requirements.txt. Then you'll be good to go.

While installing the dependencies, I encountered this error.
screenshot from 2018-09-03 08-09-41
I haven't been able to find my way around it.