From ee5e1e0628181a4d19aaebe7d0aa517bbaf6e2e4 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Thu, 9 May 2024 10:16:47 -0700 Subject: [PATCH] [repo] Automatically add area labels when new issue is opened (#5601) --- .../{bug_report.yaml => bug_report.yml} | 18 +++++------ ...ature_request.yaml => feature_request.yml} | 0 .../{question.yaml => question.yml} | 0 .github/workflows/add-labels.yml | 30 +++++++++++++++++++ OpenTelemetry.sln | 8 +++-- 5 files changed, 44 insertions(+), 12 deletions(-) rename .github/ISSUE_TEMPLATE/{bug_report.yaml => bug_report.yml} (83%) rename .github/ISSUE_TEMPLATE/{feature_request.yaml => feature_request.yml} (100%) rename .github/ISSUE_TEMPLATE/{question.yaml => question.yml} (100%) create mode 100644 .github/workflows/add-labels.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yml similarity index 83% rename from .github/ISSUE_TEMPLATE/bug_report.yaml rename to .github/ISSUE_TEMPLATE/bug_report.yml index 949f3cfcb38..6cc1d362908 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -5,15 +5,15 @@ body: - type: markdown attributes: value: | - Thanks for taking the time to fill out this bug report! Please make sure to fill out the entire form below, providing as much context as you can in order to help us triage and track down your bug as quickly as possible. + Thanks for taking the time to fill out this bug report! Please make sure to fill out the entire form below, providing as much context as you can in order to help us triage and track down the bug as quickly as possible. - Before filing a bug, please be sure you have searched through [existing bugs](https://github.com/open-telemetry/opentelemetry-dotnet/issues?q=is%3Aissue+is%3Aopen+label%3Abug) to see if an existing issue covers your bug. + Before filing a bug, please be sure you have searched through [existing bugs](https://github.com/open-telemetry/opentelemetry-dotnet/issues?q=is%3Aissue+is%3Aopen+label%3Abug) to see if an existing issue covers the bug. - type: dropdown id: area attributes: - label: Area(s) - description: Which area(s) does your bug report concern? If none fits, please select `area:other` + label: Area + description: Which area does this bug report concern? If none fits, please select `area:other` multiple: false options: - area:other @@ -28,7 +28,7 @@ body: - type: textarea attributes: - label: Package version + label: Package Version description: List of [all OpenTelemetry NuGet packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are using (e.g. `OpenTelemetry 1.0.2`) value: | | Package Name | Version | @@ -41,8 +41,8 @@ body: - type: input attributes: - label: Runtime version - description: What .NET runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can find this information from the `*.csproj` file) did you use? + 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) validations: required: true @@ -63,7 +63,7 @@ body: - type: textarea attributes: label: Expected Result - description: What did you expect to see? + description: What did you expect to see? validations: required: true @@ -76,5 +76,5 @@ body: - type: textarea attributes: - label: Additional context + label: Additional Context description: Any additional information you think may be relevant to this issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.yaml rename to .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/question.yaml b/.github/ISSUE_TEMPLATE/question.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/question.yaml rename to .github/ISSUE_TEMPLATE/question.yml diff --git a/.github/workflows/add-labels.yml b/.github/workflows/add-labels.yml new file mode 100644 index 00000000000..376c891bb73 --- /dev/null +++ b/.github/workflows/add-labels.yml @@ -0,0 +1,30 @@ +name: 'Add labels for area found in bug issue descriptions' +on: + issues: + types: [opened] + +permissions: + issues: write + +jobs: + add-labels: + if: ${{ !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 + shell: pwsh + run: | + $match = [regex]::Match('${{ github.event.issue.body }}', '^[#]+ Area\s*?(area:\w+)') + if ($match.Success -eq $false) + { + Return + } + + gh issue edit ${{ github.event.issue.number }} ` + --add-label $match.Groups[1].Value + env: + GH_TOKEN: ${{ github.token }} diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln index 5f0bbaeb084..28cdb947fd9 100644 --- a/OpenTelemetry.sln +++ b/OpenTelemetry.sln @@ -41,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E build\OpenTelemetry.prod.ruleset = build\OpenTelemetry.prod.ruleset build\OpenTelemetry.test.ruleset = build\OpenTelemetry.test.ruleset build\RELEASING.md = build\RELEASING.md + build\sanitycheck.py = build\sanitycheck.py build\stylecop.json = build\stylecop.json build\test-aot-compatibility.ps1 = build\test-aot-compatibility.ps1 build\test-threadSafety.ps1 = build\test-threadSafety.ps1 @@ -82,13 +83,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F1D0 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{A533C800-3DC3-4D04-90A7-0CE7A1E6BDB3}" ProjectSection(SolutionItems) = preProject - .github\ISSUE_TEMPLATE\bug_report.md = .github\ISSUE_TEMPLATE\bug_report.md - .github\ISSUE_TEMPLATE\feature_request.md = .github\ISSUE_TEMPLATE\feature_request.md - .github\ISSUE_TEMPLATE\question.md = .github\ISSUE_TEMPLATE\question.md + .github\ISSUE_TEMPLATE\bug_report.yml = .github\ISSUE_TEMPLATE\bug_report.yml + .github\ISSUE_TEMPLATE\feature_request.yml = .github\ISSUE_TEMPLATE\feature_request.yml + .github\ISSUE_TEMPLATE\question.yml = .github\ISSUE_TEMPLATE\question.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E69578EB-B456-4062-A645-877CD964528B}" ProjectSection(SolutionItems) = preProject + .github\workflows\add-labels.yml = .github\workflows\add-labels.yml .github\workflows\ci.yml = .github\workflows\ci.yml .github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml .github\workflows\Component.BuildTest.yml = .github\workflows\Component.BuildTest.yml