Skip to content

Commit f9b8ff4

Browse files
authored
[chore][CONTRIBUTING.md] Add test instructions and reorder and improve sections (#40100)
#### Documentation Add a test section to the contributing guideline, also reorder and improve other sections. It aims to put the section in the order a new contributor would need them.
1 parent 1260979 commit f9b8ff4

File tree

1 file changed

+108
-62
lines changed

1 file changed

+108
-62
lines changed

CONTRIBUTING.md

Lines changed: 108 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,79 @@
11
# Contributing
22

3-
If you would like to contribute please read OpenTelemetry Collector [contributing
4-
guidelines](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md) before you begin your
5-
work.
3+
If you would like to contribute please read OpenTelemetry core Collector [contributing
4+
guidelines](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md)
5+
before you begin your work with the contrib Collector.
66

7-
## Pull-requests
7+
## Local Testing
88

9-
### Title guidelines
9+
To manually test your changes, follow these steps to build and run the contrib
10+
Collector locally. Ensure that you execute these commands from the root of the
11+
repository:
1012

11-
The title for your pull-request should contain the component type and name in brackets, plus a short statement for your
12-
change. For instance:
13+
1. Build the Collector:
1314

14-
[processor/tailsampling] fix AND policy
15+
```shell
16+
make otelcontribcol
17+
```
1518

16-
### Description guidelines
19+
2. Run the contrib Collector with a local configuration file:
1720

18-
When linking to an open issue, if your PR is meant to close said issue, please prefix your issue with one of the
19-
following keywords: `Resolves`, `Fixes`, or `Closes`. More information on this functionality (and more keyword options) can be found
20-
[here](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).
21-
This will automatically close the issue once your PR has been merged.
21+
```shell
22+
./bin/otelcontribcol_<os>_<arch> --config otel-config.yaml
23+
```
24+
25+
The actual name of the binary will depend on your platform. For example, on Linux x64, use `./bin/otelcontribcol_linux_amd64`.
26+
27+
Replace `otel-config.yaml` with the appropriate configuration file as needed.
28+
29+
3. Verify that your changes are reflected in the contrib Collector's behavior by
30+
testing it against the provided configuration.
31+
32+
4. Lint your changes:
33+
34+
- For the entire project:
35+
```shell
36+
make golint
37+
```
38+
39+
- For specific components (e.g., Elasticsearch exporter):
40+
```shell
41+
cd exporter/elasticsearchexporter/
42+
make lint
43+
```
44+
45+
5. Run the unit tests:
46+
47+
- Run tests for the whole project from the project root:
48+
```shell
49+
make gotest
50+
```
51+
- Alternatively, run tests for the affected components. For example, to run the Elasticsearch exporter tests:
52+
```shell
53+
cd exporter/elasticsearchexporter/
54+
make test
55+
```
2256

2357
## Changelog
2458

2559
### Overview
2660

27-
There are two Changelogs for this repository:
61+
There are two auto generated Changelogs for this repository:
2862

2963
- `CHANGELOG.md` is intended for users of the collector and lists changes that affect the behavior of the collector.
3064
- `CHANGELOG-API.md` is intended for developers who are importing packages from the collector codebase.
3165

66+
They are autogenerated from `.yaml` files in the `./.chloggen` directory.
67+
68+
### Adding a Changelog Entry
69+
70+
1. Create an entry file using `make chlog-new`. This generates a file based on your current branch (e.g. `./.chloggen/my-branch.yaml`)
71+
2. Fill in all fields in the new file
72+
3. Run `make chlog-validate` to ensure the new file is valid
73+
4. Commit and push the file
74+
75+
During the collector release process, all `./chloggen/*.yaml` files are transcribed into `CHANGELOG.md` and `CHANGELOG-API.md` and then deleted.
76+
3277
### When to add a Changelog Entry
3378

3479
Pull requests that contain user-facing changes will require a changelog entry. Keep in mind the following types of users:
@@ -37,7 +82,7 @@ Pull requests that contain user-facing changes will require a changelog entry. K
3782
3. Those who are depending on APIs exported from collector packages
3883
4. Those who are contributing to the repository
3984

40-
Changes that affect the first two groups should be noted in `CHANGELOG.md`. Changes that affect the third or forth groups should be noted in `CHANGELOG-API.md`.
85+
Changes that affect the first two groups should be noted in `CHANGELOG.md`. Changes that affect the third or fourth groups should be noted in `CHANGELOG-API.md`.
4186

4287
If a changelog entry is not required, a maintainer or approver will add the `Skip Changelog` label to the pull request.
4388

@@ -61,21 +106,59 @@ No changelog entry:
61106
- Most changes to tests
62107
- Chores, such as enabling linters, or minor changes to the CI process
63108

64-
### Adding a Changelog Entry
109+
## Pull-requests
65110

66-
The [CHANGELOG.md](./CHANGELOG.md) and [CHANGELOG-API.md](./CHANGELOG-API.md) files in this repo is autogenerated from `.yaml` files in the `./.chloggen` directory.
111+
### Title guidelines
67112

68-
Your pull-request should add a new `.yaml` file to this directory. The name of your file must be unique since the last release.
113+
The title for your pull-request should contain the component type and name in brackets, plus a short statement for your
114+
change. For instance:
69115

70-
During the collector release process, all `./chloggen/*.yaml` files are transcribed into `CHANGELOG.md` and `CHANGELOG-API.md` and then deleted.
116+
[processor/tailsampling] fix AND policy
71117

72-
**Recommended Steps**
73-
1. Create an entry file using `make chlog-new`. This generates a file based on your current branch (e.g. `./.chloggen/my-branch.yaml`)
74-
2. Fill in all fields in the new file
75-
3. Run `make chlog-validate` to ensure the new file is valid
76-
4. Commit and push the file
118+
### Description guidelines
119+
120+
When linking to an open issue, if your PR is meant to close said issue, please prefix your issue with one of the
121+
following keywords: `Resolves`, `Fixes`, or `Closes`. More information on this functionality (and more keyword options) can be found
122+
[here](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).
123+
This will automatically close the issue once your PR has been merged.
77124

78-
Alternately, copy `./.chloggen/TEMPLATE.yaml`, or just create your file from scratch.
125+
126+
## Issue Triaging
127+
128+
See [issue-triaging.md](./issue-triaging.md) for more information on the issue triaging process.
129+
130+
### Adding Labels via Comments
131+
132+
In order to facilitate proper label usage and to empower Code Owners, you are able to add labels to issues via comments. To add a label through a comment, post a new comment on an issue starting with `/label`, followed by a space-separated list of your desired labels. Supported labels come from the table below, or correspond to a component defined in the [CODEOWNERS file](.github/CODEOWNERS).
133+
134+
The following general labels are supported:
135+
136+
| Label | Label in Comment |
137+
|---------------------------|---------------------------|
138+
| `arm64` | `arm64` |
139+
| `good first issue` | `good-first-issue` |
140+
| `help wanted` | `help-wanted` |
141+
| `discussion needed` | `discussion-needed` |
142+
| `needs triage` | `needs-triage` |
143+
| `os:mac` | `os:mac` |
144+
| `os:windows` | `os:windows` |
145+
| `waiting for author` | `waiting-for-author` |
146+
| `waiting-for-code-owners` | `waiting-for-code-owners` |
147+
| `bug` | `bug` |
148+
| `priority:p0` | `priority:p0` |
149+
| `priority:p1` | `priority:p1` |
150+
| `priority:p2` | `priority:p2` |
151+
| `priority:p3` | `priority:p3` |
152+
| `Stale` | `stale` |
153+
| `never stale` | `never-stale` |
154+
155+
To delete a label, prepend the label with `-`. Note that you must make a new comment to modify labels; you cannot edit an existing comment.
156+
157+
Example label comment:
158+
159+
```
160+
/label receiver/prometheus help-wanted -exporter/prometheus
161+
```
79162

80163
## Portable Code
81164

@@ -264,43 +347,6 @@ in general try to follow them.
264347
- `replace` statements in `go.mod` files can be automatically inserted by running `make crosslink`. For more information
265348
on the `crosslink` tool see the README [here](https://github.com/open-telemetry/opentelemetry-go-build-tools/tree/main/crosslink).
266349
267-
## Issue Triaging
268-
269-
See [issue-triaging.md](./issue-triaging.md) for more information on the issue triaging process.
270-
271-
### Adding Labels via Comments
272-
273-
In order to facilitate proper label usage and to empower Code Owners, you are able to add labels to issues via comments. To add a label through a comment, post a new comment on an issue starting with `/label`, followed by a space-separated list of your desired labels. Supported labels come from the table below, or correspond to a component defined in the [CODEOWNERS file](.github/CODEOWNERS).
274-
275-
The following general labels are supported:
276-
277-
| Label | Label in Comment |
278-
|---------------------------|---------------------------|
279-
| `arm64` | `arm64` |
280-
| `good first issue` | `good-first-issue` |
281-
| `help wanted` | `help-wanted` |
282-
| `discussion needed` | `discussion-needed` |
283-
| `needs triage` | `needs-triage` |
284-
| `os:mac` | `os:mac` |
285-
| `os:windows` | `os:windows` |
286-
| `waiting for author` | `waiting-for-author` |
287-
| `waiting-for-code-owners` | `waiting-for-code-owners` |
288-
| `bug` | `bug` |
289-
| `priority:p0` | `priority:p0` |
290-
| `priority:p1` | `priority:p1` |
291-
| `priority:p2` | `priority:p2` |
292-
| `priority:p3` | `priority:p3` |
293-
| `Stale` | `stale` |
294-
| `never stale` | `never-stale` |
295-
296-
To delete a label, prepend the label with `-`. Note that you must make a new comment to modify labels; you cannot edit an existing comment.
297-
298-
Example label comment:
299-
300-
```
301-
/label receiver/prometheus help-wanted -exporter/prometheus
302-
```
303-
304350
## Membership, Roles, and Responsibilities
305351
306352
### Membership levels

0 commit comments

Comments
 (0)