Skip to content
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

ENABLED_PLUGINS is misleading. It should be an entry_point whitelist instead. #136

Closed
nrb opened this issue Jan 27, 2015 · 6 comments
Closed
Milestone

Comments

@nrb
Copy link
Contributor

nrb commented Jan 27, 2015

I have the following plugins enabled:

ENABLED_PLUGINS = [
        'manager',
        'help',
        'meant_to_say',
        'operator',
        'facts',
        'oneliner',
            'nightfall',
        'heroic',
        'daily',
    ]

Here's what I see in the plugin list:

palendae: !plugins list
dinklebot: Plugins enabled on this channel: daily, facts, giphy, help, heroic, manager, meant_to_say, nightfall, oneliner, operator
dinklebot: Available plugins: dubstep, icanhazascii, jira, loljava, no_more_olga, poems, reminders, reviewboard, stfu, webhooks, wiki_whois

Notice that poems, dubstep, icanhazascii, loljava, jira, reminders, reviewboard, stfu, webhooks, and wiki_whois are enabled.

Trying to !enable poems, for example, doesn't return an acknowledgement, and the !haiku commands don't return any output. This includes !haiku add_use fives/sevens/ !haiku. I've added lines, but !haiku still doesn't return output. I have not yet looked in the DB manually.

My expectation is that when a core/default plugin is not enabled, it's not available.

@shaunduncan
Copy link
Owner

Let me take a look at this. I think there might be a couple of things. ENABLED_PLUGINS is a bit of a misnomer. The plugin loader will grab any plugin defined in an entry point, but this setting is more about setting what plugins should be enabled by default for a channel. So if it's not in that list, it will be 'available' to be enabled via !plugins enable foo

@nrb
Copy link
Contributor Author

nrb commented Jan 27, 2015

Some more example use from my channel - this is all uninterrupted.

palendae: !haiku
palendae: !enable poems
palendae: !haiku
palendae: !haiku add sevens She is really hard to kill
palendae: !haiku add fives Omnigul the Witch
palendae: !haiku add fives But we will prevail
palendae: !haiku

@shaunduncan
Copy link
Owner

Can you try !plugins enable poems instead and see if that works?

@nrb
Copy link
Contributor Author

nrb commented Jan 27, 2015

That worked.

@shaunduncan
Copy link
Owner

Cool, I think I'm going to chock this up as an enhancement. ENABLED_PLUGINS is definitely misleading, so there should be two distinct settings:

  • ENABLED_PLUGINS: A list of entry_point names that would whitelist plugins that should be loaded from an entry_point and made available for use. None would imply they all are made available.
  • DEFAULT_CHANNEL_PLUGINS: This would do what ENABLED_PLUGINS does now, define the plugin names that are enabled by default on a channel.

I'll probably want to make this for webhook settings as well (or at least ensure that it works the same way).

@shaunduncan shaunduncan changed the title Core plugins disabled, but still listed as available ENABLED_PLUGINS is misleading. It should be an entry_point whitelist instead. Jan 27, 2015
@shaunduncan shaunduncan modified the milestones: v1.7, v2 Jan 27, 2015
@shaunduncan shaunduncan added the v2 label Jan 27, 2015
@shaunduncan shaunduncan modified the milestones: v1.7, v2 Jan 27, 2015
@shaunduncan shaunduncan removed the v2 label Jan 27, 2015
@shaunduncan
Copy link
Owner

Fixed in the 1.7.0 release. There are 3 settings:

  • ENABLED_PLUGINS: serves as a plugin whitelist
  • DISABLED_PLUGISN: serves as a plugin blacklist
  • DEFAULT_CHANNEL_PLUGINS: serves as a list of plugins that should be 'on' by default in a channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants