Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/5661
Browse files Browse the repository at this point in the history
  • Loading branch information
jcin193 committed Jun 19, 2024
2 parents ef1ff92 + 4af3df9 commit 185ca98
Show file tree
Hide file tree
Showing 53 changed files with 893 additions and 242 deletions.
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
value: ${{ vars.AUTOMATION_EMAIL }}
secrets:
OPENTELEMETRYBOT_GITHUB_TOKEN:
required: true
required: false

jobs:
resolve-automation:
Expand Down
57 changes: 54 additions & 3 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,69 @@ on:
required: true
description: 'Release tag'
type: string

release:
types: [published]
types:
- published

issue_comment:
types:
- created

jobs:
automation:
uses: ./.github/workflows/automation.yml
secrets: inherit

post-release:
push-packages-and-publish-release:
runs-on: ubuntu-latest

needs: automation

if: |
github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& github.event.issue.locked == true
&& github.event.comment.user.login != needs.automation.outputs.username
&& contains(github.event.comment.body, '/PushPackages')
&& startsWith(github.event.issue.title, '[release] Prepare release ')
&& github.event.issue.pull_request.merged_at
&& needs.automation.outputs.enabled
env:
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}

steps:
- name: check out code
uses: actions/checkout@v4
with:
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
ref: ${{ github.event.repository.default_branch }}

- name: Push packages and publish release
shell: pwsh
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
run: |
Import-Module .\build\scripts\post-release.psm1
PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullRequest `
-gitRepository '${{ github.repository }}' `
-pullRequestNumber '${{ github.event.issue.number }}' `
-botUserName '${{ needs.automation.outputs.username }}' `
-commentUserName '${{ github.event.comment.user.login }}' `
-artifactDownloadPath '${{ github.workspace }}/artifacts' `
-pushToNuget '${{ secrets.NUGET_TOKEN != '' }}'
post-release-published:
runs-on: ubuntu-latest

needs:
- automation

if: needs.automation.outputs.enabled
if: |
needs.automation.outputs.enabled
&& (github.event_name == 'release' || github.event_name == 'workflow_dispatch')
env:
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
Expand All @@ -35,6 +83,9 @@ jobs:
ref: ${{ github.event.repository.default_branch }}
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}

- name: Setup dotnet
uses: actions/setup-dotnet@v4

- name: Create GitHub Pull Request to update stable build version in props
if: |
(github.ref_type == 'tag' && startsWith(github.ref_name, 'core-') && !contains(github.ref_name, '-alpha') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc'))
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
&& github.event.action == 'closed'
&& github.event.pull_request.user.login == needs.automation.outputs.username
&& github.event.pull_request.merged == true
&& startsWith(github.event.pull_request.title, '[repo] Prepare release ')
&& startsWith(github.event.pull_request.title, '[release] Prepare release ')
&& needs.automation.outputs.enabled
env:
Expand All @@ -89,7 +89,7 @@ jobs:
-pullRequestNumber '${{ github.event.pull_request.number }}' `
-botUserName '${{ needs.automation.outputs.username }}'
create-release-tag-unlock-pr-post-notice:
create-release-tag-pr-post-notice:
runs-on: ubuntu-latest

needs: automation
Expand All @@ -100,7 +100,7 @@ jobs:
&& github.event.issue.locked == true
&& github.event.comment.user.login != needs.automation.outputs.username
&& contains(github.event.comment.body, '/CreateReleaseTag')
&& startsWith(github.event.issue.title, '[repo] Prepare release ')
&& startsWith(github.event.issue.title, '[release] Prepare release ')
&& github.event.issue.pull_request.merged_at
&& needs.automation.outputs.enabled
Expand All @@ -127,3 +127,4 @@ jobs:
-botUserName '${{ needs.automation.outputs.username }}' `
-gitUserName '${{ needs.automation.outputs.username }}' `
-gitUserEmail '${{ needs.automation.outputs.email }}'
4 changes: 2 additions & 2 deletions .github/workflows/publish-packages-1.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ github.ref_name }}-packages
path: '**/bin/**/*.*nupkg'
path: 'src/**/*.*nupkg'

- name: Publish MyGet
env:
MYGET_TOKEN_EXISTS: ${{ secrets.MYGET_TOKEN != '' }}
if: env.MYGET_TOKEN_EXISTS == 'true' # Skip MyGet publish if run on a fork without the secret
run: |
nuget setApiKey ${{ secrets.MYGET_TOKEN }} -Source https://www.myget.org/F/opentelemetry/api/v2/package
nuget push **/bin/**/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
nuget push src/**/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
post-build:
runs-on: ubuntu-latest
Expand Down
42 changes: 18 additions & 24 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<OTelLatestStableVer>1.8.1</OTelLatestStableVer>
<OTelLatestStableVer>1.9.0</OTelLatestStableVer>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -35,12 +35,12 @@
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.0" />

<PackageVersion Include="OpenTelemetry" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Api" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Api.ProviderBuilderExtensions" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Extensions.Propagators" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Api" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Api.ProviderBuilderExtensions" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Extensions.Propagators" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTracing" Version="[0.12.1,0.13)" />

<!--
Expand Down Expand Up @@ -70,7 +70,7 @@
-->
<!-- 'net8.0' is the default `TargetFramework`. Use `VersionOverride` in the project to override the package versions from a different `TargetFramework` -->
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="[0.13.10,0.14)" />
<PackageVersion Include="BenchmarkDotNet" Version="[0.13.12,0.14)" />
<PackageVersion Include="CommandLineParser" Version="[2.9.1,3.0)" />
<PackageVersion Include="Grpc.AspNetCore" Version="[2.59.0,3.0)" />
<PackageVersion Include="Grpc.AspNetCore.Server" Version="[2.59.0, 3.0)" />
Expand All @@ -81,35 +81,29 @@
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="[8.2.0,)" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="[8.6.0,)" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="[1.0.3,2.0)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[17.8.0,18.0.0)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[17.10.0,18.0.0)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[1.1.1,2.0)" />
<PackageVersion Include="MinVer" Version="[5.0.0,6.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="[1.8.1,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="[1.8.0-beta.1,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="[1.8.1,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="[1.5.1,2.0)" />
<PackageVersion Include="RabbitMQ.Client" Version="[6.6.0,7.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="[1.8.1,2.0)" />
<PackageVersion Include="RabbitMQ.Client" Version="[6.8.1,7.0)" />
<PackageVersion Include="StyleCop.Analyzers" Version="[1.2.0-beta.556,2.0)" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="[6.5.0,)" />
<PackageVersion Include="xunit" Version="[2.6.2,3.0)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.5.4,3.0)" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="[6.6.2,)" />
<PackageVersion Include="xunit" Version="[2.8.1,3.0)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.8.1,3.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="6.0.21" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.21" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.21" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="6.0.31" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="7.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="7.0.20" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion OpenTelemetry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TagWriter", "TagWriter", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{44982E0D-C8C6-42DC-9F8F-714981F27CE6}"
ProjectSection(SolutionItems) = preProject
build\scripts\add-labels.ps1 = build\scripts\add-labels.ps1
build\scripts\add-labels.psm1 = build\scripts\add-labels.psm1
build\scripts\finalize-publicapi.ps1 = build\scripts\finalize-publicapi.ps1
build\scripts\post-release.psm1 = build\scripts\post-release.psm1
build\scripts\prepare-release.psm1 = build\scripts\prepare-release.psm1
Expand Down
3 changes: 3 additions & 0 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Label="BuildFlags">
<ExposeExperimentalFeatures Condition="'$(ExposeExperimentalFeatures)' == ''">true</ExposeExperimentalFeatures>
<EnablePackageValidation Condition="'$(EnablePackageValidation)' == ''">false</EnablePackageValidation>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<!--<AnalysisLevel>latest-All</AnalysisLevel>-->
</PropertyGroup>

<PropertyGroup Label="BuildFlags">
<RunningDotNetPack Condition="'$(RunningDotNetPack)' == ''">false</RunningDotNetPack>
</PropertyGroup>

<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<PropertyGroup>
<NetFrameworkMinimumSupportedVersion>net462</NetFrameworkMinimumSupportedVersion>
Expand Down
Loading

0 comments on commit 185ca98

Please sign in to comment.