Skip to content

Commit 7a09ef7

Browse files
authored
[docs] Contributing and releasing doc updates (open-telemetry#2091)
1 parent b8577b5 commit 7a09ef7

File tree

4 files changed

+270
-125
lines changed

4 files changed

+270
-125
lines changed

.markdownlint.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Default state for all rules
22
default: true
33

4-
# allow long lines for tables and code blocks
4+
# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md013.md
55
MD013:
66
code_blocks: false
77
tables: false
8+
9+
# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md033.md
10+
MD033:
11+
# Allowed elements
12+
allowed_elements: [ 'details', 'summary' ]

CONTRIBUTING.md

Lines changed: 117 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ for a summary description of past meetings. To request edit access, join the
1010
meeting or get in touch on
1111
[Slack](https://cloud-native.slack.com/archives/C01N3BC2W7Q).
1212

13-
## Find a Buddy and Get Started Quickly
13+
Anyone may contribute but there are benefits of being a member of our community.
14+
See the [community membership
15+
document](https://github.com/open-telemetry/community/blob/main/community-membership.md)
16+
on how to become a
17+
[**Member**](https://github.com/open-telemetry/community/blob/main/community-membership.md#member),
18+
[**Approver**](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver)
19+
and
20+
[**Maintainer**](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).
21+
22+
## Find a buddy and get started quickly
1423

1524
If you are looking for someone to help you find a starting point and be a
1625
resource for your first contribution, join our Slack channel and find a buddy!
@@ -25,19 +34,19 @@ resource for your first contribution, join our Slack channel and find a buddy!
2534

2635
Your OpenTelemetry buddy is your resource to talk to directly on all aspects of
2736
contributing to OpenTelemetry: providing context, reviewing PRs, and helping
28-
those get merged. Buddies will not be available 24/7, but is committed to
29-
responding during their normal contribution hours.
37+
those get merged. Buddies will not be available 24/7, but are committed to
38+
responding during their normal working hours.
3039

3140
## Development Environment
3241

33-
You can contribute to this project from a Windows, macOS or Linux machine.
42+
You can contribute to this project from a Windows, macOS, or Linux machine.
3443

3544
On all platforms, the minimum requirements are:
3645

37-
* Git client and command line tools.
38-
* .NET 8.0+
46+
* Git client and command line tools
47+
* [.NET SDK (latest stable version)](https://dotnet.microsoft.com/download)
3948

40-
Please note that individual project requirements might vary.
49+
Please note that individual project requirements may vary.
4150

4251
### Linux or MacOS
4352

@@ -52,9 +61,24 @@ are disabled outside of Windows.
5261
* Visual Studio 2022+ or Visual Studio Code
5362
* .NET Framework 4.6.2+
5463

64+
## Public API validation
65+
66+
It is critical to **NOT** make breaking changes to public APIs which have been
67+
released in stable builds. We also strive to keep a minimal public API surface.
68+
This repository is using
69+
[Microsoft.CodeAnalysis.PublicApiAnalyzers](https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)
70+
and [Package
71+
validation](https://learn.microsoft.com/dotnet/fundamentals/apicompat/package-validation/overview)
72+
to validate public APIs.
73+
74+
For details about working with these packages and updating "public API files"
75+
when new APIs are added see: [OpenTelemetry .NET > Contributing to
76+
opentelemetry-dotnet > Public API
77+
validation](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/CONTRIBUTING.md#public-api-validation).
78+
5579
## Pull Requests
5680

57-
### How to Send Pull Requests
81+
### How to create pull requests
5882

5983
Everyone is welcome to contribute code to `opentelemetry-dotnet-contrib` via
6084
GitHub pull requests (PRs).
@@ -114,17 +138,20 @@ $ git push fork feature
114138

115139
Open a pull request against the main `opentelemetry-dotnet-contrib` repo.
116140

117-
### How to Receive Comments
141+
#### Tips and best practices for pull requests
118142

119143
* If the PR is not ready for review, please mark it as
120144
[`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/).
121-
* Make sure CLA is signed and CI is clear.
122-
* Submit small, focused PRs addressing a single concern/issue.
145+
* Make sure CLA is signed and all required CI checks are clear.
146+
* Submit small, focused PRs addressing a single
147+
concern/issue.
123148
* Make sure the PR title reflects the contribution.
124149
* Write a summary that helps understand the change.
125150
* Include usage examples in the summary, where applicable.
151+
* Include benchmarks (before/after) in the summary, for contributions that are
152+
performance enhancements.
126153

127-
### How to Get PRs Merged
154+
### How to get pull requests merged
128155

129156
A PR is considered to be **ready to merge** when:
130157

@@ -133,48 +160,42 @@ A PR is considered to be **ready to merge** when:
133160
/
134161
[Maintainers](https://github.com/open-telemetry/community/blob/master/community-membership.md#maintainer)
135162
or the respective component owner.
136-
* Major feedbacks are resolved.
163+
* Major feedback/comments are resolved.
137164
* It has been open for review for at least one working day. This gives people
138165
reasonable time to review.
139-
* Trivial change (typo, cosmetic, doc, etc.) doesn't have to wait for one day.
140-
* Urgent fix can take exception as long as it has been actively communicated.
141-
142-
Any Maintainer can merge the PR once it is **ready to merge**. Note that some
143-
PR may not be merged immediately if repo is being in process of a major release
144-
and the new feature doesn't fit it.
166+
* Trivial change (typo, cosmetic, doc, etc.) doesn't have to wait for one day.
167+
* Urgent fix can take exception as long as it has been actively communicated.
145168

146-
### How to request for release of package
169+
Any maintainer can merge PRs once they are **ready to merge** however
170+
maintainers might decide to wait on merging changes until there are more
171+
approvals and/or dicussion, or based on other factors such as release timing and
172+
risk to users. For example if a stable release is planned and a new change is
173+
introduced adding public API(s) or behavioral changes it might be held until the
174+
next alpha/beta release.
147175

148-
* Submit a PR with `CHANGELOG.md` file reflecting the version to be released
149-
along with the date in the following format `yyyy-MMM-dd`.
150-
151-
For example:
152-
153-
```text
154-
## 1.2.0-beta.2
155-
156-
Released 2022-Jun-21
157-
```
176+
## Release process
158177

159-
* Tag the maintainers of this repository
160-
(@open-telemetry/dotnet-contrib-maintainers) who can release the package.
178+
For details about the release process and information about how to request a
179+
release for a component in this repository see: [Requesting a
180+
release](./build/RELEASING.md#requesting-a-release).
161181

162-
## Style Guide
182+
## Style guide
163183

164184
This project includes a
165185
[`.editorconfig`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/master/.editorconfig)
166-
file which is supported by all the IDEs/editor mentioned above. It works with
186+
file which is supported by all the IDEs/editors mentioned above. It works with
167187
the IDE/editor only and does not affect the actual build of the project.
168188

169189
This repository also includes [stylecop ruleset
170190
files](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/master/build).
171191
These files are used to configure the _StyleCop.Analyzers_ which runs during
172192
build. Breaking the rules will result in a build failure.
173193

174-
## Contributing a new project
194+
## New projects
175195

176-
This repo is a great place to contribute a new instrumentation, exporter or any
177-
kind of extension. Please refer to [this
196+
This repo is a great place to contribute exporters, instrumentation libraries,
197+
resource detectors, samplers, or any other kind of extension/component not
198+
explicitly defined in the OpenTelemetry Specification. Please refer to [this
178199
page](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/docs/trace/extending-the-sdk/README.md#extending-the-opentelemetry-net-sdk)
179200
for help writing your component.
180201

@@ -194,77 +215,78 @@ within `/src` and corresponding test project within `/test`, here are a few
194215
things you should do to ensure that your project is automatically built and
195216
shipped through CI.
196217

197-
* Based on what your project is, you may need to depend on the [OpenTelemetry
198-
SDK](https://www.nuget.org/packages/OpenTelemetry) or the [OpenTelemetry
199-
API](https://www.nuget.org/packages/OpenTelemetry.Api) Include the necessary
200-
package in your project. You can choose the version that you want to depend on.
201-
Usually, it is a good idea to use the latest stable version. For example:
202-
203-
```xml
204-
<ItemGroup>
205-
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
206-
</ItemGroup>
207-
```
208-
209-
* If your component relies on new features not yet part of the stable release, you
210-
can refer to the latest pre-release version.
218+
> [!NOTE]
219+
> It is generally helpful to reference a previous pull request when adding a new
220+
project to the repository. A good example to follow is the pull request which
221+
added the `OpenTelemetry.Resources.OperatingSystem` project:
222+
[#1943](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1943).
211223

212-
```xml
213-
<ItemGroup>
214-
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestPrereleaseVersion)" />
215-
</ItemGroup>
216-
```
224+
* Based on what your project is, you may need to depend on the [OpenTelemetry
225+
SDK](https://www.nuget.org/packages/OpenTelemetry) or the [OpenTelemetry
226+
API](https://www.nuget.org/packages/OpenTelemetry.Api) Include the necessary
227+
package in your project. You can choose the version that you want to depend
228+
on. Usually, it is a good idea to use the latest stable version. For example:
229+
230+
```xml
231+
<ItemGroup>
232+
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
233+
</ItemGroup>
234+
```
235+
236+
* If your component relies on new features not yet part of the stable release,
237+
you can refer to the latest pre-release version.
238+
239+
```xml
240+
<ItemGroup>
241+
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestPrereleaseVersion)" />
242+
</ItemGroup>
243+
```
217244

218245
* The assembly and nuget versioning is managed through
219-
[MinVer](https://github.com/adamralph/minver) for all the projects in the repo.
220-
MinVer will assign the version to your project based on the tag prefix specified
221-
by you. To ensure your project is versioned appropriately, specify a
222-
`<MinVerTagPrefix>` property in your project file. If your project is named as
223-
"OpenTelemetry.Instrumentation.FooBar", the MinVerTagPrefix must be
224-
"Instrumentation.FooBar-". Example:
225-
226-
```xml
227-
<PropertyGroup>
228-
<MinVerTagPrefix>Instrumentation.FooBar-</MinVerTagPrefix>
229-
</PropertyGroup>
230-
```
231-
232-
* Public API of all packages is analyzed by
233-
[Microsoft.CodeAnalysis.PublicApiAnalyzers](https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/Microsoft.CodeAnalysis.PublicApiAnalyzers.md).
234-
This analyzer requires files structure to store the information about public API.
235-
Create `PublicAPI.Shipped.txt` and `PublicAPI.Unshipped.txt` for each `TargetFramework`
236-
defined in csproj under `{ProjectFolder}\.publicApi\{TargetFramework}`.
237-
238-
* To build and release your project as nuget, you must provide a GitHub workflow
239-
to be triggered when a tag with prefix "Instrumentation.FooBar-" is pushed to
240-
the main branch. The workflow file should be named as
241-
`package-Instrumentation.FooBar.yml` and to be placed in the
242-
`.github/workflows/` folder.
243-
244-
You can copy one of the [existing workflow
245-
files](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/.github/workflows/package-Instrumentation.AspNet.yml)
246-
and replace the workflow
247-
[`name`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/.github/workflows/package-Instrumentation.AspNet.yml#L1)
248-
with "Pack OpenTelemetry.Instrumentation.FooBar",
249-
[`tags`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/.github/workflows/package-Instrumentation.AspNet.yml#L12)
250-
with "Instrumentation.FooBar-*" and
251-
[`PROJECT`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/.github/workflows/package-Instrumentation.AspNet.yml#L18)
252-
with "OpenTelemetry.Instrumentation.FooBar".
246+
[MinVer](https://github.com/adamralph/minver) for all the projects in the
247+
repo. MinVer will assign the version to your project based on the tag prefix
248+
specified by you. To ensure your project is versioned appropriately, specify a
249+
`<MinVerTagPrefix>` property in your project file. If your project is named as
250+
"OpenTelemetry.Instrumentation.FooBar", the MinVerTagPrefix must be
251+
"Instrumentation.FooBar-". Example:
252+
253+
```xml
254+
<PropertyGroup>
255+
<MinVerTagPrefix>Instrumentation.FooBar-</MinVerTagPrefix>
256+
</PropertyGroup>
257+
```
258+
259+
* The public API surface of all packages is analyzed by
260+
[Microsoft.CodeAnalysis.PublicApiAnalyzers](https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/Microsoft.CodeAnalysis.PublicApiAnalyzers.md).
261+
This analyzer requires a specific file structure to store the information
262+
about public API. See [this
263+
doc](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/CONTRIBUTING.md#enable-public-api-validation-in-new-projects)
264+
for help setting up public API analysis.
265+
266+
* Update the [CI
267+
workflow](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/.github/workflows/ci.yml)
268+
so that it builds your new project and update the [code
269+
coverage](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/.github/codecov.yml)
270+
definition for your new component (it should match what you define in the CI
271+
workflow).
253272

254273
* Add your component name to the [issue
255274
templates](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/.github/ISSUE_TEMPLATE/)
256275
in your PR. The maintainer will help to create a new ["comp:"
257276
label](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/labels?q=comp%3A)
258277
once the PR is merged.
259278

260-
* Add a README file for your project describing how to install and use your
279+
* Add a `README.md` file for your project describing how to install and use your
261280
package. Every project's README file needs to have a link to the Nuget
262281
package. You can use the below snippet for reference:
263282

264-
```md
265-
[![NuGet version badge](https://img.shields.io/nuget/v/{your_package_name})](https://www.nuget.org/packages/{your_package_name})
266-
[![NuGet download count badge](https://img.shields.io/nuget/dt/{your_package_name})](https://www.nuget.org/packages/{your_package_name})
267-
```
283+
```md
284+
[![NuGet version badge](https://img.shields.io/nuget/v/{your_package_name})](https://www.nuget.org/packages/{your_package_name})
285+
[![NuGet download count badge](https://img.shields.io/nuget/dt/{your_package_name})](https://www.nuget.org/packages/{your_package_name})
286+
```
287+
288+
* Add a `CHANGELOG.md` file for your project to track changes made after the
289+
initial pull request.
268290

269291
### Guidance for components on supporting target frameworks
270292

0 commit comments

Comments
 (0)