Skip to content

Commit 0d7f338

Browse files
authored
docs(README): smoke test / Probot v11 migration key points / common errors (#63)
1 parent d126582 commit 0d7f338

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
node_modules/
2+
.settings/
3+
.project

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,45 @@ functions:
4949
5050
Make sure to configure your GitHub App registration's webhook URL to `<your lambda's URL>/api/github/webhooks`.
5151

52+
## Test deployment
53+
54+
For testing your Probot deployment without end to end (GitHub) integration, you can use this shell snippet:
55+
56+
```shell
57+
$ LAMBDA_URL=https://x.execute-api.y.amazonaws.com/stage-or-basePath/api/github/webhooks
58+
$ SECRET=the_webhook_secret
59+
$ TMP_DATA_FILE=/tmp/smoke.data
60+
61+
$ echo -n "{\"action\":\"test\"}" > $TMP_DATA_FILE
62+
$ SIGN=$(openssl dgst -sha1 -hmac $SECRET $TMP_DATA_FILE | cut -d" " -f2)
63+
$ curl --request POST --header "X-Hub-Signature: sha1=$SIGN" --header "X-Github-Event: test" --header "X-GitHub-Delivery: fake" --data-binary "@$TMP_DATA_FILE" $LAMBDA_URL
64+
{"ok":true} <-- Concent for Probot v10: {"message":"Received test.test"}
65+
```
66+
5267
## Examples
5368

5469
- [example-aws-lambda-serverless](https://github.com/probot/example-aws-lambda-serverless/#readme) - Official example application that is continuously deployed to AWS Lambda
5570

5671
Add yours!
5772

73+
## Common errors
74+
75+
| Http Code | Message | Description |
76+
| --------- | ---------------------------- | -------------------------------------------------------------------------------------------------- |
77+
| 403 | Missing Authentication Token | Bad endpoint (this one is not binded on Lambda) |
78+
| 500 | Internal server error | Incorrect headers value (`X-GitHub-Delivery`, `X-GitHub-Event`, `X-Hub-Signature`) or Probot error |
79+
80+
## Probot v11 migration key points
81+
82+
For Probot v11 support, this adapter introduces significant changes. Here the key points to update (in addition of [Probot v11 breaking changes](https://github.com/probot/probot/releases/tag/v11.0.0)):
83+
84+
| Key point / Probot | <= v10 | >= v11 |
85+
| -------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------- |
86+
| NPM package name | `@probot/serverless-lambda` | `@probot/adapter-aws-lambda-serverless` |
87+
| _handler.js_ content | See [Usage v1.x](https://github.com/probot/adapter-aws-lambda-serverless/tree/v1.0.2#usage) | See [Usage](#usage) |
88+
| AWS Lambda Runtime | `handler.probot` | `handler.webhooks` |
89+
| AWS Lambda Handler | Node.js 12.x _(preferred)_ | Node.js 12.x _(required)_ |
90+
5891
## LICENSE
5992

6093
[ISC](LICENSE)

0 commit comments

Comments
 (0)