Skip to content

Commit

Permalink
Merge from main.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed Nov 1, 2024
2 parents 5935c0b + ed1b27f commit 27628f2
Show file tree
Hide file tree
Showing 541 changed files with 10,180 additions and 4,809 deletions.
38 changes: 21 additions & 17 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ csharp_indent_labels = flush_left

# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion

# this. preferences
dotnet_style_qualification_for_field = true:suggestion
Expand All @@ -53,8 +53,8 @@ dotnet_style_qualification_for_event = true:suggestion
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# name all constant fields using PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
Expand All @@ -75,28 +75,31 @@ dotnet_style_readonly_field = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_object_initializer = true:suggestion
csharp_style_prefer_primary_constructors = false:none

# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:none

# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_methods = true:suggestion
dotnet_diagnostic.IDE0022.severity = suggestion # dotnet format doesn't respect the suggestion in the line above
csharp_style_expression_bodied_constructors = false:warning
csharp_style_expression_bodied_operators = true:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion

# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
Expand All @@ -113,6 +116,7 @@ csharp_style_prefer_range_operator = false:none
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_namespace_declarations = file_scoped:warning
dotnet_style_namespace_match_folder = false:none

# Space preferences
csharp_space_after_cast = false
Expand All @@ -128,10 +132,10 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion

# Code analyzers
# CA1031: Do not catch general exception types
Expand Down
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Bug report
title: "[bug] "
description: Create a report to help us improve
labels: ["bug"]
labels: [bug,needs-triage]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -47,7 +48,7 @@ body:
- type: input
attributes:
label: Runtime Version
description: What .NET runtime version did you use? (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can find this information from the `*.csproj` file)
description: What .NET runtime version did you use? (e.g. `net462`, `net48`, `net8.0`, etc. You can find this information from the `*.csproj` file)
validations:
required: true

Expand Down
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser

blank_issues_enabled: false
contact_links:
- name: Question
url: https://github.com/open-telemetry/opentelemetry-dotnet/discussions/new?category=q-a
about: Ask a question to help us improve our knowledge base and documentation.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Feature request
title: "[feature request] "
description: Suggest an idea for this project
labels: ["enhancement"]
labels: [enhancement,needs-triage]
body:
- type: markdown
attributes:
Expand Down
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/question.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ ignore:
- "test"

flags:
unittests-Solution-Stable:
unittests-Solution:
carryforward: true
paths:
- src

unittests-Solution-Experimental:
unittests-Project-Stable:
carryforward: true
paths:
- src

unittests-Instrumentation-Stable:
unittests-Project-Experimental:
carryforward: true
paths:
- src

unittests-Instrumentation-Experimental:
unittests-UnstableCoreLibraries-Experimental:
carryforward: true
paths:
- src
10 changes: 7 additions & 3 deletions .github/workflows/Component.BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ on:
required: false
type: string
os-list:
default: '[ "windows-latest", "ubuntu-latest" ]'
default: '[ "windows-latest", "ubuntu-latest", "otel-linux-arm64" ]'
required: false
type: string
tfm-list:
default: '[ "net462", "net6.0", "net7.0", "net8.0" ]'
default: '[ "net462", "net8.0", "net9.0" ]'
required: false
type: string

Expand All @@ -39,6 +39,10 @@ jobs:
exclude:
- os: ubuntu-latest
version: net462
- os: otel-linux-arm64
version: net462
- os: otel-linux-arm64
version: net8.0

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -65,7 +69,7 @@ jobs:
run: dotnet tool install -g dotnet-coverage

- name: Merging test results
run: dotnet-coverage merge -r -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/*.coverage
run: dotnet-coverage merge -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/**/*.coverage

- name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
uses: codecov/codecov-action@v4
Expand Down
44 changes: 37 additions & 7 deletions .github/workflows/add-labels.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,55 @@
name: 'Add labels for area found in bug issue descriptions'
name: 'Add labels to issues and pull requests'
on:
issues:
types: [opened]
types: [ opened ]

pull_request_target:
branches: [ 'main*' ]

permissions:
issues: write
pull-requests: write

jobs:
add-labels:
if: ${{ !github.event.issue.pull_request }}
add-labels-on-issues:
if: github.event_name == 'issues' && !github.event.issue.pull_request

runs-on: ubuntu-latest

steps:
- name: check out code
uses: actions/checkout@v4

- name: Add labels for areas found in bug issue descriptions
- name: Add labels for package found in bug issue descriptions
shell: pwsh
run: |
.\build\scripts\add-labels.ps1 -issueNumber $env:ISSUE_NUMBER -issueBody $env:ISSUE_BODY
Import-Module .\build\scripts\add-labels.psm1
AddLabelsOnIssuesForPackageFoundInBody `
-issueNumber ${{ github.event.issue.number }} `
-issueBody $env:ISSUE_BODY
env:
GH_TOKEN: ${{ github.token }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_BODY: ${{ github.event.issue.body }}

add-labels-on-pull-requests:
if: github.event_name == 'pull_request_target'

runs-on: ubuntu-latest

steps:
- name: check out code
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }} # Note: Do not run on the PR branch we want to execute add-labels.psm1 from main on the base repo only because pull_request_target can see secrets

- name: Add labels for files changed on pull requests
shell: pwsh
run: |
Import-Module .\build\scripts\add-labels.psm1
AddLabelsOnPullRequestsBasedOnFilesChanged `
-pullRequestNumber ${{ github.event.pull_request.number }} `
-labelPackagePrefix 'pkg:'
env:
GH_TOKEN: ${{ github.token }}
34 changes: 34 additions & 0 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Resolve automation settings

on:
workflow_call:
outputs:
enabled:
value: ${{ jobs.resolve-automation.outputs.enabled == 'true' }}
token-secret-name:
value: ${{ jobs.resolve-automation.outputs.token-secret-name }}
username:
value: ${{ vars.AUTOMATION_USERNAME }}
email:
value: ${{ vars.AUTOMATION_EMAIL }}
secrets:
OPENTELEMETRYBOT_GITHUB_TOKEN:
required: false

jobs:
resolve-automation:

runs-on: ubuntu-latest

outputs:
enabled: ${{ steps.evaluate.outputs.enabled }}
token-secret-name: ${{ steps.evaluate.outputs.token-secret-name }}

env:
OPENTELEMETRYBOT_GITHUB_TOKEN_EXISTS: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN != '' }}

steps:
- id: evaluate
run: |
echo "enabled=${{ env.OPENTELEMETRYBOT_GITHUB_TOKEN_EXISTS == 'true' }}" >> "$GITHUB_OUTPUT"
echo "token-secret-name=OPENTELEMETRYBOT_GITHUB_TOKEN" >> "$GITHUB_OUTPUT"
Loading

0 comments on commit 27628f2

Please sign in to comment.