Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 2.27 KB

CONTRIBUTING.md

File metadata and controls

47 lines (37 loc) · 2.27 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 request, here's a quick guide.

  1. Fork, clone and branch off main:

    git clone git@github.com:<your-username>/datadog-lambda-python.git
    git checkout -b <my-branch>
  2. Make your changes. Ensure your code is compatible with Python 3.X.

  3. Test your Lambda function against the locally modified version of Datadog Lambda library.

    • The easiest approach is to create a soft link of the datadog_lambda folder in your project's root. Note, this only overrides the datadog_lambda module, and you still need to install the datadog_lambda package or the Lambda layer to have the required dependencies.

      ln -s /PATH/TO/datadog-lambda-python/datadog_lambda /PATH/TO/MY/PROJECT
    • Another option is to install the datadog_lambda module from the local folder. E.g., add /PATH/TO/datadog-lambda-python/ to your requirements.txt. This approach only work in a Linux environment, because the dependency ddtrace utilizes the native C extension.

    • 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: VERSION=1 REGIONS=us-east-1 LAYERS=Datadog-Python37 ./scripts/publish_layers.sh
      VERSION=<VERSION> REGIONS=<REGION> LAYERS=<LAYER> ./scripts/publish_layers.sh
  4. Ensure the unit tests pass (install Docker if you haven't):

    ./scripts/run_tests.sh
  5. 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
  6. Update integration test snapshots if needed:

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