From 447f39ae850876aa3eaf467509d4d549ee6ab90d Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Fri, 15 Nov 2019 13:03:45 -0600 Subject: [PATCH 01/13] added Azure DevOps build system --- build-system/README.md | 8 ++++ build-system/azure-pipeline.template.yaml | 45 +++++++++++++++++++++++ build-system/nightly-builds.yaml | 26 +++++++++++++ build-system/pr-validation.yaml | 30 +++++++++++++++ build-system/windows-release.yaml | 39 ++++++++++++++++++++ 5 files changed, 148 insertions(+) create mode 100644 build-system/README.md create mode 100644 build-system/azure-pipeline.template.yaml create mode 100644 build-system/nightly-builds.yaml create mode 100644 build-system/pr-validation.yaml create mode 100644 build-system/windows-release.yaml diff --git a/build-system/README.md b/build-system/README.md new file mode 100644 index 0000000..699c2d4 --- /dev/null +++ b/build-system/README.md @@ -0,0 +1,8 @@ +# Azure Pipelines Build Files +These `.yaml` files are used by Windows Azure DevOps Pipelines to help execute the following types of builds: + +- Pull request validation on Linux (Mono / .NET Core) +- Pull request validation on Windows (.NET Framework / .NET Core) +- NuGet releases with automatic release notes posted to a Github Release repository. + +**NOTE**: you will need to change some of the pipeline variables inside the `windows-release.yaml` for your specific project and you will also want to create variable groups with your signing and NuGet push information. \ No newline at end of file diff --git a/build-system/azure-pipeline.template.yaml b/build-system/azure-pipeline.template.yaml new file mode 100644 index 0000000..a5c1bf8 --- /dev/null +++ b/build-system/azure-pipeline.template.yaml @@ -0,0 +1,45 @@ +parameters: + name: '' + displayName: '' + vmImage: '' + scriptFileName: '' + scriptArgs: 'all' + timeoutInMinutes: 120 + +jobs: + - job: ${{ parameters.name }} + displayName: ${{ parameters.displayName }} + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + pool: + vmImage: ${{ parameters.vmImage }} + steps: + - checkout: self # self represents the repo where the initial Pipelines YAML file was found + clean: false # whether to fetch clean each time + submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules + persistCredentials: true + # Linux or macOS + - task: Bash@3 + displayName: Linux / OSX Build + inputs: + filePath: ${{ parameters.scriptFileName }} + arguments: ${{ parameters.scriptArgs }} + continueOnError: true + condition: in( variables['Agent.OS'], 'Linux', 'Darwin' ) + # Windows + - task: BatchScript@1 + displayName: Windows Build + inputs: + filename: ${{ parameters.scriptFileName }} + arguments: ${{ parameters.scriptArgs }} + continueOnError: true + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - task: PublishTestResults@2 + inputs: + testRunner: VSTest + testResultsFiles: '**/*.trx' #TestResults folder usually + testRunTitle: ${{ parameters.name }} + mergeTestResults: true + - script: 'echo 1>&2' + failOnStderr: true + displayName: 'If above is partially succeeded, then fail' + condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues') \ No newline at end of file diff --git a/build-system/nightly-builds.yaml b/build-system/nightly-builds.yaml new file mode 100644 index 0000000..c8e91b2 --- /dev/null +++ b/build-system/nightly-builds.yaml @@ -0,0 +1,26 @@ +# Release task for PbLib projects +# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference + +pool: + vmImage: vs2017-win2016 + demands: Cmd + +trigger: none +pr: none + +schedules: +- cron: "0 0 * * *" + displayName: Daily midnight build + branches: + include: + - dev + +variables: + - group: nugetKeys #create this group with SECRET variables `nugetKey` + +steps: +- task: BatchScript@1 + displayName: 'FAKE Build' + inputs: + filename: build.cmd + arguments: 'Nuget nugetprerelease=dev nugetpublishurl=$(nightlyUrl) nugetkey=$(nightlyKey)' \ No newline at end of file diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml new file mode 100644 index 0000000..99a80df --- /dev/null +++ b/build-system/pr-validation.yaml @@ -0,0 +1,30 @@ +# Pull request validation for Windows against the `dev` and `master` branches +# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference +trigger: + branches: + include: + - dev + - master + +pr: + autoCancel: true # indicates whether additional pushes to a PR should cancel in-progress runs for the same PR. Defaults to true + branches: + include: [ dev, master ] # branch names which will trigger a build + +name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) + +jobs: + - template: azure-pipeline.template.yaml + parameters: + name: 'windows_pr' + displayName: 'Windows PR Validation' + vmImage: 'vs2017-win2016' + scriptFileName: build.cmd + scriptArgs: all + - template: azure-pipeline.template.yaml + parameters: + name: 'linux_pr' + displayName: 'Linux PR Validation' + vmImage: 'ubuntu-16.04' + scriptFileName: ./build.sh + scriptArgs: all \ No newline at end of file diff --git a/build-system/windows-release.yaml b/build-system/windows-release.yaml new file mode 100644 index 0000000..97028f4 --- /dev/null +++ b/build-system/windows-release.yaml @@ -0,0 +1,39 @@ +# Release task for PbLib projects +# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference + +pool: + vmImage: vs2017-win2016 + demands: Cmd + +trigger: + branches: + include: + - refs/tags/* +pr: none + +variables: + - group: signingSecrets + - group: nugetKeys + - name: githubConnectionName + value: Petabridge + - name: projectName + value: Petabridge.Tracing.Zipkin + - name: githubRepositoryName + value: petabridge/Petabridge.Tracing.Zipkin + +steps: +- task: BatchScript@1 + displayName: 'FAKE Build' + inputs: + filename: build.cmd + arguments: 'All SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)' + +- task: GitHubRelease@0 + displayName: 'GitHub release (create)' + inputs: + gitHubConnection: $(githubConnectionName) + repositoryName: $(githubRepositoryName) + title: '$(projectName) v$(Build.SourceBranchName)' + releaseNotesFile: 'RELEASE_NOTES.md' + assets: | + bin\nuget\*.nupkg \ No newline at end of file From 7a6ffa10c09ab833f202236f6da379b4d7abc542 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Fri, 15 Nov 2019 14:06:37 -0600 Subject: [PATCH 02/13] Set up CI with Azure Pipelines [skip ci] --- build-system/windows-release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-system/windows-release.yaml b/build-system/windows-release.yaml index 97028f4..0e2f443 100644 --- a/build-system/windows-release.yaml +++ b/build-system/windows-release.yaml @@ -15,11 +15,11 @@ variables: - group: signingSecrets - group: nugetKeys - name: githubConnectionName - value: Petabridge + value: PbReleaseNotes - name: projectName - value: Petabridge.Tracing.Zipkin + value: Petabridge.Tracing.ApplicationInsights - name: githubRepositoryName - value: petabridge/Petabridge.Tracing.Zipkin + value: petabridge/Petabridge.Tracing.ApplicationInsights steps: - task: BatchScript@1 From 5ec80b90961478892366157246edf6afdebadee2 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Fri, 15 Nov 2019 14:12:32 -0600 Subject: [PATCH 03/13] Update windows-release.yaml for Azure Pipelines --- build-system/windows-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-system/windows-release.yaml b/build-system/windows-release.yaml index 0e2f443..bd7e146 100644 --- a/build-system/windows-release.yaml +++ b/build-system/windows-release.yaml @@ -26,7 +26,7 @@ steps: displayName: 'FAKE Build' inputs: filename: build.cmd - arguments: 'All SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)' + arguments: 'All SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://api.nuget.org/v3/index.json nugetkey=$(nugetKey)' - task: GitHubRelease@0 displayName: 'GitHub release (create)' From 684a3dfd8e68495d31a244e085e8a33203ed7acb Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Fri, 15 Nov 2019 14:21:38 -0600 Subject: [PATCH 04/13] updated build system (#28) * updated build system * added code-signing --- appsettings.json | 13 +++++++ build.fsx | 95 ++++++++++++++++++++++++++++++++++++++++++------ build.ps1 | 36 +++++++++--------- build.sh | 35 +++++++++++++++++- 4 files changed, 147 insertions(+), 32 deletions(-) create mode 100644 appsettings.json diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..b5c102c --- /dev/null +++ b/appsettings.json @@ -0,0 +1,13 @@ +{ + "SignClient": { + "AzureAd": { + "AADInstance": "https://login.microsoftonline.com/", + "ClientId": "1e983f21-9ea5-4f21-ab99-28080225efc9", + "TenantId": "2fa36080-af12-4894-a64b-a17d8f29ec52" + }, + "Service": { + "Url": "https://pb-sign.azurewebsites.net/", + "ResourceId": "https://SignService/eef8e2e7-24b1-4a3b-a73b-a84d66f9abee" + } + } +} \ No newline at end of file diff --git a/build.fsx b/build.fsx index b0af3a3..fed8792 100644 --- a/build.fsx +++ b/build.fsx @@ -10,14 +10,19 @@ open Fake.DotNetCli open Fake.DocFxHelper // Information about the project for Nuget and Assembly info files -let product = "OpenTracing.ApplicationInsights" +let product = "Petabridge.Library" let configuration = "Release" +// Metadata used when signing packages and DLLs +let signingName = "Petabridge.Tracing.Zipkin" +let signingDescription = "Zipkin dristributed tracing engine driver, developed by Petabridge®" +let signingUrl = "https://github.com/petabridge/Petabridge.Tracing.Zipkin" + // Read release notes and version let solutionFile = FindFirstMatchingFile "*.sln" __SOURCE_DIRECTORY__ // dynamically look up the solution let buildNumber = environVarOrDefault "BUILD_NUMBER" "0" let hasTeamCity = (not (buildNumber = "0")) // check if we have the TeamCity environment variable for build # set -let preReleaseVersionSuffix = (if (not (buildNumber = "0")) then (buildNumber) else "") + "-beta" +let preReleaseVersionSuffix = "beta" + (if (not (buildNumber = "0")) then (buildNumber) else DateTime.UtcNow.Ticks.ToString()) let versionSuffix = match (getBuildParam "nugetprerelease") with | "dev" -> preReleaseVersionSuffix @@ -40,6 +45,8 @@ let workingDir = output @@ "build" let nugetExe = FullName @"./tools/nuget.exe" Target "Clean" (fun _ -> + ActivateFinalTarget "KillCreatedProcesses" + CleanDir output CleanDir outputTests CleanDir outputPerfTests @@ -94,20 +101,21 @@ Target "RunTests" (fun _ -> let projects = match (isWindows) with | true -> !! "./src/**/*.Tests.csproj" + -- "./src/**/*.Integration.Tests.csproj" // Zipkin containers can't run on Windows VMs | _ -> !! "./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here let runSingleProject project = let arguments = match (hasTeamCity) with - | true -> (sprintf "xunit -c Release -nobuild -parallel none -teamcity -xml %s_xunit.xml" (outputTests @@ fileNameWithoutExt project)) - | false -> (sprintf "xunit -c Release -nobuild -parallel none -xml %s_xunit.xml" (outputTests @@ fileNameWithoutExt project)) + | true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none -teamcity" (outputTests)) + | false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none" (outputTests)) let result = ExecProcess(fun info -> info.FileName <- "dotnet" info.WorkingDirectory <- (Directory.GetParent project).FullName info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0) - ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.DontFailBuild result + ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.DontFailBuild result projects |> Seq.iter (log) projects |> Seq.iter (runSingleProject) @@ -136,6 +144,54 @@ Target "NBench" <| fun _ -> projects |> Seq.iter runSingleProject +//-------------------------------------------------------------------------------- +// Code signing targets +//-------------------------------------------------------------------------------- +Target "SignPackages" (fun _ -> + let canSign = hasBuildParam "SignClientSecret" && hasBuildParam "SignClientUser" + if(canSign) then + log "Signing information is available." + + let assemblies = !! (outputNuGet @@ "*.nupkg") + + let signPath = + let globalTool = tryFindFileOnPath "SignClient.exe" + match globalTool with + | Some t -> t + | None -> if isWindows then findToolInSubPath "SignClient.exe" "tools/signclient" + elif isMacOS then findToolInSubPath "SignClient" "tools/signclient" + else findToolInSubPath "SignClient" "tools/signclient" + + let signAssembly assembly = + let args = StringBuilder() + |> append "sign" + |> append "--config" + |> append (__SOURCE_DIRECTORY__ @@ "appsettings.json") + |> append "-i" + |> append assembly + |> append "-r" + |> append (getBuildParam "SignClientUser") + |> append "-s" + |> append (getBuildParam "SignClientSecret") + |> append "-n" + |> append signingName + |> append "-d" + |> append signingDescription + |> append "-u" + |> append signingUrl + |> toText + + let result = ExecProcess(fun info -> + info.FileName <- signPath + info.WorkingDirectory <- __SOURCE_DIRECTORY__ + info.Arguments <- args) (System.TimeSpan.FromMinutes 5.0) (* Reasonably long-running task. *) + if result <> 0 then failwithf "SignClient failed.%s" args + + assemblies |> Seq.iter (signAssembly) + else + log "SignClientSecret not available. Skipping signing" +) + //-------------------------------------------------------------------------------- // Nuget targets //-------------------------------------------------------------------------------- @@ -204,6 +260,19 @@ Target "DocFx" (fun _ -> DocFxJson = docsPath @@ "docfx.json" }) ) +//-------------------------------------------------------------------------------- +// Cleanup +//-------------------------------------------------------------------------------- + +FinalTarget "KillCreatedProcesses" (fun _ -> + log "Shutting down dotnet build-server" + let result = ExecProcess(fun info -> + info.FileName <- "dotnet" + info.WorkingDirectory <- __SOURCE_DIRECTORY__ + info.Arguments <- "build-server shutdown") (System.TimeSpan.FromMinutes 2.0) + if result <> 0 then failwithf "dotnet build-server shutdown failed" +) + //-------------------------------------------------------------------------------- // Help //-------------------------------------------------------------------------------- @@ -214,11 +283,12 @@ Target "Help" <| fun _ -> "./build.ps1 [target]" "" " Targets for building:" - " * Build Builds" - " * Nuget Create and optionally publish nugets packages" - " * RunTests Runs tests" - " * All Builds, run tests, creates and optionally publish nuget packages" - " * DocFx Creates a DocFx-based website for this solution" + " * Build Builds" + " * Nuget Create and optionally publish nugets packages" + " * SignPackages Signs all NuGet packages, provided that the following arguments are passed into the script: SignClientSecret={secret} and SignClientUser={username}" + " * RunTests Runs tests" + " * All Builds, run tests, creates and optionally publish nuget packages" + " * DocFx Creates a DocFx-based website for this solution" "" " Other Targets" " * Help Display this help" @@ -236,13 +306,14 @@ Target "Nuget" DoNothing "Clean" ==> "RestorePackages" ==> "AssemblyInfo" ==> "Build" ==> "BuildRelease" // tests dependencies +"Clean" ==> "RestorePackages" ==> "Build" ==> "RunTests" // nuget dependencies "Clean" ==> "RestorePackages" ==> "Build" ==> "CreateNuget" -"CreateNuget" ==> "PublishNuget" ==> "Nuget" +"CreateNuget" ==> "SignPackages" ==> "PublishNuget" ==> "Nuget" // docs -"BuildRelease" ==> "Docfx" +"Clean" ==> "RestorePackages" ==> "BuildRelease" ==> "Docfx" // all "BuildRelease" ==> "All" diff --git a/build.ps1 b/build.ps1 index ee467ca..2f8f899 100644 --- a/build.ps1 +++ b/build.ps1 @@ -31,12 +31,12 @@ Param( $FakeVersion = "4.61.2" $DotNetChannel = "LTS"; -$DotNetVersion = "2.0.0"; -$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v2.0.0/scripts/obtain/dotnet-install.ps1"; +$DotNetVersion = "2.1.500"; +$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v$DotNetVersion/scripts/obtain/dotnet-install.ps1"; $NugetVersion = "4.1.0"; $NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe" -$ProtobufVersion = "3.2.0" -$DocfxVersion = "2.36.2" +$ProtobufVersion = "3.4.0" +$DocfxVersion = "2.40.5" # Make sure tools folder exists $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent @@ -114,20 +114,6 @@ if (!(Test-Path $FakeExePath)) { } } -########################################################################### -# INSTALL NBench Runner -########################################################################### - -# Make sure NBench Runner has been installed. -$NBenchDllPath = Join-Path $ToolPath "NBench.Runner/lib/net45/NBench.Runner.exe" -if (!(Test-Path $NBenchDllPath)) { - Write-Host "Installing NBench..." - Invoke-Expression "&`"$NugetPath`" install NBench.Runner -ExcludeVersion -Version $NBenchVersion -OutputDirectory `"$ToolPath`"" | Out-Null; - if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NBench.Runner from NuGet." - } -} - ########################################################################### # Docfx ########################################################################### @@ -142,6 +128,20 @@ if (!(Test-Path $DocfxExePath)) { } } +########################################################################### +# SignTool +########################################################################### + +# Make sure the SignClient has been installed +if (Get-Command signclient -ErrorAction SilentlyContinue) { + Write-Host "Found SignClient. Skipping install." +} +else{ + $SignClientFolder = Join-Path $ToolPath "signclient" + Write-Host "SignClient not found. Installing to ... $SignClientFolder" + dotnet tool install SignClient --version 1.0.82 --tool-path "$SignClientFolder" +} + ########################################################################### # RUN BUILD SCRIPT ########################################################################### diff --git a/build.sh b/build.sh index 5aaf5ef..73752bc 100755 --- a/build.sh +++ b/build.sh @@ -6,13 +6,16 @@ # Define directories. SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) TOOLS_DIR=$SCRIPT_DIR/tools +SIGNCLIENT_DIR=$TOOLS_DIR/signclient NUGET_EXE=$TOOLS_DIR/nuget.exe NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe FAKE_VERSION=4.61.2 FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe -DOTNET_VERSION=2.0.0 +DOTNET_VERSION=2.1.500 +DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_VERSION/scripts/obtain/dotnet-install.sh DOTNET_CHANNEL=LTS; -DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/v2.0.0/scripts/obtain/dotnet-install.sh +DOCFX_VERSION=2.40.5 +DOCFX_EXE=$TOOLS_DIR/docfx.console/tools/docfx.exe # Define default arguments. TARGET="Default" @@ -88,6 +91,34 @@ if [ ! -f "$FAKE_EXE" ]; then exit 1 fi +########################################################################### +# INSTALL DOCFX +########################################################################### +if [ ! -f "$DOCFX_EXE" ]; then + mono "$NUGET_EXE" install docfx.console -ExcludeVersion -Version $DOCFX_VERSION -OutputDirectory "$TOOLS_DIR" + if [ $? -ne 0 ]; then + echo "An error occured while installing DocFx." + exit 1 + fi +fi + +# Make sure that DocFx has been installed. +if [ ! -f "$DOCFX_EXE" ]; then + echo "Could not find docfx.exe at '$DOCFX_EXE'." + exit 1 +fi + +########################################################################### +# INSTALL SignTool +########################################################################### +if [ ! -f "$SIGNTOOL_EXE" ]; then + "$SCRIPT_DIR/.dotnet/dotnet" tool install SignClient --version 1.0.82 --tool-path "$SIGNCLIENT_DIR" + if [ $? -ne 0 ]; then + echo "SignClient already installed." + fi +fi + + ########################################################################### # WORKAROUND FOR MONO ########################################################################### From b8538d9597f72da2a016272275ce076a54f62d57 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2019 11:34:11 -0600 Subject: [PATCH 05/13] Bump Akka from 1.3.9 to 1.3.16 (#25) Bumps [Akka](https://github.com/akkadotnet/akka.net) from 1.3.9 to 1.3.16. - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/1.3.16/RELEASE_NOTES.md) - [Commits](https://github.com/akkadotnet/akka.net/compare/v1.3.9...1.3.16) Signed-off-by: dependabot-preview[bot] --- .../Petabridge.Tracing.ApplicationInsights.Demo.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Petabridge.Tracing.ApplicationInsights.Demo/Petabridge.Tracing.ApplicationInsights.Demo.csproj b/src/Petabridge.Tracing.ApplicationInsights.Demo/Petabridge.Tracing.ApplicationInsights.Demo.csproj index 07e4947..3991de2 100644 --- a/src/Petabridge.Tracing.ApplicationInsights.Demo/Petabridge.Tracing.ApplicationInsights.Demo.csproj +++ b/src/Petabridge.Tracing.ApplicationInsights.Demo/Petabridge.Tracing.ApplicationInsights.Demo.csproj @@ -8,7 +8,7 @@ - + From 41e53905c786a86179fbf509d45821e54d5ad5c0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2019 12:21:17 -0600 Subject: [PATCH 06/13] Bump OpenTracing from 0.12.0 to 0.12.1 (#21) Bumps [OpenTracing](https://github.com/opentracing/opentracing-csharp) from 0.12.0 to 0.12.1. - [Release notes](https://github.com/opentracing/opentracing-csharp/releases) - [Commits](https://github.com/opentracing/opentracing-csharp/compare/0.12.0...0.12.1) Signed-off-by: dependabot-preview[bot] --- .../Petabridge.Tracing.ApplicationInsights.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj b/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj index 92ccac0..07d567a 100644 --- a/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj +++ b/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj @@ -14,7 +14,7 @@ - + \ No newline at end of file From 0bd10b1006265ad65a7e5f15c68b4316ae8de438 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 18 Nov 2019 12:48:21 -0600 Subject: [PATCH 07/13] added integration testing back (#27) * added integration testing back * fixed environment variable declaration * fixed environment variables * going to add variables declaration to template * Revert "Merge branch 'integration-testing' of https://github.com/Aaronontheweb/OpenTracing.ApplicationInsights into integration-testing" This reverts commit 7f5600465886f701aaf1103b033da7c2821e2fa7, reversing changes made to 155f4852c6efa889f23f04656f49bd5d665a2f73. * Revert "Revert "Merge branch 'integration-testing' of https://github.com/Aaronontheweb/OpenTracing.ApplicationInsights into integration-testing"" This reverts commit 46d040f1b84d7ed47b8d43d982b140d2b52c8429. * Revert "going to add variables declaration to template" This reverts commit 155f4852c6efa889f23f04656f49bd5d665a2f73. * indenting issue --- build-system/pr-validation.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-system/pr-validation.yaml b/build-system/pr-validation.yaml index 99a80df..578f568 100644 --- a/build-system/pr-validation.yaml +++ b/build-system/pr-validation.yaml @@ -11,6 +11,9 @@ pr: branches: include: [ dev, master ] # branch names which will trigger a build +variables: +- group: appInsightsVariables + name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) jobs: From 55effabf41410c87a5e253e4679fb1ee1ec5694c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2019 12:48:53 -0600 Subject: [PATCH 08/13] Bump FluentAssertions from 5.4.1 to 5.9.0 (#18) Bumps [FluentAssertions](https://github.com/fluentassertions/fluentassertions) from 5.4.1 to 5.9.0. - [Release notes](https://github.com/fluentassertions/fluentassertions/releases) - [Commits](https://github.com/fluentassertions/fluentassertions/compare/5.4.1...5.9.0) Signed-off-by: dependabot-preview[bot] --- .../Petabridge.Tracing.ApplicationInsights.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj b/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj index 10edbe3..db064e3 100644 --- a/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj +++ b/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj @@ -16,7 +16,7 @@ - + From da9a74eca5b37e555d640ffe368e160de0b5906e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2019 15:33:38 -0600 Subject: [PATCH 09/13] Bump Microsoft.ApplicationInsights from 2.7.2 to 2.11.0 (#16) Bumps [Microsoft.ApplicationInsights](https://github.com/Microsoft/ApplicationInsights-dotnet) from 2.7.2 to 2.11.0. - [Release notes](https://github.com/Microsoft/ApplicationInsights-dotnet/releases) - [Changelog](https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/CHANGELOG.md) - [Commits](https://github.com/Microsoft/ApplicationInsights-dotnet/compare/2.7.2...2.11.0) Signed-off-by: dependabot-preview[bot] --- .../Petabridge.Tracing.ApplicationInsights.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj b/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj index 07d567a..0da4de5 100644 --- a/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj +++ b/src/Petabridge.Tracing.ApplicationInsights/Petabridge.Tracing.ApplicationInsights.csproj @@ -13,7 +13,7 @@ - + From f1a07b87d9921fea554e4a756900e3656a815097 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 18 Nov 2019 17:03:49 -0600 Subject: [PATCH 10/13] removed dotnet-xunit (#30) --- .../Petabridge.Tracing.ApplicationInsights.Tests.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj b/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj index db064e3..741c989 100644 --- a/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj +++ b/src/Petabridge.Tracing.ApplicationInsights.Tests/Petabridge.Tracing.ApplicationInsights.Tests.csproj @@ -19,7 +19,6 @@ - From ee8ae4a328f6d5d4006fc04940a781b4a0a70b6e Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 18 Nov 2019 17:04:04 -0600 Subject: [PATCH 11/13] make B3 header checking case-insensitive (#29) Replaces #23 --- .../Propagation/B3Propagation.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Petabridge.Tracing.ApplicationInsights/Propagation/B3Propagation.cs b/src/Petabridge.Tracing.ApplicationInsights/Propagation/B3Propagation.cs index 7562575..526df21 100644 --- a/src/Petabridge.Tracing.ApplicationInsights/Propagation/B3Propagation.cs +++ b/src/Petabridge.Tracing.ApplicationInsights/Propagation/B3Propagation.cs @@ -20,10 +20,22 @@ namespace Petabridge.Tracing.ApplicationInsights.Propagation /// public sealed class B3Propagator : IPropagator { + /* + * Keep old headers for outbound + * + */ internal const string B3TraceId = "X-B3-TraceId"; internal const string B3SpanId = "X-B3-SpanId"; internal const string B3ParentId = "X-B3-ParentSpanId"; + /* + * Keep new headers for case-insensitive analysis + * + */ + internal const string B3TraceIdLower = "x-b3-traceid"; + internal const string B3SpanIdLower = "x-b3-spanid"; + internal const string B3ParentIdLower = "x-b3-parentspanid"; + public void Inject(ApplicationInsightsSpanContext context, ITextMap carrier) { carrier.Set(B3TraceId, context.TraceId); @@ -38,15 +50,15 @@ public ApplicationInsightsSpanContext Extract(ITextMap carrier) string spanId = null; string parentId = null; foreach (var entry in carrier) - switch (entry.Key) + switch (entry.Key.ToLowerInvariant()) { - case B3TraceId: + case B3TraceIdLower: traceId = entry.Value; break; - case B3SpanId: + case B3SpanIdLower: spanId = entry.Value; break; - case B3ParentId: + case B3ParentIdLower: parentId = entry.Value; break; } From 10ba4d3654e07395b6fcfd8e1101e881aabb14c4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2019 17:25:22 -0600 Subject: [PATCH 12/13] Bump XunitVersion from 2.3.1 to 2.4.1 (#17) Bumps `XunitVersion` from 2.3.1 to 2.4.1. Updates `xunit` from 2.3.1 to 2.4.1 - [Release notes](https://github.com/xunit/xunit/releases) - [Commits](https://github.com/xunit/xunit/compare/2.3.1...2.4.1) Updates `xunit.runner.visualstudio` from 2.3.1 to 2.4.1 - [Release notes](https://github.com/xunit/xunit/releases) - [Commits](https://github.com/xunit/xunit/compare/2.3.1...2.4.1) Signed-off-by: dependabot-preview[bot] --- src/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.props b/src/common.props index 7e181f8..d36784b 100644 --- a/src/common.props +++ b/src/common.props @@ -12,7 +12,7 @@ $(NoWarn);CS1591 - 2.3.1 + 2.4.1 15.7.2 1.2.2 From 2cee16f59cad05937d612b9897aaafcd4ec1a0eb Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Tue, 19 Nov 2019 08:46:34 -0600 Subject: [PATCH 13/13] V0.1.2 release notes (#31) * added v0.1.2 release notes * fixed windows release --- RELEASE_NOTES.md | 14 +++----------- build-system/windows-release.yaml | 1 + src/common.props | 5 +++-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8c0c1d8..64fbd4d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,11 +1,3 @@ -#### 0.1.1 November 12 2018 #### -Made the Petabridge.Tracing.ApplicationInsights strong-named using [Public Signing](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/public-signing.md#public-signing) - -#### 0.1.0 September 21 2018 #### -Initial release of Petabridge.Tracing.ApplicationInsights. - -We built this driver in order to provide a layer of [OpenTracing](http://opentracing.io/) compatibility on top of [Microsoft's Application Insights](https://azure.microsoft.com/en-us/services/application-insights/) telemetry and analytics service. - -This driver follows [the Application Insights to OpenTracing conventions](https://docs.microsoft.com/en-us/azure/application-insights/application-insights-correlation#open-tracing-and-application-insights) outlined by the Application Insights team. - -`Petabridge.Tracing.ApplicationInsights` is professionally maintained and tested by [Petabridge](http://petabridge.com/) and is used inside some of our commercial products, such as [Phobos: Enterprise Akka.NET DevOps](https://phobos.petabridge.com/). \ No newline at end of file +#### 0.1.2 November 18 2019 #### +* [Resolved: case insensitive HTTP headers](https://github.com/petabridge/Petabridge.Tracing.ApplicationInsights/issues/22) +* Updated all underlying dependencies. \ No newline at end of file diff --git a/build-system/windows-release.yaml b/build-system/windows-release.yaml index bd7e146..8d5a55d 100644 --- a/build-system/windows-release.yaml +++ b/build-system/windows-release.yaml @@ -9,6 +9,7 @@ trigger: branches: include: - refs/tags/* + pr: none variables: diff --git a/src/common.props b/src/common.props index d36784b..ba56a27 100644 --- a/src/common.props +++ b/src/common.props @@ -2,8 +2,9 @@ Copyright © 2015-2018 Petabridge Petabridge - 0.1.1 - Made the Petabridge.Tracing.ApplicationInsights strong-named using [Public Signing](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/public-signing.md#public-signing) + 0.1.2 + [Resolved: case insensitive HTTP headers](https://github.com/petabridge/Petabridge.Tracing.ApplicationInsights/issues/22) +Updated all underlying dependencies. https://petabridge.com/images/logo.png