Skip to content

Commit 8015d74

Browse files
docs: Update contributing doc (#2026)
* update pr guidelines section more closely resembles otel-js repo * add development quickstart * add more detail for general guidance * add tools and dev header section * update note about changelog * update contributing toc * update based on pr feedback * clarify npm test, add detail for changelog --------- Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
1 parent 146edfa commit 8015d74

File tree

1 file changed

+70
-19
lines changed

1 file changed

+70
-19
lines changed

CONTRIBUTING.md

Lines changed: 70 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
We'd love your help!
44

5+
- [Development Quick Start](#development-quick-start)
56
- [Report a bug or requesting feature](#report-a-bug-or-requesting-feature)
67
- [How to contribute](#how-to-contribute)
78
- [Before you start](#before-you-start)
89
- [Conventional commit](#conventional-commit)
910
- [Fork](#fork)
10-
- [Running the tests](#running-the-tests)
11-
- [Generating API documentation](#generating-api-documentation)
12-
- [Generating CHANGELOG documentation](#generating-changelog-documentation)
11+
- [Development](#development)
12+
- [Tools used](#tools-used)
13+
- [General guidance](#general-guidance)
14+
- [CHANGELOG](#changelog)
1315
- [Benchmarks](#benchmarks)
1416
- [Component Ownership](#component-ownership)
1517
- [Component Lifecycle](#component-lifecycle)
@@ -19,10 +21,25 @@ We'd love your help!
1921
- [Stable](#stable)
2022
- [Unmaintained](#unmaintained)
2123
- [Deprecated](#deprecated)
24+
- [Pull Request Merge Guidelines](#pull-request-merge-guidelines)
25+
- [General Merge Requirements](#general-merge-requirements)
2226
- [Contributing Vendor Components](#contributing-vendor-components)
2327
- [Adding a New Vendor Component](#adding-a-new-vendor-component)
2428
- [Removing Vendor Components](#removing-vendor-components)
2529

30+
## Development Quick Start
31+
32+
To get the project started quickly, you can follow these steps. For more
33+
detailed instructions, see [development](#development) below.
34+
35+
```sh
36+
git clone https://github.com/open-telemetry/opentelemetry-js-contrib.git
37+
cd opentelemetry-js-contrib
38+
npm ci
39+
npm run compile
40+
npm test
41+
```
42+
2643
## Report a bug or requesting feature
2744

2845
Reporting bugs is an important contribution. Please make sure to include:
@@ -71,18 +88,44 @@ Remember to always work in a branch of your local copy, as you might otherwise h
7188

7289
Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md#github-workflow) section of general project contributing guide.
7390

74-
### Running the tests
91+
## Development
92+
93+
### Tools used
94+
95+
- [NPM](https://npmjs.com)
96+
- [TypeScript](https://www.typescriptlang.org/)
97+
- [lerna](https://github.com/lerna/lerna) to manage dependencies, compilations, and links between packages. Most lerna commands should be run by calling the provided npm scripts.
98+
- [npm workspaces](https://docs.npmjs.com/cli/v10/using-npm/workspaces)
99+
- [MochaJS](https://mochajs.org/) for tests
100+
- [eslint](https://eslint.org/)
101+
102+
Refer to the core repository for [supported runtimes](https://github.com/open-telemetry/opentelemetry-js#supported-runtimes).
103+
Refer to the root-level [package.json](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/package.json) for shared dev dependency versions, and the package-level package.json for package-specific versions if different or not included in the shared root.
104+
105+
### General guidance
75106

76107
The `opentelemetry-js-contrib` project is written in TypeScript.
77108

78-
- `npm install` to install dependencies.
109+
As a general rule, installing and then compiling from the root directory should always be done first before anything else.
110+
After making changes to a specific package, compile again from the specific package directory you are working in.
111+
Some tests depend on other packages to be installed, so these steps are also required for running tests.
112+
113+
- `npm ci` installs dependencies ([see npm-ci docs](https://docs.npmjs.com/cli/v10/commands/npm-ci))
79114
- `npm run compile` compiles the code, checking for type errors.
80-
- `npm test` tests code the same way that our CI will test it.
81-
- `npm run lint:fix` lint (and maybe fix) any changes.
115+
- `npm test` runs most unit tests, though some packages require other dependencies so are only run in CI or with a separate command in the package's `package.json` file.
116+
- `npm run lint:fix` lint any changes and fix if needed.
117+
118+
Each of these commands can also be run in individual packages, as long as the initial install and compile are done first in the root directory.
119+
120+
### CHANGELOG
121+
122+
The conventional commit type (in PR title) is very important to automatically bump versions on release. For instance:
82123

83-
### Generating CHANGELOG documentation
124+
- any type + `!` will bump major version (or minor on pre-release)
125+
- `feat` will bump minor
126+
- `fix` will bump patch
84127

85-
- `npm run changelog` to generate CHANGELOG documentation in your terminal (see [RELEASING.md](RELEASING.md) for more details).
128+
There is no need to update the CHANGELOG in a PR because it will be updated as part of the release process (see [RELEASING.md](RELEASING.md) for more details).
86129

87130
### Benchmarks
88131

@@ -154,9 +197,25 @@ They may not work and there are no guarantees for fixes or new features.
154197
Their source files may be deleted from the repository.
155198
Any packages released from their source will be marked as deprecated in NPM.
156199

157-
## Pull Request Merge Requirements
200+
## Pull Request Merge Guidelines
201+
202+
Pull requests MAY be merged by an approver OR a maintainer provided they meet all the following [General Merge Requirements](#general-merge-requirements).
203+
All requirements are at the discretion of the maintainers.
204+
Maintainers MAY merge pull requests which have not strictly met these requirements.
205+
Maintainers MAY close, block, or put on hold pull requests even if they have strictly met these requirements.
206+
207+
It is generally expected that a maintainer ([@open-telemetry/javascript-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers)) should review and merge major changes.
208+
Some examples include, but are not limited to:
209+
210+
- Breaking changes
211+
- New modules
212+
- Changes which affect runtime support
213+
214+
If a PR has not been interacted with by a reviewer within one week, please ping the component
215+
owners as listed in [.github/component_owners.yml](.github/component_owners.yml), if component owners are unresponsive
216+
please ping ([@open-telemetry/javascript-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers)).
158217

159-
Pull requests MAY be merged by an approver OR a maintainer provided they meet all the following requirements:
218+
### General Merge Requirements
160219

161220
- Approved by
162221
- at least one component owner if one is defined in [.github/component_owners.yml](.github/component_owners.yml)
@@ -173,14 +232,6 @@ Pull requests MAY be merged by an approver OR a maintainer provided they meet al
173232
- New or changed functionality is documented if appropriate
174233
- Substantial changes should not be merged within 24 hours of opening in order to allow reviewers from all time zones to have a chance to review
175234

176-
All requirements are at the discretion of the maintainers.
177-
Maintainers MAY merge pull requests which have not strictly met these requirements.
178-
Maintainers MAY close, block, or put on hold pull requests even if they have strictly met these requirements.
179-
180-
If a PR has not been interacted with by a reviewer within one week, please ping the component
181-
owners as listed in [.github/component_owners.yml](.github/component_owners.yml), if component owners are unresponsive
182-
please ping ([@open-telemetry/javascript-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers)).
183-
184235
## Contributing Vendor Components
185236

186237
This repo is generally meant for hosting components that work with popular open-source frameworks and tools. However, it is also possible to contribute components specific to a 3rd party vendor in this repo.

0 commit comments

Comments
 (0)