Skip to content

Commit

Permalink
merge from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
m-nash committed Apr 30, 2021
2 parents 5a9fff2 + 8e09003 commit 381cc03
Show file tree
Hide file tree
Showing 2,425 changed files with 120,390 additions and 477,392 deletions.
9 changes: 5 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
#/<NotInRepo>/ @antcp @AzureAppServiceCLI

# ServiceLabel: %Attestation %Service Attention
/sdk/attestation/ @anilba06
/sdk/attestation/ @anilba06 @larryosterman
/sdk/attestation/azure-security-attestation @azure/ @larryosterman @Azure/azure-sdk-write-attestation @anilba06

# ServiceLabel: %Authorization %Service Attention
/sdk/authorization/Microsoft.Azure.Management.Authorization/ @darshanhs90 @AshishGargMicrosoft
Expand Down Expand Up @@ -506,7 +507,7 @@ sdk/trafficmanager/Microsoft.Azure.Management.TrafficManager/ @tmsupp
#/<NotInRepo>/ @chlahav

# PRLabel: %Search
/sdk/search/ @brjohnstmsft @arv100kri @bleroy @Mohit-Chakraborty @tg-msft @heaths
/sdk/search/ @brjohnstmsft @arv100kri @bleroy @Mohit-Chakraborty @tg-msft

# ServiceLabel: %Search %Service Attention
/sdk/search/Microsoft.*/ @brjohnstmsft @arv100kri @bleroy @tjacobhi @markheff @miwelsh
Expand Down Expand Up @@ -599,8 +600,8 @@ sdk/trafficmanager/Microsoft.Azure.Management.TrafficManager/ @tmsupp

# ######## Management Plane ########

/**/*Management*/ @allenjzhang @m-nash @markcowl @YalinLi0312 @bquantump @nisha-bhatia
/**/Azure.ResourceManager*/ @allenjzhang @m-nash @markcowl @YalinLi0312 @bquantump @nisha-bhatia
/**/*Management*/ @allenjzhang @m-nash @markcowl @YalinLi0312 @nisha-bhatia
/**/Azure.ResourceManager*/ @allenjzhang @m-nash @markcowl @YalinLi0312 @nisha-bhatia

# Reviewers to double check any API changes
/sdk/**/api/ @KrzysztofCwalina @tg-msft
Expand Down
17 changes: 9 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,16 @@ As you can see in the example below, we want to use the `Azure.Data.Tables` vers

## Preparing a new library release

To prepare a package for release you should make use of `.\eng\common\scripts\Prepare-Release.ps1` script passing it appropriate arguments for the package intended for release as well as the release date. This script will correctly update the package version in the repo as well as update DevOps release work items for that release.
To prepare a package for release you should make use of `.\eng\common\scripts\Prepare-Release.ps1` script passing it appropriate arguments for the package intended for release. This script will correctly update the package version and changelog in the repo as well as update the DevOps release work items for that release.

If you are releasing out-of-band please use the `-ReleaseDate` parameter to specify the release data. `ReleaseDate` should be in `yyyy-MM-dd` format.

Example invocations:

```powershell
.\eng\scripts\Prepare-Release.ps1 -PackageName "Azure.Core" -SerivceDirectory "core" -ReleaseDate "2020-10-01"
```
.\eng\common\scripts\Prepare-Release.ps1 <PackageName> [<ServiceDirectory>] [<ReleaseDate>] [-ReleaseTrackingOnly]
```

- `<PackageName>` - Should match the full exact package name for the given ecosystem (i.e. "Azure.Core", "azure-core", "@azure/core", etc).
- `<SerivceDirectory>` - Optional: Should be the exact directory name where the package resides in the repo. This is usually the same as the service name in most cases (i.e. "sdk<service_directory>" e.g. "core"). The parameter is optional and if provided will help speed-up the number of projects we have to parse to find the matching package project.
- `<ReleaseDate>` - Optional: provide a specific date for when you plan to release the package. If one isn't given then one will be calculated based on the normal monthly shipping schedule.
- `<ReleaseTrackingOnly>` - Optional: Switch that if passed will only update the release tracking data in DevOps and not update any versioning info or do validation in the local repo.

## On-boarding New Libraries

Expand Down Expand Up @@ -523,4 +524,4 @@ For more information on how we version see [Versioning](https://github.com/Azure

## Breaking Changes

For information about breaking changes see [Breaking Change Rules](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md)
For information about breaking changes see [Breaking Change Rules](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Last stable versions of packages that are production-ready. These libraries prov

A new set of management libraries that follow the [Azure SDK Design Guidelines for .NET](https://azure.github.io/azure-sdk/dotnet_introduction.html) and based on [Azure.Core libraries](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/core/Azure.Core) are now in Public Preview. These new libraries provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more. You can find the list of new packages [on this page](https://azure.github.io/azure-sdk/releases/latest/dotnet.html).

To get started with these new libraries, please see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/master/doc/mgmt_preview_quickstart.md). These new libraries can be identifed by namespaces that start with `Azure.ResourceManager`, e.g. `Azure.ResourceManager.Network`
To get started with these new libraries, please see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/master/doc/mgmt_preview_quickstart.md). These new libraries can be identified by namespaces that start with `Azure.ResourceManager`, e.g. `Azure.ResourceManager.Network`

> NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries.
Expand Down
2 changes: 1 addition & 1 deletion common/SmokeTests/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ variables:
- template: /eng/pipelines/templates/variables/globals.yml

jobs:
- template: /eng/pipelines/templates/jobs/smoke-tests.yml
- template: /eng/pipelines/templates/jobs/smoke.tests.yml
parameters:
Daily: true
TimeoutInMinutes: 90
1 change: 1 addition & 0 deletions doc/ApiDocGeneration/assets/docgen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ECMA2YmlVersion>1.0.644-alpha</ECMA2YmlVersion>
<PopImportVersion>1.0.0</PopImportVersion>
<NuGetPackageRoot>$(UserProfile)\.nuget\packages</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NUGET_PACKAGES)' != ''">$(NUGET_PACKAGES)</NuGetPackageRoot>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DocAsCode.ECMA2Yaml" Version="$(ECMA2YmlVersion)" />
Expand Down
1 change: 0 additions & 1 deletion eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ known_content_issues:
- ['sdk/core/Microsoft.Azure.Core.Spatial/README.md', '#15423']
- ['sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/README.md', '#15423']
- ['sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md', '#15423']
- ['sdk/monitor/Azure.Monitory.Query/README.md', '#15423']

# .net climbs upwards. placing these to prevent assigning readmes to the wrong project
package_indexing_exclusion_list:
Expand Down
38 changes: 22 additions & 16 deletions eng/ApiListing.targets
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
<Project>

<PropertyGroup>
<_SupportsApiListing Condition="'$(IsShippingClientLibrary)' == 'true' AND '$(GenerateApiListingOnBuild)' == 'true'">true</_SupportsApiListing>
<_RefSourceOutputPath>$([System.IO.Directory]::GetParent('$(MSBuildProjectDirectory)'))/api/</_RefSourceOutputPath>
<GenAPIAdditionalParameters>--exclude-attributes-list "$(MSBuildThisFileDirectory)ApiListing.exclude-attributes.txt" $(GenAPIAdditionalParameters)</GenAPIAdditionalParameters>
<GenAPITargetPath>$(_RefSourceOutputPath)$(AssemblyName).$(TargetFramework).cs</GenAPITargetPath>
</PropertyGroup>

<Target
Name="_GenerateApiListing"
Condition="'$(_SupportsApiListing)' == 'true' AND '$(GenerateAPIListing)' == 'true'"
AfterTargets="_GenerateApiListingAfterBuild"
DependsOnTargets="GenerateReferenceAssemblySource" />
<Target Name="RemoveExistingListings">

<Target
Name="_GenerateApiListingAfterBuild"
AfterTargets="CoreBuild"
Condition="'$(_SupportsApiListing)' == 'true'">

<PropertyGroup>
<_RefSourceOutputPath>$([System.IO.Directory]::GetParent('$(MSBuildProjectDirectory)'))/api/</_RefSourceOutputPath>
<GenAPIAdditionalParameters>--exclude-attributes-list "$(MSBuildThisFileDirectory)ApiListing.exclude-attributes.txt" $(GenAPIAdditionalParameters)</GenAPIAdditionalParameters>
<GenAPITargetPath>$(_RefSourceOutputPath)$(AssemblyName).$(TargetFramework).cs</GenAPITargetPath>
</PropertyGroup>
<ItemGroup>
<!-- Remove all files that don't start with $(AssemblyName) and the current target -->
<_ListingsToRemove Include="$(_RefSourceOutputPath)*" Exclude="$(_RefSourceOutputPath)$(AssemblyName).*.cs" />
Expand All @@ -30,6 +18,24 @@
<MakeDir Directories="$(_RefSourceOutputPath)"/>
</Target>

<Target Name="_SetExportApiInnerTarget">
<PropertyGroup>
<InnerTargets>ExportApi</InnerTargets>
</PropertyGroup>
</Target>

<Target
Name="ExportApiCrossTarget"
DependsOnTargets="_SetExportApiInnerTarget;DispatchToInnerBuilds"
Condition="'$(IsCrossTargetingBuild)' == 'true'" />

<Target
Name="ExportApiInner"
DependsOnTargets="Build;RemoveExistingListings;GenerateReferenceAssemblySource"
Condition="'$(IsInnerBuild)' == 'true'" />

<Target Name="ExportApi" DependsOnTargets="ExportApiCrossTarget;ExportApiInner" Condition="'$(GenerateAPIListing)' == 'true'" />

<Target Name="_CheckGenerateAPIListingValue" AfterTargets="Build">
<Error
Condition="'$(IsShippingClientLibrary)' == 'true' AND '$(GenerateAPIListing)' != 'true' AND '$(HasReleaseVersion)' != 'false'"
Expand Down
3 changes: 2 additions & 1 deletion eng/Directory.Build.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<PowerShellExe Condition="'$(PowerShellExe)' == ''">pwsh</PowerShellExe>
<InheritDocEnabled Condition="'$(InheritDocEnabled)'=='' and '$(DesignTimeBuild)'!='true' and '$(BuildingForLiveUnitTesting)'!='true' and '$(IsShippingClientLibrary)' == true">true</InheritDocEnabled>
<InheritDocTrimLevel>private</InheritDocTrimLevel>
<GenerateAPIListing Condition="'$(GenerateAPIListing)' == '' AND '$(IsShippingClientLibrary)' == 'true'">true</GenerateAPIListing>
</PropertyGroup>

<PropertyGroup Condition="'$(IsShippingClientLibrary)' == 'true' and '$(TF_BUILD)' == 'true'">
Expand Down Expand Up @@ -180,7 +181,7 @@
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)AzSdkTestLibKey.snk</AssemblyOriginatorKeyFile>
<!-- Disable doc comments for test projects -->
<DocumentationFile></DocumentationFile>
<RunSettingsFilePath>$(RepoEngPath)\nunit.runsettings</RunSettingsFilePath>
<RunSettingsFilePath Condition="'$(AZURE_SKIP_DEFAULT_RUN_SETTINGS)' != 'true'">$(RepoEngPath)\nunit.runsettings</RunSettingsFilePath>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
Expand Down
5 changes: 3 additions & 2 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<PackageReference Update="Azure.Messaging.EventHubs" Version="5.4.0" />
<PackageReference Update="Azure.Messaging.EventGrid" Version="4.0.0" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.2.0-beta.2" Condition="'$(HasReleaseVersion)' == 'false'"/>
<PackageReference Update="Azure.Messaging.WebPubSub" Version="1.0.0-beta.1" />
<PackageReference Update="Azure.Identity" Version="1.2.1" />
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="4.0.2" />
<PackageReference Update="Azure.Security.KeyVault.Keys" Version="4.0.2" />
Expand Down Expand Up @@ -127,7 +128,7 @@
All should have PrivateAssets="All" set so they don't become pacakge dependencies
-->
<ItemGroup>
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210426.2" PrivateAssets="All" />
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210428.2" PrivateAssets="All" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20210322.2" PrivateAssets="All" />
<PackageReference Update="coverlet.collector" Version="1.3.0" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
Expand Down Expand Up @@ -203,7 +204,7 @@
<PackageReference Update="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Update="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Update="NSubstitute" Version="3.1.0" />
<PackageReference Update="NUnit" Version="3.13.1" />
<PackageReference Update="NUnit" Version="3.13.2" />
<PackageReference Update="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc2" />
<PackageReference Update="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc2" />
Expand Down
29 changes: 13 additions & 16 deletions eng/SnippetGenerator/CSharpProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Security;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace SnippetGenerator
{
Expand All @@ -19,34 +20,30 @@ public class CSharpProcessor
private static readonly Regex _snippetExampleRegex = new Regex("^(?<indent>\\s*)\\/{3}\\s*<example snippet=\"(?<name>[\\w:]+)\">.*?\\s*<\\/example>",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline | RegexOptions.IgnoreCase);

public static string Process(string markdown, Func<string, string> snippetProvider)
public static async ValueTask<string> ProcessAsync(string markdown, Func<string, ValueTask<string>> snippetProvider)
{
string CodeTagFormatter(Match match)
async ValueTask<string> CodeTagFormatter(Match match)
{
var name = BuildResult(snippetProvider, match, out var prefix, out var builder);

return string.Format(_snippetFormat, name, Environment.NewLine, builder, prefix);
return await BuildResult(snippetProvider, match, _snippetFormat);
}

string ExampleTagFormatter(Match match)
async ValueTask<string> ExampleTagFormatter(Match match)
{
var name = BuildResult(snippetProvider, match, out var prefix, out var builder);

return string.Format(_snippetExampleFormat, name, Environment.NewLine, builder, prefix);
return await BuildResult(snippetProvider, match, _snippetExampleFormat);
}

string result = _snippetRegex.Replace(markdown, CodeTagFormatter);
return result != markdown ? result : _snippetExampleRegex.Replace(markdown, ExampleTagFormatter);
string result = await _snippetRegex.ReplaceAsync(markdown, CodeTagFormatter);
return result != markdown ? result : await _snippetExampleRegex.ReplaceAsync(markdown, ExampleTagFormatter);
}

private static string BuildResult(Func<string, string> snippetProvider, Match match, out string prefix, out StringBuilder builder)
private static async ValueTask<string> BuildResult(Func<string, ValueTask<string>> snippetProvider, Match match, string format)
{
var name = match.Groups["name"].Value;
prefix = match.Groups["indent"].Value + "///";
var prefix = match.Groups["indent"].Value + "///";

var snippetText = snippetProvider(name);
var snippetText = await snippetProvider(name);

builder = new StringBuilder();
var builder = new StringBuilder();
foreach (var line in snippetText.Split(Environment.NewLine))
{
builder.Append(prefix);
Expand All @@ -63,7 +60,7 @@ private static string BuildResult(Func<string, string> snippetProvider, Match ma
builder.Length -= Environment.NewLine.Length;
}

return name;
return string.Format(format, name, Environment.NewLine, builder, prefix);
}
}
}
Loading

0 comments on commit 381cc03

Please sign in to comment.