Skip to content

Commit dcaf1a4

Browse files
authored
Update contributing doc (#144)
1 parent deee729 commit dcaf1a4

File tree

2 files changed

+46
-14
lines changed

2 files changed

+46
-14
lines changed

CONTRIBUTING.md

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

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

5-
Fork, then clone:
6-
7-
```bash
8-
git clone [email protected]:your-username/datadog-lambda-js.git
9-
```
10-
11-
Make your change, update tests and ensure the tests pass (install Docker if you haven't):
12-
13-
```bash
14-
npm test
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 [email protected]:<your-username>/datadog-lambda-js.git
8+
git checkout -b <my-branch>
9+
```
10+
1. Install the repositories dependencies, `yarn install`.
11+
1. Make your changes.
12+
1. Test your Lambda function against the locally modified version of Datadog Lambda library.
13+
* The easiest approach is to use [yarn link](https://classic.yarnpkg.com/en/docs/cli/link/).
14+
15+
```bash
16+
yarn build # rebuild after changes
17+
cd dist
18+
yarn link
19+
cd /path/to/your/testing/function/
20+
yarn link "datadog-lambda-js" # use unlink after done
21+
```
22+
* You can also build and publish a Lambda layer to your own AWS account and use it for testing.
23+
24+
```bash
25+
# Build layers using docker
26+
./scripts/build_layers.sh
27+
28+
# Publish the a testing layer to your own AWS account, and the ARN will be returned
29+
# Example: ./scripts/publish_layers.sh us-east-1
30+
./scripts/publish_layers.sh <AWS_REGION>
31+
```
32+
33+
1. Update tests and ensure they pass
34+
```bash
35+
yarn test
36+
```
37+
1. Run the integration tests against your own AWS account and Datadog org (or ask a Datadog member to run):
38+
```bash
39+
BUILD_LAYERS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh
40+
```
41+
1. Update integration test snapshots if needed:
42+
```bash
43+
UPDATE_SNAPSHOTS=true DD_API_KEY=<your Datadog api key> ./scripts/run_integration_tests.sh
44+
```
45+
1. Push to your fork and [submit a pull request][pr].
1846

1947
[pr]: https://github.com/your-username/datadog-lambda-js/compare/DataDog:main..main.
2048

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
![build](https://github.com/DataDog/datadog-lambda-js/workflows/build/badge.svg)
33
[![Code Coverage](https://img.shields.io/codecov/c/github/DataDog/datadog-lambda-js)](https://codecov.io/gh/DataDog/datadog-lambda-js)
44
[![NPM](https://img.shields.io/npm/v/datadog-lambda-js)](https://www.npmjs.com/package/datadog-lambda-js)
5-
[![Slack](https://img.shields.io/badge/slack-%23serverless-blueviolet?logo=slack)](https://datadoghq.slack.com/channels/serverless/)
5+
[![Slack](https://chat.datadoghq.com/badge.svg?bg=632CA6)](https://chat.datadoghq.com/)
66
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/DataDog/datadog-lambda-js/blob/main/LICENSE)
77

88
Datadog Lambda Library for Node.js enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.
@@ -117,6 +117,10 @@ You can also open an issue for a feature request.
117117

118118
If you find an issue with this package and have a fix, please feel free to open a pull request following the [procedures](https://github.com/DataDog/dd-lambda-js/blob/main/CONTRIBUTING.md).
119119

120+
## Community
121+
122+
For product feedback and questions, join the `#serverless` channel in the [Datadog community on Slack](https://chat.datadoghq.com/).
123+
120124
## License
121125

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

0 commit comments

Comments
 (0)