Skip to content

Commit

Permalink
Update: disable experimental plugins by default
Browse files Browse the repository at this point in the history
  • Loading branch information
not-an-aardvark committed Oct 17, 2017
1 parent 995c1f2 commit 255a5d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Plugins are the core part of the bot. They are standalone pieces which listen on

_Note: All plugin names marked with `*` are experimental._

#### How to disable a plugin
#### Adding plugins

Works need to be done in this area but for now just comment the plugin which you want to disable inside `src/plugins/index` file.
To add a plugin:

1. Create the plugin as a new file in `src/plugins`.
1. Add the plugin to the list in `src/plugins/index.js`.
1. Add the plugin to the list `src/app.js` to enable it by default.
12 changes: 7 additions & 5 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ const bot = probot({
cert: process.env.PRIVATE_KEY || "", // required
id: process.env.APP_ID || "" // required
});
const disabledPlugins = [
"prReadyToMerge"
];
const enabledPlugins = new Set([
"commitMessage",
"needsInfo",
"triage"
]);

// load all the plugins from inside plugins folder except the one which are disabled
// load all the enabled plugins from inside plugins folder
Object.keys(plugins)
.filter((pluginId) => !disabledPlugins.includes(pluginId))
.filter((pluginId) => enabledPlugins.has(pluginId))
.forEach((pluginId) => bot.load(plugins[pluginId]));

// start the server
Expand Down

0 comments on commit 255a5d9

Please sign in to comment.