From 9a0c5a89fa94dca6ac197fdff7e5083e6f4ba690 Mon Sep 17 00:00:00 2001 From: jolov Date: Mon, 23 Mar 2026 18:12:01 -0700 Subject: [PATCH 1/5] fix: use js dev feed in Update-PackageJson.ps1 Update npm commands to explicitly use the azure-sdk-for-js dev feed via --registry flag, making the script self-contained rather than depending on pipeline .npmrc configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../eng/scripts/Update-PackageJson.ps1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/http-client-csharp/eng/scripts/Update-PackageJson.ps1 b/packages/http-client-csharp/eng/scripts/Update-PackageJson.ps1 index d380b73361e..9f45df340e8 100644 --- a/packages/http-client-csharp/eng/scripts/Update-PackageJson.ps1 +++ b/packages/http-client-csharp/eng/scripts/Update-PackageJson.ps1 @@ -25,6 +25,9 @@ param( $ErrorActionPreference = 'Stop' Set-StrictMode -Version 3.0 +# Internal dev feed for npm package resolution +$DevFeedUrl = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/" + # Define the list of dependencies to inject $InjectedDependencies = @( '@azure-tools/typespec-azure-core', @@ -41,7 +44,7 @@ function Test-PackageVersion { ) Write-Host "Checking if $PackageName@$Version exists..." - $checkResult = & npm view "$PackageName@$Version" version 2>&1 + $checkResult = & npm view "$PackageName@$Version" version --registry $DevFeedUrl 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host "✓ Found $PackageName@$Version" @@ -61,7 +64,7 @@ function Get-PackageDependencyVersion { ) Write-Host "Getting $DependencyName version from $PackageName@$PackageVersion..." - $result = & npm view "$PackageName@$PackageVersion" devDependencies.$DependencyName 2>&1 + $result = & npm view "$PackageName@$PackageVersion" devDependencies.$DependencyName --registry $DevFeedUrl 2>&1 if ($LASTEXITCODE -eq 0 -and $result) { $dependencyVersion = $result.Trim() @@ -81,7 +84,7 @@ function Get-LatestGAVersion { ) Write-Host "Getting latest GA version for $PackageName..." - $result = & npm view $PackageName dist-tags.latest 2>&1 + $result = & npm view $PackageName dist-tags.latest --registry $DevFeedUrl 2>&1 if ($LASTEXITCODE -eq 0 -and $result) { $latestVersion = $result.Trim() @@ -102,7 +105,7 @@ function Test-TcgcCompatibility { ) Write-Host "Checking if $PackageName@$PackageVersion is compatible with tcgc@$TcgcVersion..." - $tcgcRange = & npm view "${PackageName}@${PackageVersion}" "peerDependencies.@azure-tools/typespec-client-generator-core" 2>&1 + $tcgcRange = & npm view "${PackageName}@${PackageVersion}" "peerDependencies.@azure-tools/typespec-client-generator-core" --registry $DevFeedUrl 2>&1 if ($LASTEXITCODE -ne 0 -or -not $tcgcRange) { Write-Host " No tcgc peer dependency found, assuming compatible" @@ -131,7 +134,7 @@ function Get-PreviousGAVersions { ) Write-Host "Getting previous GA versions of $PackageName (before $BeforeVersion)..." - $result = & npm view $PackageName versions --json 2>&1 + $result = & npm view $PackageName versions --json --registry $DevFeedUrl 2>&1 if ($LASTEXITCODE -ne 0) { Write-Warning "Could not retrieve versions for $PackageName" @@ -283,7 +286,7 @@ try { # Validate dependencies by running npm install Write-Host "Validating dependencies with npm install..." - $npmInstallResult = & npm install 2>&1 + $npmInstallResult = & npm install --registry $DevFeedUrl 2>&1 if ($LASTEXITCODE -ne 0) { Write-Error "npm install failed after injecting dependencies: $npmInstallResult" exit 1 From 63970b38a9d80a7238e2f3c10aa765977ceb0075 Mon Sep 17 00:00:00 2001 From: jolov Date: Mon, 23 Mar 2026 19:22:04 -0700 Subject: [PATCH 2/5] feat: regenerate emitter version dashboard in azure-sdk-for-net PRs Run Emitter_Version_Dashboard.ps1 from the cloned azure-sdk-for-net repo after updating package versions, so the dashboard stays in sync with dependency changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../eng/scripts/Submit-AzureSdkForNetPr.ps1 | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 index e18ad8d1f8f..b493d759a0d 100755 --- a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 +++ b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 @@ -149,7 +149,8 @@ try { # Set the sparse checkout patterns - only the directories we need # Note: 'eng' covers eng/packages/http-client-csharp, eng/packages/http-client-csharp-mgmt, and all eng/ artifacts - git sparse-checkout set eng sdk/core/Azure.Core/src/Shared sdk/core/Azure.Core.TestFramework/src + # Note: 'doc/GeneratorVersions' is needed for regenerating the emitter version dashboard + git sparse-checkout set eng sdk/core/Azure.Core/src/Shared sdk/core/Azure.Core.TestFramework/src doc/GeneratorVersions if ($LASTEXITCODE -ne 0) { throw "Failed to set sparse checkout patterns" } @@ -553,6 +554,22 @@ try { } } + # Regenerate the emitter version dashboard + $dashboardScript = Join-Path $tempDir "doc/GeneratorVersions/Emitter_Version_Dashboard.ps1" + if (Test-Path $dashboardScript) { + Write-Host "Regenerating emitter version dashboard..." + try { + & $dashboardScript -RepoRoot $tempDir + if ($LASTEXITCODE -ne 0) { + Write-Warning "Dashboard generation failed with exit code $LASTEXITCODE. Continuing without dashboard update." + } + } catch { + Write-Warning "Dashboard generation failed: $($_.Exception.Message). Continuing without dashboard update." + } + } else { + Write-Host "Dashboard script not found at $dashboardScript. Skipping dashboard generation." + } + # Check if there are changes to commit $gitStatus = git status --porcelain if (-not $gitStatus) { @@ -616,6 +633,12 @@ try { if (Test-Path $sdkPath) { git add $sdkPath } + + # Add the dashboard if it was regenerated + $dashboardPath = Join-Path $tempDir "doc/GeneratorVersions/Emitter_Version_Dashboard.md" + if (Test-Path $dashboardPath) { + git add $dashboardPath + } if ($LASTEXITCODE -ne 0) { throw "Failed to add changes" From 31ec795d0d2112c1b86763a7797d0f0aa8fcc11d Mon Sep 17 00:00:00 2001 From: jolov Date: Mon, 23 Mar 2026 19:22:49 -0700 Subject: [PATCH 3/5] chore: simplify dashboard script invocation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../eng/scripts/Submit-AzureSdkForNetPr.ps1 | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 index b493d759a0d..41e1f68d618 100755 --- a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 +++ b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 @@ -555,20 +555,9 @@ try { } # Regenerate the emitter version dashboard + Write-Host "Regenerating emitter version dashboard..." $dashboardScript = Join-Path $tempDir "doc/GeneratorVersions/Emitter_Version_Dashboard.ps1" - if (Test-Path $dashboardScript) { - Write-Host "Regenerating emitter version dashboard..." - try { - & $dashboardScript -RepoRoot $tempDir - if ($LASTEXITCODE -ne 0) { - Write-Warning "Dashboard generation failed with exit code $LASTEXITCODE. Continuing without dashboard update." - } - } catch { - Write-Warning "Dashboard generation failed: $($_.Exception.Message). Continuing without dashboard update." - } - } else { - Write-Host "Dashboard script not found at $dashboardScript. Skipping dashboard generation." - } + & $dashboardScript -RepoRoot $tempDir # Check if there are changes to commit $gitStatus = git status --porcelain From a0df19128e1d5be10f9bd44e213e7bbe37b59d8a Mon Sep 17 00:00:00 2001 From: jolov Date: Mon, 23 Mar 2026 19:23:27 -0700 Subject: [PATCH 4/5] chore: remove Test-Path guard for dashboard file Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../eng/scripts/Submit-AzureSdkForNetPr.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 index 41e1f68d618..ae854a76fad 100755 --- a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 +++ b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 @@ -623,11 +623,9 @@ try { git add $sdkPath } - # Add the dashboard if it was regenerated + # Add the regenerated dashboard $dashboardPath = Join-Path $tempDir "doc/GeneratorVersions/Emitter_Version_Dashboard.md" - if (Test-Path $dashboardPath) { - git add $dashboardPath - } + git add $dashboardPath if ($LASTEXITCODE -ne 0) { throw "Failed to add changes" From af22dcc8e9a929b9785c2a514e7771dc1c74f36c Mon Sep 17 00:00:00 2001 From: jolov Date: Mon, 23 Mar 2026 19:23:57 -0700 Subject: [PATCH 5/5] chore: restore Test-Path guard for dashboard file Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../eng/scripts/Submit-AzureSdkForNetPr.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 index ae854a76fad..9c7ee02fff4 100755 --- a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 +++ b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 @@ -625,7 +625,9 @@ try { # Add the regenerated dashboard $dashboardPath = Join-Path $tempDir "doc/GeneratorVersions/Emitter_Version_Dashboard.md" - git add $dashboardPath + if (Test-Path $dashboardPath) { + git add $dashboardPath + } if ($LASTEXITCODE -ne 0) { throw "Failed to add changes"