We love pull requests. For new features, consider opening an issue to discuss the idea first. When you're ready to open a pull requset, here's a quick guide.
-
Fork, clone and branch off
main
:git clone [email protected]:<your-username>/datadog-lambda-js.git git checkout -b <my-branch>
-
Install the repositories dependencies,
yarn install
. -
Make your changes.
-
Test your Lambda function against the locally modified version of Datadog Lambda library.
-
The easiest approach is to use yarn link.
yarn build # rebuild after changes cd dist yarn link cd /path/to/your/testing/function/ yarn link "datadog-lambda-js" # use unlink after done
-
You can also build and publish a Lambda layer to your own AWS account and use it for testing.
# Build layers using docker ./scripts/build_layers.sh # Publish the a testing layer to your own AWS account, and the ARN will be returned # Example: ./scripts/publish_layers.sh us-east-1 ./scripts/publish_layers.sh <AWS_REGION>
-
-
Update tests and ensure they pass
yarn test
-
Run the integration tests against your own AWS account and Datadog org (or ask a Datadog member to run):
BUILD_LAYERS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh
-
Update integration test snapshots if needed:
UPDATE_SNAPSHOTS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh
-
Push to your fork and submit a pull request.
At this point you're waiting on us. We may suggest some changes or improvements or alternatives.