8000 Update contributing doc (#106) · DataDog/datadog-lambda-python@f345e6a · GitHub
[go: up one dir, main page]

Skip to content

Commit f345e6a

Browse files
authored
Update contributing doc (#106)
1 parent dd60983 commit f345e6a

File tree

2 files changed

+42
-14
lines changed

2 files changed

+42
-14
lines changed

CONTRIBUTING.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,43 @@
22

33
We love pull requests. Here's a quick guide.
44

5-
Fork, then clone:
6-
7-
```bash
8-
git clone git@github.com:your-username/datadog-lambda-python.git
9-
```
10-
11-
Make your change, update tests and ensure the tests pass (install Docker if you haven't):
12-
13-
```bash
14-
./scripts/run_tests.sh
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 git@github.com:<your-username>/datadog-lambda-python.git
8+
git checkout -b <my-branch>
9+
```
10+
1. Make your changes. Ensure your code is compatible with both Python 2.7 and 3.X.
11+
1. Test your Lambda function against the locally modified version of Datadog Lambda library.
12+
* 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.
13+
14+
```bash
15+
ln -s /PATH/TO/datadog-lambda-python/datadog_lambda /PATH/TO/MY/PROJECT
16+
```
17+
* 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.
18+
* You can also build and publish a Lambda layer to your own AWS account and use it for testing.
19+
20+
```bash
21+
# Build layers using docker
22+
./scripts/build_layers.sh
23+
24+
# Publish the a testing layer to your own AWS account, and the ARN will be returned
25+
# Example: ./scripts/publish_layers.sh us-east-1 Datadog-Python37
26+
./scripts/publish_layers.sh <AWS_REGION> <Layer_Name>
27+
```
28+
29+
1. Ensure the unit tests pass (install Docker if you haven't):
30+
```bash
31+
./scripts/run_tests.sh
32+
```
33+
1. Run the integration tests against your own AWS account and Datadog org (or ask a Datadog member to run):
34+
```bash
35+
BUILD_LAYERS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh
36+
```
37+
1. Update integration test snapshots if needed:
38+
```bash
39+
UPDATE_SNAPSHOTS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh
40+
```
41+
1. Push to your fork and [submit a pull request][pr].
1842

1943
[pr]: https://github.com/your-username/datadog-lambda-python/compare/DataDog:main...main
2044

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![build](https://github.com/DataDog/datadog-lambda-python/workflows/build/badge.svg)
44
[![PyPI](https://img.shields.io/pypi/v/datadog-lambda)](https://pypi.org/project/datadog-lambda/)
55
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/datadog-lambda)
6-
[![Slack](https://img.shields.io/badge/slack-%23serverless-blueviolet?logo=slack)](https://datadoghq.slack.com/channels/serverless/)
6+
[![Slack](https://chat.datadoghq.com/badge.svg?bg=632CA6)](https://chat.datadoghq.com/)
77
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/DataDog/datadog-lambda-python/blob/main/LICENSE)
88

99
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.
9999

100100
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).
101101

102+
## Community
103+
104+
For product feedback and questions, join the `#serverless` channel in the [Datadog community on Slack](https://chat.datadoghq.com/).
105+
102106
## License
103107

104108
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.

0 commit comments

Comments
 (0)
0