|
2 | 2 |
|
3 | 3 | We love pull requests. Here's a quick guide.
|
4 | 4 |
|
5 |
| -Fork, then clone: |
6 |
| - |
7 |
| -```bash |
8 |
| -git clone [email protected]:your-username/datadog-lambda-js.git |
9 |
| -``` |
10 |
| - |
11 |
| -Make your change, update tests and ensure the tests pass (install Docker if you haven't): |
12 |
| - |
13 |
| -```bash |
14 |
| -npm test |
15 |
| -``` |
16 |
| - |
17 |
| -Push to your fork and [submit a pull request][pr]. |
| 5 | +1. Fork, clone and branch off `main`: |
| 6 | + ```bash |
| 7 | + git clone [email protected]: <your-username >/datadog-lambda-js.git |
| 8 | + git checkout -b <my-branch> |
| 9 | + ``` |
| 10 | +1. Install the repositories dependencies, `yarn install`. |
| 11 | +1. Make your changes. |
| 12 | +1. Test your Lambda function against the locally modified version of Datadog Lambda library. |
| 13 | + * The easiest approach is to use [yarn link](https://classic.yarnpkg.com/en/docs/cli/link/). |
| 14 | + |
| 15 | + ```bash |
| 16 | + yarn build # rebuild after changes |
| 17 | + cd dist |
| 18 | + yarn link |
| 19 | + cd /path/to/your/testing/function/ |
| 20 | + yarn link "datadog-lambda-js" # use unlink after done |
| 21 | + ``` |
| 22 | + * You can also build and publish a Lambda layer to your own AWS account and use it for testing. |
| 23 | + |
| 24 | + ```bash |
| 25 | + # Build layers using docker |
| 26 | + ./scripts/build_layers.sh |
| 27 | +
|
| 28 | + # Publish the a testing layer to your own AWS account, and the ARN will be returned |
| 29 | + # Example: ./scripts/publish_layers.sh us-east-1 |
| 30 | + ./scripts/publish_layers.sh <AWS_REGION> |
| 31 | + ``` |
| 32 | + |
| 33 | +1. Update tests and ensure they pass |
| 34 | + ```bash |
| 35 | + yarn test |
| 36 | + ``` |
| 37 | +1. Run the integration tests against your own AWS account and Datadog org (or ask a Datadog member to run): |
| 38 | + ```bash |
| 39 | + BUILD_LAYERS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh |
| 40 | + ``` |
| 41 | +1. Update integration test snapshots if needed: |
| 42 | + ```bash |
| 43 | + UPDATE_SNAPSHOTS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh |
| 44 | + ``` |
| 45 | +1. Push to your fork and [submit a pull request][pr]. |
18 | 46 |
|
19 | 47 | [pr]: https://github.com/your-username/datadog-lambda-js/compare/DataDog:main..main.
|
20 | 48 |
|
|
0 commit comments