Skip to content

Commit 982230b

Browse files
committed
Merge branch 'main' of https://github.com/azure/azure-sdk-for-net into feature/eventgrid/namespaces
2 parents 21d3e14 + 239c373 commit 982230b

File tree

5,068 files changed

+246917
-64129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,068 files changed

+246917
-64129
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147

148148
# ServiceLabel: %Batch %Service Attention
149149
# PRLabel: %Batch
150-
/sdk/batch/ @jingjlii @ljiaqi1998 @paterasMSFT @dpwatrous @NickKouds
150+
/sdk/batch/ @wiboris @dpwatrous
151151

152152
# ServiceLabel: %BatchAI %Service Attention
153153
/sdk/batchai/Microsoft.Azure.Management.BatchAI/ @matthchr
@@ -562,47 +562,24 @@
562562
#/<NotInRepo>/ @kpiteira
563563

564564
# ServiceLabel: %Monitor %Service Attention
565-
/sdk/monitor/ @SameergMS @dadunl
566-
/sdk/monitor/ci.yml @nisha-bhatia @JoshLove-msft @pallavit @Azure/azure-sdk-write-monitor-data-plane
565+
#/<NotInRepo>/ @SameergMS @dadunl @AzMonEssential @AzmonAlerts @AzmonActionG @AzmonLogA
567566

568-
# PRLabel: %Monitor - Ingestion
567+
# PRLabel: %Monitor
568+
/sdk/monitor/ci.yml @nisha-bhatia @JoshLove-msft @pallavit @Azure/azure-sdk-write-monitor-data-plane
569569
/sdk/monitor/Azure.Monitor.Ingestion/ @nisha-bhatia @JoshLove-msft @pallavit @Azure/azure-sdk-write-monitor-data-plane
570-
571-
# PRLabel: %Monitor - Query
572570
/sdk/monitor/Azure.Monitor.Query/ @nisha-bhatia @JoshLove-msft @pallavit @Azure/azure-sdk-write-monitor-data-plane
573571

574572
# PRLabel: %Monitor - ApplicationInsights
575573
# ServiceLabel: %Monitor - ApplicationInsights %Service Attention
576574
/sdk/applicationinsights/Microsoft.Azure.App*/ @omziv @anatse @raronen @ischrei @danhadari @azmonapplicationinsights
577575

578-
# ServiceLabel: %Monitor - Autoscale %Service Attention
579-
#/<NotInRepo>/ @AzMonEssential
580-
581-
# ServiceLabel: %Monitor - ActivityLogs %Service Attention
582-
#/<NotInRepo>/ @AzMonEssential
583-
584-
# PRLabel: %Monitor - Exporter
585-
# ServiceLabel: %Monitor - Exporter %Service Attention
586-
/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/ @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar
587-
588576
# PRLabel: %Monitor - Distro
589577
# ServiceLabel: %Monitor - Distro %Service Attention
590578
/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/ @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar
591579

592-
# ServiceLabel: %Monitor - Metrics %Service Attention
593-
#/<NotInRepo>/ @AzMonEssential
594-
595-
# ServiceLabel: %Monitor - Diagnostic Settings %Service Attention
596-
#/<NotInRepo>/ @AzMonEssential
597-
598-
# ServiceLabel: %Monitor - Alerts %Service Attention
599-
#/<NotInRepo>/ @AzmonAlerts
600-
601-
# ServiceLabel: %Monitor - ActionGroups %Service Attention
602-
#/<NotInRepo>/ @AzmonActionG
603-
604-
# ServiceLabel: %Monitor - LogAnalytics %Service Attention
605-
#/<NotInRepo>/ @AzmonLogA
580+
# PRLabel: %Monitor - Exporter
581+
# ServiceLabel: %Monitor - Exporter %Service Attention
582+
/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/ @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar
606583

607584
# ServiceLabel: %MySQL %Service Attention
608585
/sdk/mysql/Microsoft.Azure.Management.MySQL/ @ajlam @ambhatna @kummanish
@@ -678,7 +655,6 @@
678655
# PRLabel: %OpenAI
679656
/sdk/openai/ @jpalvarezl @trrwilson @joseharriaga @m-nash
680657

681-
# PRLabel: %Monitor - Operational Insights
682658
# ServiceLabel: Monitor - Operational Insights %Service Attention
683659
/sdk/operationalinsights/Microsoft.Azure.Ope*/ @omziv @anatse @raronen @ischrei @danhadari @AzmonLogA
684660

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,13 @@ dotnet test /p:CollectCoverage=true
172172

173173
On developers' machines, you can open `index.html` from within the `TestResults` directory in each of your test projects.
174174
Coverage reports can also be found in Azure Pipelines on the "Code Coverage" tab after a pull request validation build completes.
175-
All covered projects should have 70% or better test coverage.
176175

177176
By default, all _Azure.*_ libraries are covered, and any project that sets the `IsClientLibrary=true` MSBuild property.
178177
To exclude a project, set `ExcludeFromCodeCoverage=true` in the project's MSBuild properties before other targets are imported.
179178

179+
> The Azure SDK team does not mandate a threshold for code coverage nor do we aggregate those metrics in any reports. This metric can be misleading e.g., a client library with a lot of models and few operations could have complete serialization coverage of models but no coverage for operations and still have a high metric.
180+
> We encourage teams to drill into the reports generated locally or in Azure Pipelines on the "Code Coverage" tab to analyze their code coverage as necessary e.g., any code teams have written or client library methods that call an endpoint.
181+
180182
## Public API additions
181183

182184
If you make public API changes or additions, the `eng\scripts\Export-API.ps1` script has to be run to update public API listings. This generates a file in the library's directory similar to the example found in `sdk\template\Azure.Template\api\Azure.Template.netstandard2.0.cs`.

NOTICE.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,20 @@ The attached notices are provided for information only.
228228
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
229229
See the License for the specific language governing permissions and
230230
limitations under the License.
231+
232+
License notice for OpenTelemetry .NET (https://github.com/open-telemetry/opentelemetry-dotnet)
233+
----------------------------------------------------------------------------------------------
234+
235+
Copyright 2023 OpenTelemetry Authors
236+
237+
Licensed under the Apache License, Version 2.0 (the "License");
238+
you may not use this file except in compliance with the License.
239+
You may obtain a copy of the License at
240+
241+
http://www.apache.org/licenses/LICENSE-2.0
242+
243+
Unless required by applicable law or agreed to in writing, software
244+
distributed under the License is distributed on an "AS IS" BASIS,
245+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
246+
See the License for the specific language governing permissions and
247+
limitations under the License.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using NUnit.Framework;
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
using System.Reflection;
9+
10+
namespace Azure.ResourceManager.TestFramework
11+
{
12+
public partial class InheritanceCheckTests
13+
{
14+
private string[] ExceptionList { get; set; }
15+
16+
private const string TestFrameworkAssembly = "Azure.ResourceManager.TestFramework";
17+
private const string AssemblyPrefix = "Azure.ResourceManager.";
18+
private const string TestAssemblySuffix = ".Tests";
19+
20+
[Test]
21+
public void ValidateInheritanceForResourceAndCollectionSuffix()
22+
{
23+
var testAssembly = Assembly.GetExecutingAssembly();
24+
var assemblyName = testAssembly.GetName().Name;
25+
Assert.IsTrue(assemblyName.EndsWith(TestAssemblySuffix), $"The test assembly should end with {TestAssemblySuffix}");
26+
var rpNamespace = assemblyName.Substring(0, assemblyName.Length - TestAssemblySuffix.Length);
27+
28+
if (rpNamespace == TestFrameworkAssembly)
29+
{
30+
return;
31+
}
32+
33+
TestContext.WriteLine($"Testing assembly {rpNamespace}");
34+
35+
if (!rpNamespace.StartsWith(AssemblyPrefix))
36+
{
37+
return;
38+
}
39+
40+
var sdkAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name == rpNamespace) ?? Assembly.Load(rpNamespace);
41+
42+
Assert.IsNotNull(sdkAssembly, $"The SDK assembly {rpNamespace} not found");
43+
44+
// Verify all class end with `Resource` & `Collection`
45+
HashSet<string> exceptionList = ExceptionList == null ? new HashSet<string>() : new HashSet<string>(ExceptionList);
46+
List<string> errorList = new();
47+
48+
foreach (var type in sdkAssembly.GetTypes())
49+
{
50+
if (type.IsClass && type.IsPublic && !exceptionList.Contains(type.Name))
51+
{
52+
if (type.Name.EndsWith("Resource") && !typeof(ArmResource).IsAssignableFrom(type))
53+
{
54+
errorList.Add(type.Name);
55+
}
56+
57+
if (type.Name.EndsWith("Collection") && !typeof(ArmCollection).IsAssignableFrom(type))
58+
{
59+
errorList.Add(type.Name);
60+
}
61+
}
62+
63+
// Remove the elements to verify there is nothing left in this list
64+
if (exceptionList.Contains(type.Name))
65+
{
66+
exceptionList.Remove(type.Name);
67+
}
68+
}
69+
70+
Assert.IsEmpty(exceptionList, "InheritanceCheck exception list have values which is not included in current package, please check: " + string.Join(",", exceptionList));
71+
Assert.IsEmpty(errorList, "InheritanceCheck failed with Type: " + string.Join(",", errorList));
72+
}
73+
}
74+
}

eng/Directory.Build.Common.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
<Compile Include="$(AzureCoreSharedSources)ChangeTrackingDictionary.cs" LinkBase="Shared/Core" />
202202
<Compile Include="$(AzureCoreSharedSources)ChangeTrackingList.cs" LinkBase="Shared/Core" />
203203
<Compile Include="$(AzureCoreSharedSources)ClientDiagnostics.cs" LinkBase="Shared/Core" />
204+
<Compile Include="$(AzureCoreSharedSources)TrimmingAttribute.cs" LinkBase="Shared/Core" />
204205
<Compile Include="$(AzureCoreSharedSources)DiagnosticScope.cs" LinkBase="Shared/Core" />
205206
<Compile Include="$(AzureCoreSharedSources)DiagnosticScopeFactory.cs" LinkBase="Shared/Core" />
206207
<Compile Include="$(AzureCoreSharedSources)FixedDelayWithNoJitterStrategy.cs" LinkBase="Shared/Core" />
@@ -250,6 +251,7 @@
250251
<PackageReference Include="System.Text.Json" />
251252

252253
<!-- TODO: Review these file references-->
254+
<Compile Include="$(AzureCoreSharedSources)NoValueResponseOfT.cs" LinkBase="Shared" />
253255
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared" />
254256
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared" />
255257
<Compile Include="$(AzureCoreSharedSources)ForwardsClientCallsAttribute.cs" LinkBase="Shared/Core" />

eng/Packages.Data.props

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@
107107
<!-- Other approved packages -->
108108
<PackageReference Update="Microsoft.Azure.Amqp" Version="2.6.3" />
109109
<PackageReference Update="Microsoft.Azure.WebPubSub.Common" Version="1.2.0" />
110-
<PackageReference Update="Microsoft.Identity.Client" Version="4.54.1" />
111-
<PackageReference Update="Microsoft.Identity.Client.Extensions.Msal" Version="2.31.0" />
110+
<PackageReference Update="Microsoft.Identity.Client" Version="4.56.0" />
111+
<PackageReference Update="Microsoft.Identity.Client.Extensions.Msal" Version="4.56.0" />
112112
<!--
113113
TODO: This package needs to be released as GA and arch-board approved before taking a dependency in any stable SDK library.
114114
Currently, it is referencd by Azure.Identity.BrokeredAuthentication which is still in beta
115115
-->
116-
<PackageReference Update="Microsoft.Identity.Client.Broker" Version="4.54.1" />
116+
<PackageReference Update="Microsoft.Identity.Client.Broker" Version="4.56.0" />
117117

118118
<!-- TODO: Make sure this package is arch-board approved -->
119119
<PackageReference Update="System.IdentityModel.Tokens.Jwt" Version="6.5.0" />
@@ -129,7 +129,7 @@
129129
<PackageReference Update="OpenTelemetry.Instrumentation.Http" Version="1.5.1-beta.1" />
130130
<PackageReference Update="OpenTelemetry.Instrumentation.SqlClient" Version="1.5.1-beta.1" />
131131
<PackageReference Update="OpenTelemetry.PersistentStorage.FileSystem" Version="1.0.0" />
132-
<PackageReference Update="OpenTelemetry.ResourceDetectors.Azure" Version="1.0.0-beta.2" />
132+
<PackageReference Update="OpenTelemetry.ResourceDetectors.Azure" Version="1.0.0-beta.3" />
133133
</ItemGroup>
134134

135135
<!--
@@ -140,14 +140,17 @@
140140
<PackageReference Update="Apache.Avro" Version="1.11.0" />
141141
<PackageReference Update="CloudNative.CloudEvents" Version="2.0.0" />
142142
<PackageReference Update="CloudNative.CloudEvents.SystemTextJson" Version="2.0.0" />
143+
<PackageReference Update="Google.Protobuf" Version="3.24.3" />
144+
<PackageReference Update="Grpc.Tools" Version="2.51.0" PrivateAssets="all" />
143145
<PackageReference Update="MessagePack" Version="1.9.11" />
144146
<PackageReference Update="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="1.1.5" />
145147
<PackageReference Update="Microsoft.Azure.SignalR" Version="1.21.6" />
146148
<PackageReference Update="Microsoft.Azure.SignalR.Management" Version="1.21.6" />
147149
<PackageReference Update="Microsoft.Azure.SignalR.Protocols" Version="1.21.6" />
148150
<PackageReference Update="Microsoft.Azure.SignalR.Serverless.Protocols" Version="1.9.0" />
149151
<PackageReference Update="Microsoft.Azure.WebJobs" Version="3.0.37" />
150-
<PackageReference Update="Microsoft.Azure.WebJobs.Sources" Version="3.0.37" />
152+
<PackageReference Update="Microsoft.Azure.WebJobs.Sources" Version="3.0.37" PrivateAssets="All"/>
153+
<PackageReference Update="Microsoft.Azure.WebJobs.Extensions.Rpc" Version="3.0.37" />
151154
<PackageReference Update="Microsoft.Azure.WebJobs.Host.Storage" Version="5.0.0" />
152155
<PackageReference Update="Microsoft.Spatial" Version="7.5.3" />
153156
<PackageReference Update="Newtonsoft.Json" Version="10.0.3" />
@@ -174,8 +177,8 @@
174177
All should have PrivateAssets="All" set so they don't become package dependencies
175178
-->
176179
<ItemGroup>
177-
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20230917.2" PrivateAssets="All" />
178-
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20230822.1" PrivateAssets="All" />
180+
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20230928.1" PrivateAssets="All" />
181+
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20230927.2" PrivateAssets="All" />
179182
<PackageReference Update="coverlet.collector" Version="3.2.0" PrivateAssets="All" />
180183
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1" PrivateAssets="All" />
181184
<PackageReference Update="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.2" PrivateAssets="All" />
@@ -204,6 +207,7 @@
204207
<PackageReference Update="Azure.ResourceManager.Network" Version="1.1.0" />
205208
<PackageReference Update="Azure.ResourceManager.OperationalInsights" Version="1.0.0" />
206209
<PackageReference Update="Azure.ResourceManager.PrivateDns" Version="1.0.0" />
210+
<PackageReference Update="Azure.ResourceManager.RecoveryServices" Version="1.1.0" />
207211
<PackageReference Update="Azure.ResourceManager.Resources" Version="1.4.0" />
208212
<PackageReference Update="Azure.ResourceManager.Storage" Version="1.1.0" />
209213
<PackageReference Update="Azure.ResourceManager.EventHubs" Version="1.0.0" />

eng/common/pipelines/templates/steps/sparse-checkout.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ steps:
2929
if (!$dir) {
3030
$dir = "./$($repository.Name)"
3131
}
32-
New-Item $dir -ItemType Directory -Force
32+
New-Item $dir -ItemType Directory -Force | Out-Null
3333
Push-Location $dir
3434
3535
if (Test-Path .git/info/sparse-checkout) {
@@ -70,9 +70,14 @@ steps:
7070
7171
# sparse-checkout commands after initial checkout will auto-checkout again
7272
if (!$hasInitialized) {
73-
Write-Host "git -c advice.detachedHead=false checkout $($repository.Commitish)"
73+
# Remove refs/heads/ prefix from branch names
74+
$commitish = $repository.Commitish -replace '^refs/heads/', ''
75+
76+
# use -- to prevent git from interpreting the commitish as a path
77+
Write-Host "git -c advice.detachedHead=false checkout $commitish --"
78+
7479
# This will use the default branch if repo.Commitish is empty
75-
git -c advice.detachedHead=false checkout $($repository.Commitish)
80+
git -c advice.detachedHead=false checkout $commitish --
7681
} else {
7782
Write-Host "Skipping checkout as repo has already been initialized"
7883
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
param(
2+
[string]$Variable,
3+
[switch]$IsOutput
4+
)
5+
6+
$repoUrl = $env:BUILD_REPOSITORY_URI
7+
$sourceBranch = $env:BUILD_SOURCEBRANCH
8+
9+
$description = "[$sourceBranch]($repoUrl/tree/$sourceBranch)"
10+
if ($sourceBranch -match "^refs/heads/(.+)$") {
11+
$description = "Branch: [$($Matches[1])]($repoUrl/tree/$sourceBranch)"
12+
} elseif ($sourceBranch -match "^refs/tags/(.+)$") {
13+
$description = "Tag: [$($Matches[1])]($repoUrl/tree/$sourceBranch)"
14+
} elseif ($sourceBranch -match "^refs/pull/(\d+)/(head|merge)$") {
15+
$description = "Pull request: $repoUrl/pull/$($Matches[1])"
16+
}
17+
18+
if ($IsOutput) {
19+
Write-Host "Setting output variable '$Variable' to '$description'"
20+
Write-Host "##vso[task.setvariable variable=$Variable;isoutput=true]$description"
21+
} else {
22+
Write-Host "Setting variable '$Variable' to '$description'"
23+
Write-Host "##vso[task.setvariable variable=$Variable]$description"
24+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
function Invoke-LoggedCommand($Command, $ExecutePath, [switch]$GroupOutput)
2+
{
3+
$pipelineBuild = !!$env:TF_BUILD
4+
$startTime = Get-Date
5+
6+
if($pipelineBuild -and $GroupOutput) {
7+
Write-Host "##[group]$Command"
8+
} else {
9+
Write-Host "> $Command"
10+
}
11+
12+
if($ExecutePath) {
13+
Push-Location $ExecutePath
14+
}
15+
16+
try {
17+
Invoke-Expression $Command
18+
19+
$duration = (Get-Date) - $startTime
20+
21+
if($pipelineBuild -and $GroupOutput) {
22+
Write-Host "##[endgroup]"
23+
}
24+
25+
if($LastExitCode -ne 0)
26+
{
27+
if($pipelineBuild) {
28+
Write-Error "##[error]Command failed to execute ($duration): $Command`n"
29+
} else {
30+
Write-Error "Command failed to execute ($duration): $Command`n"
31+
}
32+
}
33+
else {
34+
Write-Host "Command succeeded ($duration)`n"
35+
}
36+
}
37+
finally {
38+
if($ExecutePath) {
39+
Pop-Location
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)