Skip to content

Commit

Permalink
Merge pull request #2093 from microsoft/develop
Browse files Browse the repository at this point in the history
merge DEVELOP to MASTER (prep 2.16-beta1)
  • Loading branch information
TimothyMothra authored Oct 22, 2020
2 parents 2c60e72 + 5fc1c71 commit 39da915
Show file tree
Hide file tree
Showing 138 changed files with 1,463 additions and 998 deletions.
8 changes: 6 additions & 2 deletions .props/Product.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions .props/_GlobalStaticVersion.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
Update for every public release.
-->
<SemanticVersionMajor>2</SemanticVersionMajor>
<SemanticVersionMinor>15</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
<SemanticVersionMinor>16</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
<SemanticVersionPatch>0</SemanticVersionPatch>
<PreReleaseMilestone></PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone>beta1</PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone Condition="'$(NightlyBuild)' == 'True'">nightly</PreReleaseMilestone> <!-- Overwrite this property for nightly builds from the DEVELOP branch. -->
<!--
Date when Semantic Version was changed.
Expand All @@ -22,7 +22,7 @@
as it will restart file versions so 2.4.0-beta1 may have higher
file version (like 2.4.0.2222) than 2.4.0-beta2 (like 2.4.0.1111)
-->
<SemanticVersionDate>2020-04-13</SemanticVersionDate>
<SemanticVersionDate>2020-09-08</SemanticVersionDate>

<!--
Pre-release version is used to distinguish internally built NuGet packages.
Expand Down
6 changes: 6 additions & 0 deletions .rulesets/ApplicationInsightsSDKRules.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
<Rule Id="CA1410" Action="Warning" />
<!-- Suppressing Message "Identifiers should not match keywords" because class TplActivities is part of our public api and can't be changed -->
<Rule Id="CA1716" Action="None" />
<!-- Suppressing Message "Do not initialize unnecessarily" because this won't change performance -->
<Rule Id="CA1805" Action="None" />
<Rule Id="CA1821" Action="Warning" />
<Rule Id="CA1900" Action="Warning" />
<Rule Id="CA2001" Action="Warning" />
Expand Down Expand Up @@ -457,6 +459,10 @@
<Rule Id="C6995" Action="Warning" />
<Rule Id="C6997" Action="Warning" />
</Rules>
<Rules AnalyzerId="Analyzers" RuleNamespace="Analyzers">
<!--Analyzers can sometimes fail, which fails our builds. Turning off AD0001 to ignore these errors-->
<Rule Id="AD0001" Action="None" />
</Rules>
<Rules AnalyzerId="PublicApiAnalyzer" RuleNamespace="PublicApiAnalyzer">
<Rule Id="RS0016" Action="Error" />
<Rule Id="RS0017" Action="Error" />
Expand Down
2 changes: 1 addition & 1 deletion .scripts/release_GenerateReleaseMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Param(
)

# SUMMARY
# This script will inventory the nuget packages output by a build and create a metadata file.
# This script will inventory the nuget packages output by a build and create a metadata file (releaseMetaData.xml).
# This metadata file must be published with the NUPKGs when archived.
# This metadata file is used by the release infrastructure and informs it on how to publish NUPKGs.
# This script is included in Gated builds for troubleshooting.
Expand Down
70 changes: 70 additions & 0 deletions .scripts/release_MetaDataToCTI.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Param(
[Parameter(Mandatory=$true,HelpMessage="Path to releaseMetaData.xml")]
[string]
$metadataPath
)

# SUMMARY
# This script will parse a metadata file (releaseMetaData.xml) and generate and generate an email to send to our testing team.
# The metadata can be used to construct paths to the newly uploaded nuget packages in myget.

# DEVELOPER notes
# In the release definition, set metadataPath = "$(SYSTEM.ARTIFACTSDIRECTORY)";
# This is a Work In Progress: I haven't been able to find a build task that can send emails.
# Instead, have to settle for generating the email template.


function Send-CtiEmail([string]$emailBody) {
#TODO
}


if($metadataPath -notlike "releaseMetaData.xml") {
Write-Verbose "'releaseMetaData.xml' not part of MetaDataPath: $metadataPath"
Write-Verbose "Searching..."
#assume this is Artifact Directory and find the required file
$items = Get-ChildItem -Path $metadataPath -Recurse -Filter "releaseMetaData.xml"
$items | ForEach-Object { Write-Verbose "Found: $($_.FullName)" }
$metadataPath = $items[0].FullName
}
Write-Verbose "MetaDataPath: $metadataPath"
[xml]$metaData = Get-Content $metadataPath

# build email
# $sb = [System.Text.StringBuilder]::new();
# [void]$sb.AppendFormat("CTI Test of {0} {1}", "Application Insights SDKs", $metaData.MetaData.ReleaseName);
# [void]$sb.AppendLine("<br/>");
# [void]$sb.AppendLine("<br/>Requesting a CTI Test of the following SDKs:");
# [void]$sb.AppendLine("<br/>");
# [void]$sb.AppendLine("<br/><ul>");
# foreach( $package in $metaData.MetaData.Packages.Package) {
# [void]$sb.AppendLine([string]::Format("<li>{0} {1}</li>", $package.Name, $package.MyGetUri));
# }
# [void]$sb.AppendLine("</ul><br/>");
# [void]$sb.AppendLine("<br/>");
# [void]$sb.AppendFormat("<br/>If there are any issues, please reach out to {0}", "_NAME_");
# $emailBody = $sb.ToString()

# Write-Output $emailBody

# Send-CtiEmail $emailBody




# build email text
$sb = [System.Text.StringBuilder]::new();
[void]$sb.AppendFormat("CTI Test of {0} {1}", "Application Insights SDKs", $metaData.MetaData.ReleaseName);
[void]$sb.AppendLine("");
[void]$sb.AppendLine("Requesting a CTI Test of the following SDKs:");
[void]$sb.AppendLine("");
[void]$sb.AppendLine("");
foreach( $package in $metaData.MetaData.Packages.Package) {
[void]$sb.AppendLine([string]::Format("{0} {1}", $package.Name, $package.MyGetUri));
}
[void]$sb.AppendLine("");
[void]$sb.AppendLine("");
[void]$sb.AppendFormat("If there are any issues, please reach out to {0}", "_NAME_");
$emailBody = $sb.ToString()

Write-Output $emailBody
102 changes: 102 additions & 0 deletions .scripts/release_MetaDataToReleaseNotes.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Param(
[Parameter(Mandatory=$true,HelpMessage="Path to releaseMetaData.xml")]
[string]
$metadataPath,

[Parameter(Mandatory=$true,HelpMessage="Github Repo Name")]
[string]
$gitHubRepository,

[Parameter(Mandatory=$true,HelpMessage="Github Username with Write permissions")]
[string]
$gitHubUsername,

[Parameter(Mandatory=$true,HelpMessage="Github User's personal api token (https://github.com/blog/1509-personal-api-tokens)")]
[string]
$gitHubApiKey
)

# SUMMARY
# This script will parse a metadata file (releaseMetaData.xml) and generate the release notes.
# The metadata contains a copy of the relevant changelog as well as the commit id.
# The commit id is required to create a release tag in github.

# DEVELOPER notes
# In the release definition, set metadataPath = "$(SYSTEM.ARTIFACTSDIRECTORY)";


function Push-Github {
#https://developer.github.com/v3/repos/releases/#create-a-release
Param (
[string]$tagName,
[string]$releaseName,
# The Commit SHA for corresponding to this release
[string]$commitId,
# The notes to accompany this release, uses the commit message in this case
[string]$releaseNotes,
# The github username
[string]$gitHubUsername,
# The github repository name
[string]$gitHubRepository,
# The github API key (https://github.com/blog/1509-personal-api-tokens)
[string]$gitHubApiKey,
# Set to true to mark this as a pre-release version
[bool]$preRelease = $TRUE,
# Set to true to mark this as a draft release (not visible to users)
[bool]$draft = $FALSE
)

$releaseData = @{
tag_name = $tagName;
target_commitish = $commitId;
name = $releaseName;
body = $releaseNotes;
draft = $draft;
prerelease = $preRelease;
}

$authPair = "$($gitHubUsername):$($gitHubApiKey)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($authPair));
$basicAuthValue = "Basic $encodedCreds"

$releaseCmd = @{
Uri = "https://api.github.com/repos/$gitHubRepository/releases";
Method = 'POST';
Headers = @{
Authorization = $basicAuthValue
}
ContentType = 'application/json';
Body = (ConvertTo-Json $releaseData -Compress)
}

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod @releaseCmd
}



if($metadataPath -notlike "releaseMetaData.xml") {
Write-Verbose "'releaseMetaData.xml' not part of MetaDataPath: $metadataPath"
Write-Verbose "Searching..."
#assume this is Artifact Directory and find the required file
$items = Get-ChildItem -Path $metadataPath -Recurse -Filter "releaseMetaData.xml"
$items | ForEach-Object { Write-Verbose "Found: $($_.FullName)" }
$metadataPath = $items[0].FullName
}
Write-Verbose "MetaDataPath: $metadataPath"

if (Test-Path $metadataPath) {

[xml]$metaData = Get-Content $metadataPath

$commitId = $metaData.MetaData.CommitId;
$tagName = $metaData.MetaData.ReleaseName;
$releaseName = $metaData.MetaData.FormattedReleaseName;
$releaseNotes = $metaData.MetaData.ChangeLog;
$isPreRelease = [System.Convert]::ToBoolean($metaData.MetaData.isPreRelease);

Push-Github -tagName $tagName -releaseName $releaseName -commitId $commitId -releaseNotes $releaseNotes -gitHubUsername $gitHubUsername -gitHubRepository $gitHubRepository -gitHubApiKey $gitHubApiKey -preRelease $isPreRelease;

} else {
Write-Error "MetaData Not Found."
}
2 changes: 1 addition & 1 deletion .scripts/release_NupkgAudit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function Start-EvaluateNupkg ($nupkgPath) {
[xml]$nuspecXml = Get-Content $_.FullName
Get-IsValidPackageId $nuspecXml;
Get-IsValidAuthors $nuspecXml;
Get-IsValidOwners $nuspecXml;
#Get-IsValidOwners $nuspecXml; dotnet stopped building this property. Disabling the check.
Get-IsValidProjectUrl $nuspecXml;
Get-IsValidLicense $nuspecXml;
Get-IsValidLicenseAcceptance $nuspecXml;
Expand Down
9 changes: 2 additions & 7 deletions BASE/.vsts/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ steps:
- task: UseDotNet@2
displayName: install dotnet core 2.1
inputs:
version: 2.1.807
version: 2.1.x

- task: UseDotNet@2
displayName: install dotnet core 3.1
inputs:
version: 3.1.301
version: 3.1.x

- task: CmdLine@2
displayName: Run dotnet side by side.
inputs:
script: rsync -a ${DOTNET_ROOT/3.1.301/2.1.807}/* $DOTNET_ROOT/

- task: DotNetCoreCLI@2
displayName: DotNetCoreCLI - Restore Solution
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public void SetOperationNameIsConsistentWithGetOperationName()
}

[TestMethod]
public void GetOperationNameReturnsLastAddedOperationName()
public void GetOperationNameReturnsFirstAddedOperationName()
{
var activity = new Activity("test");
activity.AddTag("OperationName", "test me 1");
activity.AddTag("OperationName", "test me 2");

Assert.AreEqual("test me 2", activity.GetOperationName());
Assert.AreEqual("test me 1", activity.GetOperationName());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Extensibility;
using System.Net.Http;
using System.Threading;
Expand Down Expand Up @@ -52,20 +52,22 @@ public override IEnumerable<ITelemetry> Dequeue()
public void SendingLogicMarkedAsInternalSdkOperation()
{
var buffer = new TelemetryBufferWithInternalOperationValidation();
var transmitter = new InMemoryTransmitter(buffer);
buffer.OnFull();

for (int i = 0; i < 10; i++)
using (var transmitter = new InMemoryTransmitter(buffer))
{
if (buffer.WasCalled)
buffer.OnFull();

for (int i = 0; i < 10; i++)
{
break;
if (buffer.WasCalled)
{
break;
}

Thread.Sleep(TimeSpan.FromSeconds(1));
}

Thread.Sleep(TimeSpan.FromSeconds(1));
Assert.IsTrue(buffer.WasCalled);
}

Assert.IsTrue(buffer.WasCalled);
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@

<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.64.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<Reference Include="System" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="System.Collections.Immutable" Version="1.3.1" />
<Reference Include="System.ComponentModel.Composition" />
<PackageReference Include="System.Console" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0" />
<PackageReference Include="System.Diagnostics.FileVersionInfo" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="4.3.0" />
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
<ProjectReference Include="..\..\..\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
<PackageReference Include="Microsoft.Web.Xdt" Version="2.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0" />
<PackageReference Include="Castle.Core" Version="4.4.0" />
<ProjectReference Include="..\..\..\src\ServerTelemetryChannel\TelemetryChannel.csproj" />
<EmbeddedResource Include="..\..\..\src\ServerTelemetryChannel\ApplicationInsights.config.install.xdt">
Expand Down
Loading

0 comments on commit 39da915

Please sign in to comment.