diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e5ef779df58..39203dabfb6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,11 +1,13 @@ -Fixes #. +Fixes # +Design discussion issue # ## Changes Please provide a brief description of the changes here. -For significant contributions please make sure you have completed the following items: +## Merge requirement checklist -* [ ] Appropriate `CHANGELOG.md` updated for non-trivial changes -* [ ] Design discussion issue # -* [ ] Changes in public API reviewed +* [ ] [CONTRIBUTING](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/CONTRIBUTING.md) guidelines followed (nullable enabled, static analysis, etc.) +* [ ] Unit tests added/updated +* [ ] Appropriate `CHANGELOG.md` files updated for non-trivial changes +* [ ] Changes in public API reviewed (if applicable) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9aec1d40d9c..c3ed947ad40 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -214,3 +214,42 @@ only and does not affect the actual build of the project. This repository also includes StyleCop ruleset files under the `./build` folder. These files are used to configure the _StyleCop.Analyzers_ which runs during build. Breaking the rules will result in a build failure. + +## New projects + +New projects are required to: + +* Use [nullable reference +types](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/nullable-reference-types). + + This should be enabled automatically via + [Common.props](https://github.com/open-telemetry/opentelemetry-dotnet/blob/990deee419ab4c1449efd628bed3df57a50963a6/build/Common.props#L9). + New project MUST NOT disable this. + +* Pass [static +analysis](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/overview). + + New projects MUST enable static analysis by specifying + `latest-all` in the project file (`.csproj`). + +> **Note** +> There are other project-level features enabled automatically via +[Common.props](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/build/Common.props) +new projects must NOT manually override these settings. + +## New code + +New code files MUST enable [nullable reference +types](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/nullable-reference-types) +manually in projects where it is not automatically enabled project-wide. This is +done by specifying `#nullable enable` towards the top of the file (usually after +the copyright header). We are currently working towards enabling nullable +context in every project by updating code as it is worked on, this requirement +is to make sure the surface area of code needing updates is shrinking and not +expanding. + +> **Note** +> The first time a project is updated to use nullable context in public APIs +some housekeeping needs to be done in public API definitions (`.publicApi` +folder). This can be done automatically via a code fix offered by the public API +analyzer. diff --git a/examples/MicroserviceExample/WebApi/WebApi.csproj b/examples/MicroserviceExample/WebApi/WebApi.csproj index 876450b7176..a27ffd0fa3b 100644 --- a/examples/MicroserviceExample/WebApi/WebApi.csproj +++ b/examples/MicroserviceExample/WebApi/WebApi.csproj @@ -1,6 +1,6 @@ - net6.0 + net7.0 diff --git a/examples/MicroserviceExample/WorkerService/WorkerService.csproj b/examples/MicroserviceExample/WorkerService/WorkerService.csproj index 926e55dd6fd..efcebbc5a9f 100644 --- a/examples/MicroserviceExample/WorkerService/WorkerService.csproj +++ b/examples/MicroserviceExample/WorkerService/WorkerService.csproj @@ -1,6 +1,6 @@ - net6.0 + net7.0