Skip to content

Commit e923f2d

Browse files
Bug fix and improvement to aggregate reports pipeline (#25503)
* Bug fix and improvement to aggregate reports pipeline * Build all packages * Add script for download packages from artifacts dev feed * Update dependency graph * Use alpha versions when downloading nuget files from DevOps feed * Use alpha versions where available, else use latest dev version * Switch to using Install-Package
1 parent c8ab8d8 commit e923f2d

File tree

7 files changed

+120
-39
lines changed

7 files changed

+120
-39
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Azure SDK for .NET
22

3-
[![Packages](https://img.shields.io/badge/packages-latest-blue.svg)](https://azure.github.io/azure-sdk/releases/latest/dotnet.html) [![Dependencies](https://img.shields.io/badge/dependency-report-blue.svg)](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-net/dependencies/dependencies.html) [![Dependencies Graph](https://img.shields.io/badge/dependency-graph-blue.svg)](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-net/dependencies/InterdependencyGraph.html)
3+
[![Packages](https://img.shields.io/badge/packages-latest-blue.svg)](https://azure.github.io/azure-sdk/releases/latest/dotnet.html) [![Dependencies](https://img.shields.io/badge/dependency-report-blue.svg)](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-net/dependencies/dependencies.html) [![Dependencies Graph](https://img.shields.io/badge/dependency-graph-blue.svg)](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-net/dependencies/dependencyGraph/dagre.html)
44

55
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our [public developer docs](https://docs.microsoft.com/dotnet/azure/) or our versioned [developer docs](https://azure.github.io/azure-sdk-for-net).
66

doc/Data Plane Code Generation/AzureSDKCodeGeneration_DataPlane_Quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ In Visual Studio:
8484

8585
You'll notice that the `Azure.<group>.<service>` project has `properties/AssemblyInfo.cs` file in it. Replace `Microsoft.Test` namespace with the correct resource provider namepace for your service.
8686

87-
**Learn more:** see the [Azure Services Resource Providers](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers) for the list of possible namespaces.
87+
**Learn more:** see the [Azure Services Resource Providers](https://docs.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) for the list of possible namespaces.
8888

8989
#### 5. Save and commit your changes to your branch
9090

eng/pipelines/aggregate-reports.yml

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
resources:
2-
pipelines:
3-
- pipeline: net-core
4-
project: internal
5-
source: net - core
6-
branch: main
7-
tags:
8-
- scheduled
9-
101
trigger: none
112

123
pr:
@@ -31,10 +22,16 @@ stages:
3122
- job: GenerateReports
3223
timeoutInMinutes: 120
3324
steps:
34-
- download: net-core
35-
artifact: packages
36-
patterns: '*'
37-
displayName: "Download packages artifacts from 'net - core' pipeline "
25+
- template: /eng/pipelines/templates/steps/install-dotnet.yml
26+
27+
- task: PowerShell@2
28+
displayName: Download Latest Dev Packages
29+
inputs:
30+
pwsh: true
31+
filePath: 'eng/scripts/DownloadDevPackages.ps1'
32+
arguments: >
33+
-WorkingDirectory '$(Build.ArtifactStagingDirectory)'
34+
-NupkgFilesDestination 'nupkgFiles'
3835
3936
- pwsh: |
4037
npx cspell lint `
@@ -53,39 +50,27 @@ stages:
5350
CheckLinkGuidance: $true
5451

5552
- pwsh: |
56-
mkdir "$(System.ArtifactsDirectory)/BuildArtifacts"
57-
ls "$(PIPELINE.WORKSPACE)/net-core/packages"
58-
Copy-Item -Path "$(PIPELINE.WORKSPACE)/net-core/packages/*" -Destination "$(System.ArtifactsDirectory)/BuildArtifacts"
59-
displayName: Create Artifact Directory
60-
61-
- pwsh: |
62-
mkdir '$(System.ArtifactsDirectory)/Packages'
63-
Move-Item -Path '$(System.ArtifactsDirectory)/BuildArtifacts/*' -Destination '$(System.ArtifactsDirectory)/Packages/' -Include Azure.*.nupkg -Exclude *.symbols.nupkg
64-
displayName: Isolate packages to process
65-
66-
- pwsh: |
67-
mkdir '$(Build.ArtifactStagingDirectory)/reports'
68-
Copy-Item -Path '$(Build.SourcesDirectory)/eng/common/InterdependencyGraph.html' -Destination '$(Build.ArtifactStagingDirectory)/reports/InterdependencyGraph.html'
69-
displayName: Setup reports directory
53+
New-Item -Path '$(Build.ArtifactStagingDirectory)' -Name 'reports' -ItemType 'directory'
54+
displayName: Create Directory for Aggregate Reports
7055
7156
- task: PowerShell@2
7257
displayName: Generate Dependency Report
7358
inputs:
7459
pwsh: true
7560
filePath: 'eng/scripts/dependencies/AnalyzeDeps.ps1'
7661
arguments: >
77-
-PackagesPath '$(System.ArtifactsDirectory)/Packages/'
62+
-PackagesPath '$(Build.ArtifactStagingDirectory)/nupkgFiles'
7863
-LockfilePath '$(Build.SourcesDirectory)/eng/Packages.Data.props'
7964
-OutPath '$(Build.ArtifactStagingDirectory)/reports/dependencies.html'
80-
-DumpPath '$(Build.ArtifactStagingDirectory)/reports/data.js'
65+
-DumpPath '$(Build.ArtifactStagingDirectory)/reports'
8166
8267
- task: PowerShell@2
8368
displayName: 'Generate azure-sdk.deps.json'
8469
inputs:
8570
pwsh: true
8671
filePath: 'eng/scripts/dependencies/generate-deps.ps1'
8772
arguments: >
88-
-PackagesPath '$(System.ArtifactsDirectory)/Packages/'
73+
-PackagesPath '$(Build.ArtifactStagingDirectory)/nupkgFiles'
8974
-DepsOutputFile '$(Build.ArtifactStagingDirectory)/reports/azure-sdk.deps.json'
9075
-ProjectRefPath '$(Build.ArtifactStagingDirectory)/reports'
9176
@@ -122,15 +107,27 @@ stages:
122107
artifactName: reports
123108
path: '$(Build.ArtifactStagingDirectory)/reports'
124109

125-
- task: AzureFileCopy@2
126-
displayName: 'Upload dependency report'
110+
- task: AzureFileCopy@4
111+
displayName: 'Upload Dependency Report'
127112
inputs:
128-
sourcePath: '$(Build.ArtifactStagingDirectory)/reports'
113+
sourcePath: '$(Build.ArtifactStagingDirectory)/reports/*'
129114
azureSubscription: 'Azure SDK Artifacts'
130115
destination: AzureBlob
131116
storage: azuresdkartifacts
132117
containerName: 'azure-sdk-for-net'
133118
blobPrefix: dependencies
119+
AdditionalArgumentsForBlobCopy: '--exclude-pattern=*data.js*'
120+
121+
- task: AzureFileCopy@4
122+
displayName: 'Upload Dependency Graph'
123+
inputs:
124+
sourcePath: '$(Build.ArtifactStagingDirectory)/reports/*'
125+
azureSubscription: 'Azure SDK Artifacts'
126+
destination: AzureBlob
127+
storage: azuresdkartifacts
128+
containerName: 'azure-sdk-for-net'
129+
blobPrefix: dependencies/dependencyGraph
130+
AdditionalArgumentsForBlobCopy: '--include-pattern=*data.js*'
134131

135132
- task: PowerShell@2
136133
displayName: "Verify Repository Resource Refs"
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
param (
2+
[Parameter(Mandatory=$True)]
3+
[string] $WorkingDirectory,
4+
[Parameter(Mandatory=$True)]
5+
[string] $NupkgFilesDestination,
6+
# Install-Package requires a v2 nuget feed.
7+
[string] $NugetSource="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v2",
8+
[string] $FeedId="azure-sdk-for-net"
9+
)
10+
11+
. (Join-Path $PSScriptRoot ".." common scripts common.ps1)
12+
13+
$allPackages = Get-AllPkgProperties
14+
$trackTwoPackages = $allPackages.Where({ $_.IsNewSdk })
15+
16+
Write-Host "Number of track two packages $($trackTwoPackages.Count)"
17+
18+
Push-Location $WorkingDirectory
19+
$nugetPackagesPath = Join-Path $WorkingDirectory nugetPackages
20+
New-Item -Path $WorkingDirectory -Type "directory" -Name "nugetPackages"
21+
22+
23+
foreach ($package in $trackTwoPackages)
24+
{
25+
$packageVersion = [AzureEngSemanticVersion]::ParseVersionString($package.Version)
26+
$packageVersion.IsPreRelease = $false # Clear prerelease so ToString strips it prerelease label.
27+
$packageVersionBase = $packageVersion.ToString()
28+
29+
# To workaround some older invalid packages (i.e. Iot->IoT renamed packages) start the alpha version range to start at 6/21
30+
$installedPackage = Install-Package -Name $package.Name `
31+
-Source $NugetSource `
32+
-AllowPrereleaseVersions `
33+
-MinimumVersion "$packageVersionBase-alpha.202106" `
34+
-MaximumVersion "$packageVersionBase-alphab" `
35+
-Destination $nugetPackagesPath `
36+
-Force `
37+
-SkipDependencies `
38+
-ErrorAction Ignore
39+
40+
if ($installedPackage)
41+
{
42+
Write-Host "Installed $($installedPackage.Name) $($installedPackage.Version)"
43+
}
44+
else
45+
{
46+
# Install the latest available version if no alpha version is found
47+
$latestInstalledPackage = Install-Package -Name $package.Name `
48+
-Source $NugetSource `
49+
-AllowPrereleaseVersions `
50+
-Destination $nugetPackagesPath `
51+
-Force `
52+
-SkipDependencies `
53+
-ErrorAction Ignore
54+
55+
if ($latestInstalledPackage)
56+
{
57+
Write-Host "Installed latest version $($latestInstalledPackage.Name) $($latestInstalledPackage.Version)"
58+
}
59+
else
60+
{
61+
Write-Host "Did not find any matching package $($package.Name)"
62+
}
63+
}
64+
}
65+
66+
$nupkgDirPath = Join-Path $WorkingDirectory $NupkgFilesDestination
67+
New-Item -Path $WorkingDirectory -Type "directory" -Name $NupkgFilesDestination
68+
69+
Get-ChildItem -Path $nugetPackagesPath -Include *.nupkg -Recurse | Copy-Item -Destination $nupkgDirPath

eng/scripts/dependencies/AnalyzeDeps.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ if ($DumpPath) {
249249
Write-Host "Generating JSONP data export..."
250250
$Internal = $Pkgs.Keys | ForEach-Object ToString
251251
$DumpData = Get-PackageExport $Pkgs $Internal
252-
"const data = " + (ConvertTo-Json -InputObject $DumpData -Compress -Depth 10) + ";" | Out-File -FilePath $DumpPath
252+
Write-Host $DumpData
253+
$DumpDataJson = ConvertTo-Json -InputObject $DumpData -Compress -Depth 10
254+
Write-Host $DumpDataJson
255+
$DumpDataJson | Out-File -FilePath "${DumpPath}/arcdata.json"
256+
"const data = " + $DumpDataJson + ";" | Out-File -FilePath "${DumpPath}/data.js"
253257
}
254258

255259
exit $ExitCode

eng/scripts/dependencies/generate-deps.ps1

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ param(
77
mkdir $ProjectRefPath -force | out-null
88
$projRefsPath = Join-Path $ProjectRefPath "azure-sdk-projectreferences.props"
99

10+
#See issues
11+
# https://github.com/Azure/azure-sdk-for-net/issues/25827
12+
# https://github.com/Azure/azure-sdk-for-net/issues/25824
13+
$ignoreList = @(
14+
"Azure.Monitor.OpenTelemetry.Exporter",
15+
"Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents"
16+
)
17+
1018
$projectRefsContents = @"
1119
<?xml version="1.0" encoding="utf-8"?>
1220
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@@ -18,7 +26,10 @@ foreach ($pkg in (Get-ChildItem "$PackagesPath/*" -Include *.nupkg -Exclude *.sy
1826
{
1927
if ($pkg.Name -match "(?<pkg>[^\\]+)\.(?<ver>\d+\.\d+\.\d+.*)\.nupkg")
2028
{
21-
$projectRefsContents += " <PackageReference Include=`"$($matches['pkg'])`" Version=`"$($matches['ver'])`" />`n"
29+
if ($matches['pkg'] -notin $ignoreList)
30+
{
31+
$projectRefsContents += " <PackageReference Include=`"$($matches['pkg'])`" Version=`"$($matches['ver'])`" />`n"
32+
}
2233
}
2334
}
2435

@@ -29,6 +40,6 @@ $projectRefsContents += @"
2940

3041
Set-Content -Path $projRefsPath -Value $projectRefsContents
3142

32-
$cmd = "dotnet build $PSScriptRoot/azure-sdk.deps.csproj /t:GenerateDepsFile /p:PublishDepsFilePath=$DepsOutputFile /p:AzureSdkProjectReferencesPath=$projRefsPath /p:RestoreAdditionalProjectSources=$PackagesPath"
43+
$cmd = "dotnet build $PSScriptRoot/azure-sdk.deps.csproj /t:GenerateDepsFile /p:PublishDepsFilePath=""$DepsOutputFile"" /p:AzureSdkProjectReferencesPath=""$projRefsPath"" /p:RestoreAdditionalProjectSources=""$PackagesPath"""
3344
Write-Host $cmd
3445
Invoke-Expression $cmd

sdk/communication/Azure.Communication.PhoneNumbers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
158158
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
159159
[coc_contact]: mailto:opencode@microsoft.com
160160
<!--[package]: https://www.nuget.org/packages/Azure.Communication.PhoneNumbers-->
161-
[phone_numbers]: https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/get-phone-number?pivots=programming-language-csharp
161+
[phone_numbers]: https://docs.microsoft.com/azure/communication-services/quickstarts/telephony/get-phone-number?pivots=platform-azp
162162
[product_docs]: https://docs.microsoft.com/azure/communication-services/overview
163163
[nuget]: https://www.nuget.org/
164164
[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp

0 commit comments

Comments
 (0)