Skip to content

testing aot pipeline updates #50499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/prompts/analyze-aot-warnings.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
mode: 'ask'
---
Expected output and any relevant constraints for this task.
6 changes: 5 additions & 1 deletion eng/Directory.Build.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,18 @@

<!-- Parse out the service directory based on the relative path to the sdk folder -->
<ServiceDirectory><![CDATA[$([System.Text.RegularExpressions.Regex]::Replace($(PackageRootDirectory), '^.*[\\/]+sdk[\\/]+([^\\/]+).*$', '$1'))]]></ServiceDirectory>

<!-- Check if the project has IsAotCompatible set to true -->
<PackageIsAotCompatible>false</PackageIsAotCompatible>
<PackageIsAotCompatible Condition="'$(IsAotCompatible)' == 'true'">true</PackageIsAotCompatible>

<!-- Format package info line for output -->
<PackageInfoText Condition="'$(IsShippingLibrary)' == 'true'">'$(PackageRootDirectory)' '$(ServiceDirectory)' '$(PackageId)' '$(VersionForProperties)' '$(PackageSdkType)' '$(PackageIsNewSdk)' '$(BaseOutputPath)'</PackageInfoText>
</PropertyGroup>

<ItemGroup Condition="'$(IsShippingLibrary)' == 'true'">
<PackageInfoLine Include="$(PackageInfoText)" />
</ItemGroup>

</Target>

<Target Name="GetCodeGenProjects" Returns="@(ProjectsToInclude)">
Expand Down
27 changes: 16 additions & 11 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Get-AllPackageInfoFromRepo($serviceDirectory)
continue
}

$pkgPath, $serviceDirectory, $pkgName, $pkgVersion, $sdkType, $isNewSdk, $dllFolder = $projectOutput.Split("' '", [System.StringSplitOptions]::RemoveEmptyEntries).Trim("' ")
$pkgPath, $serviceDirectory, $pkgName, $pkgVersion, $sdkType, $isNewSdk, $dllFolder, $isAotCompatible = $projectOutput.Split("' '", [System.StringSplitOptions]::RemoveEmptyEntries).Trim("' ")
if(!(Test-Path $pkgPath)) {
Write-Host "Parsed package path `$pkgPath` does not exist so skipping the package line '$projectOutput'."
continue
Expand All @@ -67,23 +67,28 @@ function Get-AllPackageInfoFromRepo($serviceDirectory)
$ciProps = $pkgProp.GetCIYmlForArtifact()

if ($ciProps) {
# CheckAOTCompat is opt _in_, so we should default to false if not specified
# see if the check is enabled/disabled in the CI.yml
$shouldAot = GetValueSafelyFrom-Yaml $ciProps.ParsedYml @("extends", "parameters", "CheckAOTCompat")
if ($null -ne $shouldAot) {
$parsedBool = $null
if ([bool]::TryParse($shouldAot, [ref]$parsedBool)) {
$pkgProp.CIParameters["CheckAOTCompat"] = $parsedBool
}
}
else
{
# respect the ci file first, but if it is not specified, then we should check the project file
$pkgProp.CIParameters["CheckAOTCompat"] = ($isAotCompatible -eq 'true')
}

# when AOTCompat is true, there is an additional parameter we need to retrieve
$aotArtifacts = GetValueSafelyFrom-Yaml $ciProps.ParsedYml @("extends", "parameters", "AOTTestInputs")
if ($aotArtifacts) {
$aotArtifacts = $aotArtifacts | Where-Object { $_.ArtifactName -eq $pkgProp.ArtifactName }
$pkgProp.CIParameters["AOTTestInputs"] = $aotArtifacts
}
# see if the AOT artifacts are specified in the CI.yml
$aotArtifacts = GetValueSafelyFrom-Yaml $ciProps.ParsedYml @("extends", "parameters", "AOTTestInputs")
if ($aotArtifacts) {
$aotArtifacts = $aotArtifacts | Where-Object { $_.ArtifactName -eq $pkgProp.ArtifactName }
$pkgProp.CIParameters["AOTTestInputs"] = $aotArtifacts
}
else {
$pkgProp.CIParameters["CheckAOTCompat"] = $false
else
{
$pkgProp.CIParameters["AOTTestInputs"] = @()
}

Expand All @@ -102,7 +107,7 @@ function Get-AllPackageInfoFromRepo($serviceDirectory)
# if the package isn't associated with a CI.yml, we still want to set the defaults values for these parameters
# so that when we are checking the package set for which need to "Build Snippets" or "Check AOT" we won't crash due to the property being null
else {
$pkgProp.CIParameters["CheckAOTCompat"] = $false
$pkgProp.CIParameters["CheckAOTCompat"] = ($isAotCompatible -eq 'true')
$pkgProp.CIParameters["AOTTestInputs"] = @()
$pkgProp.CIParameters["BuildSnippets"] = $true
}
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<PackageTags>Microsoft Azure Application Configuration;Data;AppConfig;$(PackageCommonTags)</PackageTags>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<NoWarn>$(NoWarn);3021;</NoWarn>
<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
</PropertyGroup>

Expand Down
6 changes: 1 addition & 5 deletions sdk/appconfiguration/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,4 @@ extends:
ArtifactName: packages
Artifacts:
- name: Azure.Data.AppConfiguration
safeName: AzureDataAppConfiguration
CheckAOTCompat: true
AOTTestInputs:
- ArtifactName: Azure.Data.AppConfiguration
ExpectedWarningsFilepath: None
safeName: AzureDataAppConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

<!-- Make sure that we don't pull in additional dependencies during build or package -->
<ImportDefaultReferences>false</ImportDefaultReferences>

<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EnableClientSdkAnalyzers>false</EnableClientSdkAnalyzers>
Expand Down
4 changes: 0 additions & 4 deletions sdk/extensions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ extends:
safeName: AzureExtensionsAspNetCoreConfigurationSecrets
- name: Microsoft.Azure.WebJobs.Extensions.Clients
safeName: MicrosoftAzureWebJobsExtensionsClients
CheckAOTCompat: false
AOTTestInputs:
- ArtifactName: Microsoft.Extensions.Azure
ExpectedWarningsFilepath: None
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<TargetFrameworks Condition="$([MSBuild]::IsOsPlatform('OSX'))">$(RequiredTargetFrameworks);net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOsPlatform('Linux'))">$(RequiredTargetFrameworks);net8.0</TargetFrameworks>
<NoWarn>$(NoWarn);3021</NoWarn>
<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions sdk/identity/Azure.Identity/src/Azure.Identity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<PackageTags>Microsoft Azure Identity;$(PackageCommonTags)</PackageTags>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<NoWarn>$(NoWarn);3021;AZC0011</NoWarn>
<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<!--Conditionally define the PREVIEW_FEATURE_FLAG constant if the version is pre-release-->
Expand Down
3 changes: 0 additions & 3 deletions sdk/identity/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ extends:
safeName: AzureIdentity
- name: Azure.Identity.Broker
safeName: AzureIdentityBroker
CheckAOTCompat: true
AOTTestInputs:
- ArtifactName: Azure.Identity
ExpectedWarningsFilepath: None
- ArtifactName: Azure.Identity.Broker
ExpectedWarningsFilepath: "Azure.Identity.Broker/tests/compatibility/ExpectedWarnings.txt"
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<NoWarn>$(NoWarn);3021</NoWarn>
<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
</PropertyGroup>
Expand Down
4 changes: 0 additions & 4 deletions sdk/keyvault/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,3 @@ extends:
safeName: AzureSecurityKeyVaultSecrets
triggeringPaths:
- Azure.Security.Keyvault.Shared
CheckAOTCompat: true
AOTTestInputs:
- ArtifactName: Azure.Security.KeyVault.Secrets
ExpectedWarningsFilepath: None
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
<DefineConstants>$(DefineConstants);AZURE_MONITOR_EXPORTER;</DefineConstants>
<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Diagnostics.CodeAnalysis;

namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models
{
/// <summary> Additional properties used to calculate metrics. </summary>
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
internal partial struct DocumentType
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ private static MethodInfo GetMethodInfo<T1, T2, TResult>(Expression<Func<T1, T2,
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Expression is not a method"), nameof(expression));
}

[UnconditionalSuppressMessage("AOT", "IL2072", Justification = "The DocumentIngress class and its derived classes have DynamicallyAccessedMembers attribute applied to preserve public properties.")]
private static Type GetPropertyTypeFromFieldName(string fieldName)
{
try
Expand Down
6 changes: 1 addition & 5 deletions sdk/monitor/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,4 @@ extends:
- name: Azure.Monitor.Query
safeName: AzureMonitorQuery
- name: Azure.Monitor.Ingestion
safeName: AzureMonitorIngestion
CheckAOTCompat: true
AOTTestInputs:
- ArtifactName: Azure.Monitor.OpenTelemetry.Exporter
ExpectedWarningsFilepath: None
safeName: AzureMonitorIngestion
1 change: 0 additions & 1 deletion sdk/servicebus/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ extends:
Artifacts:
- name: Azure.Messaging.ServiceBus
safeName: AzureMessagingServiceBus
CheckAotCompat: true
AOTTestInputs:
- ArtifactName: Azure.Messaging.ServiceBus
ExpectedWarningsFilepath: Azure.Messaging.ServiceBus/tests/aotcompatibility/ExpectedWarnings.txt
4 changes: 0 additions & 4 deletions sdk/storage/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,3 @@ extends:
skipSmokeTests: true
TestSetupSteps:
- template: /sdk/storage/tests-install-azurite.yml
CheckAOTCompat: true
AOTTestInputs:
- ArtifactName: Azure.Storage.Blobs
ExpectedWarningsFilepath: None