Commit Graph

223 Commits

Author SHA1 Message Date
Brandon Keepers
61be74e3d4 Test with taking an argument and not 2017-06-30 12:18:52 -05:00
Brandon Keepers
fe876d846c Ensure * event still works 2017-06-30 11:12:08 -05:00
Brandon Keepers
0e38027092 Make Robot self-sustaining
Instead of passing in the webhook handler, this adds an EventEmitter on Robot so it can do its own event handling.
2017-06-30 11:06:06 -05:00
Brandon Keepers
aa3146b18f Allow creating robot without a logger 2017-06-30 10:34:25 -05:00
Brandon Keepers
9dd1afd696 Test for manually delivering events 2017-06-27 12:49:54 -04:00
Brandon Keepers
91c1472f34 Failing test to show issue with Context 2017-06-16 11:10:47 -07:00
Brandon Keepers
b65d239772 Merge event and context arguments 2017-06-11 17:31:47 -05:00
Brandon Keepers
fdfbaeafac Update name from "GitHub Integrations" to "GitHub Apps" 2017-06-05 21:11:08 -05:00
Brandon Keepers
53ee6421b3 Catch and log errors from plugins 2017-06-04 09:25:00 -05:00
Lee Dohm
12e65f27b0 Add missing assignment 2017-05-15 09:57:08 -07:00
Lee Dohm
24ef94f232 Add tests for .getPluginConfig 2017-05-13 20:19:22 -07:00
Brandon Keepers
16aa76d7ec Fix lint errors 2017-04-29 09:18:18 -05:00
Brandon Keepers
cb7a418ce2 Upate tests to handle async callback 2017-04-29 09:14:31 -05:00
Christopher Hiller
0f14bf3499 add PRIVATE_KEY_PATH env var support; closes #122
The loading preference is:

1. CLI flag
2. `PRIVATE_KEY`
3. `PRIVATE_KEY_PATH`
4. Find a `.pem` file in the current working dir

Changes:

- break out PK loading logic into module `lib/private-key.js`
- add more info to error messaging if probot fails to find a PK
- add tests
- add note to deployment docs
2017-04-24 23:02:48 -07:00
Brandon Keepers
f639dfc30d Merge pull request #123 from boneskull/issue/99
enable autodiscovery of plugins; closes #99
2017-04-17 06:14:28 -05:00
Christopher Hiller
8b858aaa64 enable autodiscovery of plugins; closes #99
- new behavior: if no plugins are specified, then they are automatically discovered.  if plugins are specified, no autodiscovery happens
- a plugin is defined as a module whose name begins with the prefix `probot-`
- move plugin loading/resolving routines into module
- add tests
2017-04-17 01:59:03 -07:00
Christopher Hiller
387b0b5e28 use function expressions in suite and test blocks
When writing Mocha tests, the blocks should be function expressions instead of lambdas.  The reasoning is that it's easier to refactor if a test needs a custom timeout, or needs to be conditionally skipped:

    it('should do x', () => {
      this.skip(); // throws exception
    });

    it('should do x', function () {
      this.skip(); // ok
    });
2017-04-17 01:53:56 -07:00
Brandon Keepers
e64f65a5fc Move logger setup to index 2017-04-08 12:05:26 -05:00
Brandon Keepers
dfba43664a Remove unused fixtures 2017-03-11 16:04:30 -06:00
Brandon Keepers
ffbee1c16d The shell of a robot 2017-03-11 15:58:36 -06:00
Lee Dohm
e4aac40b2b Add Context.halt() function to make halting a rule simple 2017-03-02 10:08:41 -08:00
Lee Dohm
62883caeea 💚 Update integration tests 2017-03-01 13:32:08 -08:00
Lee Dohm
43a00624c2 Stop using const because state was leaking between tests 2017-03-01 13:03:25 -08:00
Lee Dohm
0d63f324ba 🎨 2017-02-28 18:17:58 -08:00
Lee Dohm
1f59fb06a7 Add a bunch of Workflow tests 2017-02-28 16:20:50 -08:00
Lee Dohm
bb6909bcf2 Add specs for Filter.on() 2017-02-28 14:33:54 -08:00
Lee Dohm
735b545ee6 Add Filter plugin 2017-02-28 13:30:54 -08:00
Michael Johnson
c8f5f24ccc Add labels and assignees 2017-01-24 12:35:36 -07:00
Michael Johnson
a0eda23611 Refactor createIssue for multiple arguments 2017-01-24 10:00:49 -07:00
Brandon Keepers
9acfaba32b Include contents relative to repo source 2016-12-08 23:54:22 -06:00
Brandon Keepers
ec56779d37 Include relative to the current repo 2016-12-08 23:48:44 -06:00
Brandon Keepers
2352493d92 Fix error on push event 2016-12-05 21:28:23 -06:00
Brandon Keepers
80aedee988 Support for deleting pull request review comments 2016-12-04 23:29:24 -06:00
Brandon Keepers
74fbdeda6b Support deleting commit comments 2016-12-04 23:19:24 -06:00
Brandon Keepers
f6c6869456 Add deleteComment plugin action 2016-12-04 22:52:40 -06:00
Brandon Keepers
4ec037b3ec Add method for getting repository contents 2016-12-04 18:22:46 -06:00
Brandon Keepers
fc6fefa1f1 Rename load => include 2016-12-04 16:36:42 -06:00
Brandon Keepers
df59026ad3 load from another repo 2016-12-04 14:20:01 -06:00
Brandon Keepers
eec408b252 Allow overwriting of attributes
Now that each intallation gets an authed API client, this should be safe
2016-12-04 14:17:59 -06:00
Brandon Keepers
0b7ffb3a3a Add load method in config API 2016-12-04 13:13:55 -06:00
Brandon Keepers
8fabd7ccc1 Refactor config loading 2016-12-04 13:13:54 -06:00
Brandon Keepers
4e60ad56cf Refactor out dispatcher 2016-12-04 12:59:42 -06:00
Brandon Keepers
0b717e68a2 Move payload helpers to context 2016-12-04 12:57:28 -06:00
Brandon Keepers
cc18091356 Add plugin base class 2016-11-24 21:02:40 -06:00
Brandon Keepers
838f4801d9 Unnecessary test changes 2016-11-22 23:46:20 -06:00
Brandon Keepers
65eaf9300b Reimplement workflow with new plugin system 2016-11-22 22:44:24 -06:00
Brandon Keepers
d67e637bb1 Merge branch 'master' into pure-js-implemented-refactored
* master: (33 commits)
  Simplify event filter logic
  Move logic for filtering workflows
  add label example
  Remove reactions, which are not supported by integrations
  Use installation id from webhook
  Create robot module
  Update github client library
  Remove listening for invites
  Move vm code into sandbox
  GITHUB_TOKEN only needed for console
  Log unhandled errors
  Warn that reactions does not work
  Update docs on running app locally
  Ignore .env
  Add debugging
  Fix lint errors
  Remove useless tests
  Clean up installation implementation
  Ignore priate-key.pem
  Remove unused github api instance
  ...
2016-11-22 19:48:54 -06:00
Brandon Keepers
2d2b8b00f6 Move logic for filtering workflows 2016-11-22 12:26:43 -06:00
Brandon Keepers
90708f3fba Remove reactions, which are not supported by integrations 2016-11-20 21:31:36 -06:00
Brandon Keepers
a8d73722a2 Merge remote-tracking branch 'origin/master' into integration
* origin/master: (65 commits)
  Move vm code into sandbox
  Update docs
  Look for config in .probot.js
  Remove URL stuff for now
  Use handlebars in comment templates
  Remove unnecessary semicolon
  Extract Sanbox class, remove workflows.push
  Move evaluator to its own file
  Remove unused modules
  More style fixes
  Fix style
  Reimplement reactions
  Implement unlock
  Implement locking
  Implement open
  Implement unlabel
  Implement unassign
  Implement issue assignment
  Implement comment test
  Move label tests into plugin
  ...
2016-11-18 14:51:23 -06:00