diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f394e3e..dc35cefc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,19 +2,43 @@ We love pull requests. Here's a quick guide. -Fork, then clone: - -```bash -git clone git@github.com:your-username/datadog-lambda-python.git -``` - -Make your change, update tests and ensure the tests pass (install Docker if you haven't): - -```bash -./scripts/run_tests.sh -``` - -Push to your fork and [submit a pull request][pr]. +1. Fork, clone and branch off `main`: + ```bash + git clone git@github.com:/datadog-lambda-python.git + git checkout -b + ``` +1. Make your changes. Ensure your code is compatible with both Python 2.7 and 3.X. +1. 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. + + ```bash + 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. + + ```bash + # 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 Datadog-Python37 + ./scripts/publish_layers.sh + ``` + +1. Ensure the unit tests pass (install Docker if you haven't): + ```bash + ./scripts/run_tests.sh + ``` +1. Run the integration tests against your own AWS account and Datadog org (or ask a Datadog member to run): + ```bash + BUILD_LAYERS=true DD_API_KEY= ./scripts/run_integration_tests.sh + ``` +1. Update integration test snapshots if needed: + ```bash + UPDATE_SNAPSHOTS=true DD_API_KEY= ./scripts/run_integration_tests.sh + ``` +1. Push to your fork and [submit a pull request][pr]. [pr]: https://github.com/your-username/datadog-lambda-python/compare/DataDog:main...main diff --git a/README.md b/README.md index 633e1935..b7e71165 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![build](https://github.com/DataDog/datadog-lambda-python/workflows/build/badge.svg) [![PyPI](https://img.shields.io/pypi/v/datadog-lambda)](https://pypi.org/project/datadog-lambda/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/datadog-lambda) -[![Slack](https://img.shields.io/badge/slack-%23serverless-blueviolet?logo=slack)](https://datadoghq.slack.com/channels/serverless/) +[![Slack](https://chat.datadoghq.com/badge.svg?bg=632CA6)](https://chat.datadoghq.com/) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/DataDog/datadog-lambda-python/blob/main/LICENSE) Datadog Lambda Library for Python (2.7, 3.6, 3.7 and 3.8) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions. @@ -99,6 +99,10 @@ You can also open an issue for a feature request. If you find an issue with this package and have a fix, please feel free to open a pull request following the [procedures](CONTRIBUTING.md). +## Community + +For product feedback and questions, join the `#serverless` channel in the [Datadog community on Slack](https://chat.datadoghq.com/). + ## License Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.