Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 1.81 KB

CONTRIBUTING.md

File metadata and controls

49 lines (41 loc) · 1.81 KB

Contributing

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.

  1. Fork, clone and branch off main:

    git clone [email protected]:<your-username>/datadog-lambda-js.git
    git checkout -b <my-branch>
  2. Install the repositories dependencies, yarn install.

  3. Make your changes.

  4. 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>
  5. Update tests and ensure they pass

    yarn test
  6. 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
  7. Update integration test snapshots if needed:

    UPDATE_SNAPSHOTS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh
  8. 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.