Commit Graph

308 Commits

Author SHA1 Message Date
Gregor b0f0f50602 test: throttle using Redis-backed Bottleneck for cluster support 2019-03-08 11:16:44 -08:00
Gregor 7ce6902b71 test: request error logs 2019-03-08 11:16:44 -08:00
Gregor 20e7c65a50 refactor: use "auth" constructor option instead of `octokit.authenticate()` 2019-03-08 10:00:43 -08:00
Gregor 64f5928356 test: adapt tests for `@octokit/app`. We no longer need to test caching of installation tokens, this is implemented within `@octokit/app 2019-03-08 10:00:43 -08:00
Gregor cf24e4c773 test: disable throttling for github tests 2019-03-08 10:00:43 -08:00
Gregor c6cbc97bf0 feat: new throttling & automated retries 2019-03-08 10:00:19 -08:00
Gregor 3f83dae4e7 test(pagination): test deprecations 2019-03-08 10:00:19 -08:00
Gregor a486f7c03b test: fix mocked responses for pagination requests
Responses are always arrays, never single objects
2019-03-08 10:00:19 -08:00
Gregor c8e72aeeed test(graphql): add tests for deprecations, refactor for new .graphql implementation (no breaking changes) 2019-03-08 10:00:19 -08:00
Gregor 5567e97b32 refactor: spy on `github.repos.getContents` function without removing function properties 2019-03-08 10:00:19 -08:00
Gregor 20e5914b3b test: suppress logs from `console.warn`, use spy to make sure it was called 2019-03-08 10:00:19 -08:00
Gregor 301fc4775a test: pass utf8 as 2nd argument when reading private key from file using `fs.readFileSync` 2019-01-10 10:49:06 -08:00
Josh Soref 444fcac73d fix: Spelling (#800) 2019-01-03 12:15:02 -05:00
Andrew Hinett fee5451482 docs: fix misspellings of receive (#783) 2018-12-11 07:57:08 -08:00
Nikhil Mehra cc87051c0c Invalid PRIVATE_KEY_PATH error handling (#782) 2018-12-10 14:44:34 -05:00
Gregor 59bf271254 refactor: rename deprecated methods 2018-11-20 09:50:06 -08:00
Wilhelm Klopp 107c4e6749
Include version in manifest (#763) 2018-11-15 09:52:35 +00:00
Bob van der Linden 35dd36da69 Improve GraphQL query for TypeScript (#710) 2018-10-25 15:33:16 -05:00
mackie f82d647f51 chore(test): convert apps/stats test to TypeScript (#704) 2018-10-25 14:13:09 -05:00
mackie 85502cf3da chore(tests): convert logging test to TypeScript (#696) 2018-10-25 14:11:42 -05:00
Brandon Keepers 43acbbc843
Fix: Allow starting probot without token or id/cert (#738) 2018-10-15 13:10:02 -07:00
Alberto Gimeno ad06bd5e32 Deprecate `probot simulate` in favor of `probot receive` (#726) 2018-10-15 11:21:36 -07:00
Wilhelm Klopp aef4d72d95
Wrap pem in quotes to make Glitch happy (#737)
* Wrap pem in quotes to make Glitch happy
2018-10-15 09:17:07 -07:00
mackie 8663f1b8e6 chore(test): convert app/default test to TypeScript (#703)
See #582
2018-10-02 20:28:38 -04:00
mackie 18821db28c chore(test): convert Sentry test to TypeScript (#702)
See #582
2018-10-02 20:27:51 -04:00
Bex Warner 3be935bcd2
httpSSSSSSS (#701) 2018-09-26 15:34:57 -04:00
mackie 1da70093b2 chore(tests): convert serializers test to TypeScript (#695)
* chore(tests): convert serializers test to TypeScript

related to #582

* refactor: update with PR comments
2018-09-26 15:23:09 -04:00
Brandon Keepers f6946a0607 Probot Support for GitHub App Manifests (#650)
* Add button to setup GitHub app

* Add app.yml

* Add some comments to app.yml

* Associate events with permissions

* Allow configuring app with manifest

* Hacky version of callback URL for configuring app

* Remove manifest stuff for now

* Return nil if private key is not found

* Move setup stuff to a separate plugin

* Revert changes to default plugin

* Remove FIXME

* Revert changes to default template

* Use separate template for setup

* Fix lint warnings

* Convert test helper to typescript

* Initial test for setup app

* Require tests files to match `.test.(js|ts)`

* Account for multiple protocols in x-forwarded-proto

* Wrap pem in quotes

* Collapse class into request method for now

* run `refresh` after updating .env on Glitch

* Extract update-dotenv to a node module

* Create a smee url if one does not exist

* Hacky version of serving up the manifest

* WIP Manifest with code

* add comments for plan + figure out port

* using user-agent header for review lab

* add success view to redirect to after installation

* api is actually on github

* start making post

* fix quoting issue on POST

* everything is off review lab and on dotcom

* working version of app manifest flow

* Start trying to write tests against setup

* more refactor into thingerator; basic tests; write plans for other tests

* merge better..

* ok atom conflict handling broke

* hack the tests back together

* pass the tests 👊🏼

* moar test

* make it open in a new tab for Wil 💖

* make boolean work

* clean up logic, move messgae, just return html url not response

* clean up tests 👷🏾‍♀️

* rename Brandon's thingerator to manifest-creation
2018-09-26 15:22:11 -04:00
Bex Warner facac548bf
update octokit/rest and tests to use /app/installations (#681) 2018-09-04 17:06:06 -04:00
AditShah 31ec2a39c3 chore(test): convert server to TypeScript (#664) 2018-09-03 13:14:01 -04:00
Shobhit Gupta 415b6ea1ad chore(test): Convert private-key tests to ts (#676) 2018-09-03 12:36:58 -04:00
Bex Warner 782707af67 fix: Show friendly error when the webhook secret on GitHub does not match `WEBHOOK_SECRET` (#647) 2018-08-24 10:36:30 -04:00
Karol Majewski 96b186ac0f chore: Convert resolver tests to TypeScript (#660) 2018-08-24 10:12:08 -04:00
siddharth singh 8a12f83d0b Convert logger test to Typescript (#656)
* Convert logger test to Typescript

* Convert logger test to Typescript
2018-08-20 10:31:10 -04:00
Ben Scott 686232d13d chore: Rename plugins to apps (#654) 2018-08-17 14:17:15 -04:00
Tommy Byrd 59f924e4e6
Add environment variable option to provide a base64 encoded key (#624)
* check for base64 in the PRIVATE_KEY variable

* Update private_key config documentation

* Link to deployment docs for private key usage
2018-08-10 08:07:12 -04:00
Kentaro Matsushita 4159d80e08 chore(tests): Convert graphql tests to TypeScript (#629) 2018-08-09 23:42:02 -04:00
Tom Milligan 4118f1d9dc Added env var INSTALLATION_TOKEN_TTL (#638)
* Add env var INSTALLATION_TOKEN_TTL

* Fixed jest tests not running under yarn with insecure localhost warning

* Update configuration.md

* Added integration nock tests for Application auth cache

* Fix test comment typo

* Clean global variables both before and after auth cache tests
2018-08-07 08:11:51 -07:00
Ben Scott d712141868 Refer to instances of ApplicationFunction as appFn (#633)
Stop using the names 'plugin' and 'app' to refer to instances of
ApplicationFunction.

This renames all variable names, but leaves the plugins folder in place,
to be renamed later
2018-08-02 14:47:27 -04:00
Kentaro Matsushita eb6cea4e63 chore(test): Convert github tests to TypeScript (#625) 2018-07-17 23:02:07 -05:00
Brandon Keepers 59046bb7d8
chore: Extract type declarations for @octokit/webhooks (#626) 2018-07-17 14:38:04 -05:00
Kentaro Matsushita 88cdb2bfa4 chore(test): Convert application tests to TypeScript (#614) 2018-07-15 05:52:28 -05:00
Brandon Keepers 1795133ee4
chore(test): Run tslint against tests (#622) 2018-07-13 10:23:50 -05:00
Tommy Byrd 48887fa938
Various cleanup and fixes from TS checklist (#585)
* Optional Options

* Webhook ID is a string

* turning on no-var-requires and related fixes

* remove any. app is inferring correctly

* linter
2018-06-28 12:35:11 -04:00
Morgan Delagrange 73ac539f45 fix: Fix path to GraphQL API when using GitHub Enterprise (#580)
The API path should be <ghe_host>/api/graphql, but
it is defaulting to <ghe_host>/api/v3/graphql.
2018-06-27 19:11:34 -05:00
Bex Warner 43ea6ce815
Adds error case (#589)
* add case

* i saved it before I typed the colon ::::::

* showdown: my 3 commits vs 1 colon

* add test cases for all scenarios
2018-06-27 16:53:34 -07:00
Jason Etcovitch b60de0c123
fix: Throw if GHE_HOST includes a protocol (#570) 2018-06-18 14:32:02 -04:00
Jason Etcovitch de18b9000b
feat: app.load() (#554) 2018-06-15 20:14:41 -04:00
Brandon Keepers 623260ad2f
chore: Convert Context tests to TypeScript (#541) 2018-06-09 22:45:15 -05:00
greenkeeper[bot] c5bf773cb3 chore(package): Update bottleneck to the latest version 🚀 (#562) 2018-06-09 21:40:58 -05:00
Brandon Keepers 2efa0b24b7
chore: Rename robot to app (#542)
This replaces all internal references to "robot" with "app" or
"Application". There should be no functional change in public APIs, but
may cause some issues for anyone using internal APIs.
2018-06-01 17:45:23 -05:00
Tommy Byrd d2fe925e1a chore: Rewrite core in Typescript (#372) 2018-05-25 15:17:19 -05:00
Brandon Keepers 61393304f0
chore: Commit version number, remove snapshot tests (#535) 2018-05-19 08:26:01 -05:00
Bartosz Łaniewski f525df9e8a fix: Allow listening to `installation.deleted` event and other events that don't include an installation id (#475) 2018-05-18 23:43:16 -05:00
Bex Warner c0140b5d7b
add ignore spammy/abusive user option for stats endpoint (#513)
* add spammy user ignorance and test - not sure why failing 😭

* set account.stars to 0

* use id 1 for test user to properly authenticate

* delete process.env.ignored_accounts on aftereach

* add extra line
2018-05-13 15:28:18 -05:00
Richard Littauer 4524ada62c docs: suggested changes from audit #522 (#523) 2018-05-13 01:16:43 -04:00
Kautilya Tripathi cfe3cddd58 fix: throw informative error if payload is missing repository (#508) 2018-04-22 16:36:08 -04:00
Kautilya Tripathi 72d0d81bf8 chore: Add icon to title of probot (#483) 2018-04-05 13:59:44 -05:00
Brandon Keepers 6e60927dba
fix: allow initializing the GitHub client without options (#479) 2018-03-22 17:33:38 -05:00
Brandon Keepers 3503b1f611
Add GraphQL support (#472) 2018-03-21 21:33:16 -05:00
Brandon Keepers 9f324c79e3 chore: Minimal changes to get @octokit/webhooks working (#462) 2018-03-21 13:23:51 -04:00
Jason Etcovitch 2fc8fd8f45
feat: Better error messages (#434) 2018-03-21 01:33:58 -04:00
Alexey Alekhin ddb5b3d9ba Raise an error if there are several .pem files (#441) 2018-03-08 21:33:46 -05:00
greenkeeper[bot] 0060098fd7 chore(package): Update standard to the latest version 🚀 (#436) 2018-02-28 10:09:40 -05:00
Brandon Keepers 72d6911a79
fix: Re-throw errors from octokit (#418) 2018-02-05 10:28:02 -05:00
greenkeeper[bot] 2f3f434ab8 fix(package): Update bottleneck to the latest version 🚀 (#397) 2018-02-03 15:55:50 -05:00
Gregor 5bf1c315c7 test: adapt for @octokit/rest
Turns out that the `per_page` & `page` params are missing in [routes.json](https://github.com/octokit/rest.js/blob/master/lib/routes.json#L1682-L1687), which means, with the previous implementations, they have been ignored!

The new implementation automatically passes all remaining options as query parameter (for `GET` requests) so it works anyway.

So tl;dr: the new release actually fixed a bug, getting the stats will be more performant now, as it gets 100 results instead of 30
2018-01-29 11:07:17 -08:00
Brandon Keepers 0a4b297757
Allow setting logger name to separate components (#355) 2018-01-29 08:26:33 -06:00
Wilhelm Klopp dcd0e32c3c Add option to disable stats (#392) 2018-01-12 08:20:25 -06:00
Brandon Keepers a3c91afdf3
Properly handle async errors (#384) 2018-01-12 08:10:10 -06:00
Brandon Keepers 0b527178eb
Use smee-client instead of EventSource directly (#389) 2018-01-11 21:39:50 -06:00
Ryan Tsao 36e3b57b41 feature: Add early termination to paginate method (#329) 2018-01-11 13:16:44 -05:00
Jason Etcovitch 7bef6a7bf9
chore: Add serializer tests (#369) 2017-12-13 11:13:46 -05:00
Brandon Keepers 6aa3a2f7b2
feat: Add support for experimental webhook proxy (#359)
Usage:

    $ WEBHOOK_PROXY_URL=http://github-webhook-proxy.herokuapp.com/abcxyz npm start
2017-12-07 12:30:18 -06:00
Jason Etcovitch 92c5c52e66
Implement GHE Support (#331)
* Add GHE_URL host option to GitHubApi

* Absorb github-app repo

* Implement new github-app setup

* Basic tests for GHE support

* Add docs

* Switch GHE_URL for GHE_HOST

* Make the tests pass by moving things

* Fix sentry test
2017-11-30 13:02:58 -05:00
Brandon Keepers 27b7c8d406
refactor: Extract Sentry logging to a built-in plugin (#353) 2017-11-27 20:57:52 -06:00
Brandon Keepers e35028890a
Improve GitHub logging (#351)
* Extract github client extensions into module

* Add logging to extended GitHub client

* Update test to check output

* Inline GitHub App methods

* Update node-github links

* Remove src, which does not show up with LOG_FORMAT=simple anyway

* Fix lint errors
2017-11-27 10:18:58 -06:00
Brandon Keepers 1e2551853e
feat: Add request/response logging (#322)
BREAKING CHANGE:
- Default log level is now `INFO` instead of `DEBUG`
2017-11-25 22:16:54 -06:00
Brandon Keepers c5a0c5956c
Add `context.log` to add event context to each log message (#321)
* Add logger on context.log

* Update robot.log instances in docs

* Add more event context
2017-11-21 12:31:55 -06:00
Jason Etcovitch 9eeac3a57e
refactor: switch ejs for hbs 2017-11-21 09:21:39 -05:00
Brandon Keepers 5dde8405c5
chore: remove unnecessary test config (#313) 2017-11-02 20:39:12 -05:00
Jason Etcovitch 5d29945dd2 feat: /probot homepage (#279)
* Add /probot route with tests

* Add index route, write tests

* Remove unused arg

* Pass tests

* Tweak HTML string and pkg require

* Add static directory

* Design welcome page

* Rename to probot.html

* Implement EJS

* Remove duplicate load

* Extract default homepage into plugin

* Fix issue after merge conflict

* Refactor app loading

* Remove autoloading of plugings

BREAKING CHANGE: `probot run` without any arguments will no longer autoload apps named `probot-*`.

* Move setup

* Look for `apps` key instead of `plugins`

* Update simulate command

* Simplify resolver

* Remove unused routes variable

* Move views to default path

* Call probot.setup to properly initialize default apps

* Simplify package loading

* Specify extension

* Add links to docs/slack

* Remove stats link

* Add helper to jest ignore

* Fix ejs views error

* Move a require to top of file

* Remove unnecessary (and breaking) test
2017-10-17 09:35:58 -04:00
Jason Etcovitch e7a0c5cd80 chore(tests): Migrate to Jest
* Add jest, remove mocha/expect

* Migrate all tests to Jest

* Make test pass

* Move tests into `/test/`

* Update testing docs

* Fix resolver test
2017-10-14 06:02:34 -07:00
Brandon Keepers dda5df88d8 Refactor app loading (#284)
BREAKING CHANGE: `probot run` without any arguments will no longer autoload apps named `probot-*`.
2017-10-14 05:25:02 -07:00
Bex Warner 1227ef9d3b
removes unnecessary eslint disables 2017-10-12 14:12:39 -07:00
Brandon Keepers 6d8ddaf3f7 feat: Expose public stats about installations (#181) 2017-10-11 21:09:13 -07:00
Brandon Keepers 1c0657bbbc
Remove deprecated features 2017-09-05 12:21:57 -05:00
Brandon Keepers 9250c8c555
Set LOG_LEVEL=fatal for all tests 2017-08-29 22:32:01 -05:00
Brandon Keepers d441aa6f4c
Silence server errors in test with default error handler 2017-08-29 22:11:18 -05:00
Brandon Keepers e93555397e
Remove deprecated event argument for callback 2017-08-24 15:57:13 -05:00
Brandon Keepers dc33e4be6f
Remove deprecated `robot` method from a probot instance 2017-08-24 15:54:59 -05:00
Brandon Keepers 07c9dd46ae Merge pull request #212 from wilhelmklopp/master
Multiple events per robot.on()
2017-08-24 15:49:27 -05:00
Wilhelm Klopp a20867af9e Move event2 fixture into test 2017-08-24 21:04:08 +01:00
Wilhelm Klopp e152163752 Add test for array input to robot.on() 2017-08-24 18:31:42 +01:00
Brandon Keepers dfbcc9fe58
Fix standard lint errors 2017-08-24 08:39:00 -05:00
Brandon Keepers 9f6003d5e0 Merge branch 'master' into sentry_docs 2017-08-24 08:34:35 -05:00
Brandon Keepers 771bbbab91
Merge remote-tracking branch 'origin/master' into plugin-to-app
* origin/master:
  maximize cat gifage
  create new error instead of eslint disable
  confirmed my localdev is is 😵
  tetsing if a standard error fails on CI
  STANDARD LINT ALL OF THE THINGS
  update plugin usage
  Add support for update-docs and new-issue-welcome
2017-08-24 08:24:26 -05:00
Bex Warner 4cec752dcc create new error instead of eslint disable 2017-08-23 10:00:12 -07:00
Bex Warner 6d37ad80da STANDARD LINT ALL OF THE THINGS 2017-08-22 20:06:31 -07:00
Brandon Keepers 34e8bddfdd
Merge remote-tracking branch 'origin/master' into plugin-to-app
* origin/master:
  The Slack chat channel on the Internet machine
  Clean up link to slack channel
  Add link to slack channel
  Adds a line break
  add test to ensure deprecation occurs
  add version for deprecation to console.warn and inline comment
  it's on the same tab
  annoying space 💢
  bot -> app
  0 -> 1 silly markdown
  Create CONTRIBUTING.md
  Add linter extend to package.json
  clarify REST API
  use settings.yml
  Update development.md
  Fix urls to example apps
  Fix link to example GitHub profile
  Bumps webhook dep and adds webhookPath config
2017-08-22 18:29:44 -05:00