From c13a3708a84f7064ab71c6e520978d6926c6e844 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 21 Nov 2024 12:30:40 -0800 Subject: [PATCH 01/34] fix esrp safety net for initial packages --- eng/pipelines/templates/steps/npm-release-task.yml | 10 +++++++--- eng/scripts/verify-npm-tags.ps1 | 10 ++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 5ccb53797719..11f27fc80a71 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -16,10 +16,14 @@ steps: tar -xzf $tarFile -C $tempDir $packageJsonDir = "$tempDir\package\package.json" $pkg = Get-Content -Raw "$packageJsonDir" | ConvertFrom-Json - $packageName = $pkg.Name + # $packageName = $pkg.Name + $packageName = "testestestestetsetset" $packageVersion = $pkg.Version - $packageProps = npm view $packageName -json | ConvertFrom-Json - $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress + $packageProps = npm view $packageName -json -silent | ConvertFrom-Json + $originalTags = "{}" + if (!$packageProps.error) { + $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress + } echo "##vso[task.setvariable variable=PackageName]$packageName" echo "##vso[task.setvariable variable=OriginalTags]$originalTags" echo "##vso[task.setvariable variable=IntendedTagVersion]$packageVersion" diff --git a/eng/scripts/verify-npm-tags.ps1 b/eng/scripts/verify-npm-tags.ps1 index 69cd60fcca58..441a8abfd8f3 100644 --- a/eng/scripts/verify-npm-tags.ps1 +++ b/eng/scripts/verify-npm-tags.ps1 @@ -28,20 +28,22 @@ Write-Host "Intend to add tag $intendedTag to version $intendedTagVersion" if ($packageDistTags."$intendedTag" -ne $intendedTagVersion) { Write-Warning "Tag not correctly set, current $intendedTag tag is version $($packageDistTags."$intendedTag") instead of $intendedTagVersion." $correctDistTags = $parsedOriginalDistTags - $correctDistTags."$intendedTag" = $intendedTagVersion + $correctDistTags | Add-Member -MemberType NoteProperty -Name $intendedTag -Value $intendedTagVersion -Force + # $correctDistTags."$intendedTag" = $intendedTagVersion Write-Host "Setting AuthToken Deployment" $regAuth = "//registry.npmjs.org/" - $env:NPM_TOKEN=$npmToken + $env:NPM_TOKEN = $npmToken npm config set $regAuth`:_authToken=`$`{NPM_TOKEN`} - foreach($tag in $correctDistTags.PSObject.Properties) { + foreach ($tag in $correctDistTags.PSObject.Properties) { Write-Host "npm dist-tag add $packageName@$($tag.value) $($tag.Name)" npm dist-tag add $packageName@$($tag.value) $($tag.Name) } $npmPkgProp = npm view $packageName --json | ConvertFrom-Json $packageDistTags = $npmPkgProp."dist-tags" Write-Host "Corrected dist tags to: $packageDistTags" -} else { +} +else { Write-Host "Tag verified." } From e2bf654f61f8284f78eb8ee81a67d5f2ec923c56 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 21 Nov 2024 14:20:35 -0800 Subject: [PATCH 02/34] test --- sdk/template/template/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sdk/template/template/CHANGELOG.md b/sdk/template/template/CHANGELOG.md index d6fdf1328bf7..93a8beabc373 100644 --- a/sdk/template/template/CHANGELOG.md +++ b/sdk/template/template/CHANGELOG.md @@ -11,6 +11,17 @@ ### Other Changes +## 1.0.11-beta.1 (unreleased) + +### Features Added +- Test Release Pipeline + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.12 (2021-06-15) ### Features Added From 47ec84e85e698aafa6fe406c529d325b3fdb98d6 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 21 Nov 2024 15:34:15 -0800 Subject: [PATCH 03/34] disable verify changelog --- eng/common/pipelines/templates/steps/verify-changelogs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/verify-changelogs.yml b/eng/common/pipelines/templates/steps/verify-changelogs.yml index 3f36954f4cd8..617a61514a4b 100644 --- a/eng/common/pipelines/templates/steps/verify-changelogs.yml +++ b/eng/common/pipelines/templates/steps/verify-changelogs.yml @@ -10,7 +10,7 @@ steps: inputs: filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLogs.ps1 arguments: > - -PackagePropertiesFolder '${{ parameters.PackagePropertiesFolder }}' + -PackagePropertiesFolder "" pwsh: true displayName: Verify ChangeLogEntries condition: ${{ parameters.Condition }} From 4287c078c0d6a1b5efa2097202fe766795e4361e Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 21 Nov 2024 16:25:37 -0800 Subject: [PATCH 04/34] disable verify changelog --- .../pipelines/templates/steps/verify-changelogs.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/eng/common/pipelines/templates/steps/verify-changelogs.yml b/eng/common/pipelines/templates/steps/verify-changelogs.yml index 617a61514a4b..1bbc30272128 100644 --- a/eng/common/pipelines/templates/steps/verify-changelogs.yml +++ b/eng/common/pipelines/templates/steps/verify-changelogs.yml @@ -6,11 +6,6 @@ parameters: default: succeeded() steps: - - task: Powershell@2 - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLogs.ps1 - arguments: > - -PackagePropertiesFolder "" - pwsh: true - displayName: Verify ChangeLogEntries - condition: ${{ parameters.Condition }} + - pwsh: | + write-host "temp removal" + displayName: Verify ChangelogEntry From 03797b1d00fc0ece1c811ee6de39647c5322e9f8 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 22 Nov 2024 10:41:57 -0800 Subject: [PATCH 05/34] disable verify changelog --- .../templates/steps/verify-changelogs.yml | 11 +++++--- eng/common/scripts/Verify-ChangeLogs.ps1 | 26 +------------------ .../templates/steps/npm-release-task.yml | 2 +- 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/eng/common/pipelines/templates/steps/verify-changelogs.yml b/eng/common/pipelines/templates/steps/verify-changelogs.yml index 1bbc30272128..3f36954f4cd8 100644 --- a/eng/common/pipelines/templates/steps/verify-changelogs.yml +++ b/eng/common/pipelines/templates/steps/verify-changelogs.yml @@ -6,6 +6,11 @@ parameters: default: succeeded() steps: - - pwsh: | - write-host "temp removal" - displayName: Verify ChangelogEntry + - task: Powershell@2 + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLogs.ps1 + arguments: > + -PackagePropertiesFolder '${{ parameters.PackagePropertiesFolder }}' + pwsh: true + displayName: Verify ChangeLogEntries + condition: ${{ parameters.Condition }} diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index 9598472720c5..a6dca9bd99ac 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -19,30 +19,6 @@ function ShouldVerifyChangeLog ($PkgArtifactDetails) { return $false } - -# find which packages we need to confirm the changelog for -$packageProperties = Get-ChildItem -Recurse "$PackagePropertiesFolder" *.json - -# grab the json file, then confirm the changelog entry for it -$allPassing = $true -foreach($propertiesFile in $packageProperties) { - $PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json - - if (-not (ShouldVerifyChangeLog $PackageProp.ArtifactDetails)) { - Write-Host "Skipping changelog verification for $($PackageProp.Name)" - continue - } - - $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false - - if (-not $validChangeLog) { - $allPassing = $false - } -} - -if (!$allPassing) -{ - exit 1 -} +# todo: revert this temp change exit 0 diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 11f27fc80a71..14b68b937403 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -21,7 +21,7 @@ steps: $packageVersion = $pkg.Version $packageProps = npm view $packageName -json -silent | ConvertFrom-Json $originalTags = "{}" - if (!$packageProps.error) { + if ($packageProps.error?.code -ne "E404") { $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress } echo "##vso[task.setvariable variable=PackageName]$packageName" From 2ff918d6a60d7c5b94227e94c1ceb3bc16600f5f Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sun, 24 Nov 2024 23:38:21 -0800 Subject: [PATCH 06/34] disable verify changelog --- eng/common/scripts/Verify-ChangeLog.ps1 | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 611f4c737541..7ea2ef0e47be 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -11,20 +11,6 @@ Set-StrictMode -Version 3 . (Join-Path $PSScriptRoot common.ps1) -$validChangeLog = $false -if ($ChangeLogLocation -and $VersionString) -{ - $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease -} -else -{ - $PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceDirectory $ServiceDirectory - $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $ForRelease -} +# todo: revert this temp change -if (!$validChangeLog) -{ - exit 1 -} - -exit 0 \ No newline at end of file +exit 0 From c9c5fb63a9657b3f0409102bd0d8c4223e2b75b4 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Nov 2024 09:07:18 -0800 Subject: [PATCH 07/34] supress unit test --- eng/pipelines/templates/stages/archetype-sdk-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 0e959477dd2a..055424a307da 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -57,7 +57,7 @@ extends: Artifacts: ${{ parameters.Artifacts }} ${{ if eq(parameters.ServiceDirectory, 'template') }}: TestPipeline: true - RunUnitTests: ${{ parameters.RunUnitTests }} + RunUnitTests: false #${{ parameters.RunUnitTests }} MatrixConfigs: - ${{ each config in parameters.MatrixConfigs }}: - ${{ config }} From 2a7b575fcc8b0115fd3d97093bb88279366129d7 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Nov 2024 09:12:31 -0800 Subject: [PATCH 08/34] error action preference --- eng/pipelines/templates/steps/npm-release-task.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 14b68b937403..3bd7a44778d5 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -19,7 +19,9 @@ steps: # $packageName = $pkg.Name $packageName = "testestestestetsetset" $packageVersion = $pkg.Version + $ErrorActionPreference = 'Continue' $packageProps = npm view $packageName -json -silent | ConvertFrom-Json + $ErrorActionPreference = 'Stop' $originalTags = "{}" if ($packageProps.error?.code -ne "E404") { $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress From d4224bfc7dee875403138c12668a26d874994b38 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Nov 2024 12:14:33 -0800 Subject: [PATCH 09/34] echo --- eng/pipelines/templates/steps/npm-release-task.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 3bd7a44778d5..b3390aec6f8f 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -10,13 +10,13 @@ steps: - ${{ if eq(parameters.Registry, 'https://registry.npmjs.org/') }}: - pwsh: | + Set-PSDebug -Trace 1 $tarFile = (Get-ChildItem -Path "${{parameters.PathToArtifacts}}/*.tgz").FullName $tempDir = "$(System.DefaultWorkingDirectory)/temp_decompress" New-Item -ItemType Directory -Force -Path $tempDir tar -xzf $tarFile -C $tempDir - $packageJsonDir = "$tempDir\package\package.json" + $packageJsonDir = "$tempDir/package/package.json" $pkg = Get-Content -Raw "$packageJsonDir" | ConvertFrom-Json - # $packageName = $pkg.Name $packageName = "testestestestetsetset" $packageVersion = $pkg.Version $ErrorActionPreference = 'Continue' From c10b32b12224d6b68b4c02c5ad7ed720e362adee Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Nov 2024 15:10:54 -0800 Subject: [PATCH 10/34] fix error branch --- eng/pipelines/templates/steps/npm-release-task.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index b3390aec6f8f..1d7c27727333 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -17,13 +17,17 @@ steps: tar -xzf $tarFile -C $tempDir $packageJsonDir = "$tempDir/package/package.json" $pkg = Get-Content -Raw "$packageJsonDir" | ConvertFrom-Json - $packageName = "testestestestetsetset" + $packageName = "@azure/testestestestetsetset" $packageVersion = $pkg.Version - $ErrorActionPreference = 'Continue' $packageProps = npm view $packageName -json -silent | ConvertFrom-Json - $ErrorActionPreference = 'Stop' $originalTags = "{}" - if ($packageProps.error?.code -ne "E404") { + if ($packageProps.error) { + if ($packageProps.error.code -ne "E404") { + Write-Error $packageProps.error + exit 1 + } + } + else { $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress } echo "##vso[task.setvariable variable=PackageName]$packageName" From d646454e3c4947c99c44a3616bb0fb5c60532985 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Nov 2024 15:34:06 -0800 Subject: [PATCH 11/34] fix error branch --- eng/pipelines/templates/steps/npm-release-task.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 1d7c27727333..73e1b6d6d0f3 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -22,6 +22,7 @@ steps: $packageProps = npm view $packageName -json -silent | ConvertFrom-Json $originalTags = "{}" if ($packageProps.error) { + write-host $($packageProps.error) if ($packageProps.error.code -ne "E404") { Write-Error $packageProps.error exit 1 From d45a45a2a3d7a36f0fef6c056808fc805a5b7c5d Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Nov 2024 15:55:58 -0800 Subject: [PATCH 12/34] telem --- eng/pipelines/templates/steps/npm-release-task.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 73e1b6d6d0f3..11950321c437 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -24,15 +24,20 @@ steps: if ($packageProps.error) { write-host $($packageProps.error) if ($packageProps.error.code -ne "E404") { + write-host "inside if" Write-Error $packageProps.error exit 1 } } else { + write-host "inside else" $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress } + write-host "before vso" echo "##vso[task.setvariable variable=PackageName]$packageName" + write-host "vso 1" echo "##vso[task.setvariable variable=OriginalTags]$originalTags" + write-host "vso 2" echo "##vso[task.setvariable variable=IntendedTagVersion]$packageVersion" displayName: Get original tags From e8707446a1f397085159ef29b5d13f28ea5ac984 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 25 Nov 2024 16:21:43 -0800 Subject: [PATCH 13/34] clear out last exit code --- eng/pipelines/templates/steps/npm-release-task.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 11950321c437..92c29f03ca12 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -20,6 +20,7 @@ steps: $packageName = "@azure/testestestestetsetset" $packageVersion = $pkg.Version $packageProps = npm view $packageName -json -silent | ConvertFrom-Json + $LASTEXITCODE = 0 $originalTags = "{}" if ($packageProps.error) { write-host $($packageProps.error) From ebe71a3237a875d060a2e29dfab88eb9d8005bc6 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 26 Nov 2024 08:05:27 -0800 Subject: [PATCH 14/34] cleanup --- eng/common/scripts/Verify-ChangeLog.ps1 | 12 ++++++++++- eng/common/scripts/Verify-ChangeLogs.ps1 | 20 ++++++++++++++++++- .../templates/steps/npm-release-task.yml | 10 ++-------- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 7ea2ef0e47be..b3f5f67c3caf 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -11,6 +11,16 @@ Set-StrictMode -Version 3 . (Join-Path $PSScriptRoot common.ps1) -# todo: revert this temp change +$validChangeLog = $false +if ($ChangeLogLocation -and $VersionString) { + $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease +} +else { + $PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceDirectory $ServiceDirectory + $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $ForRelease +} +if (!$validChangeLog) { + exit 1 +} exit 0 diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index a6dca9bd99ac..8e6033cbe54e 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -19,6 +19,24 @@ function ShouldVerifyChangeLog ($PkgArtifactDetails) { return $false } -# todo: revert this temp change + +# find which packages we need to confirm the changelog for +$packageProperties = Get-ChildItem -Recurse "$PackagePropertiesFolder" *.json +# grab the json file, then confirm the changelog entry for it +$allPassing = $true +foreach ($propertiesFile in $packageProperties) { + $PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json + if (-not (ShouldVerifyChangeLog $PackageProp.ArtifactDetails)) { + Write-Host "Skipping changelog verification for $($PackageProp.Name)" + continue + } + $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false + if (-not $validChangeLog) { + $allPassing = $false + } +} +if (!$allPassing) { + exit 1 +} exit 0 diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 92c29f03ca12..66562e5bc0c7 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -10,35 +10,29 @@ steps: - ${{ if eq(parameters.Registry, 'https://registry.npmjs.org/') }}: - pwsh: | - Set-PSDebug -Trace 1 $tarFile = (Get-ChildItem -Path "${{parameters.PathToArtifacts}}/*.tgz").FullName $tempDir = "$(System.DefaultWorkingDirectory)/temp_decompress" New-Item -ItemType Directory -Force -Path $tempDir tar -xzf $tarFile -C $tempDir $packageJsonDir = "$tempDir/package/package.json" $pkg = Get-Content -Raw "$packageJsonDir" | ConvertFrom-Json - $packageName = "@azure/testestestestetsetset" + $packageName = $pkg.Name $packageVersion = $pkg.Version $packageProps = npm view $packageName -json -silent | ConvertFrom-Json - $LASTEXITCODE = 0 $originalTags = "{}" if ($packageProps.error) { write-host $($packageProps.error) + $LASTEXITCODE = 0 if ($packageProps.error.code -ne "E404") { - write-host "inside if" Write-Error $packageProps.error exit 1 } } else { - write-host "inside else" $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress } - write-host "before vso" echo "##vso[task.setvariable variable=PackageName]$packageName" - write-host "vso 1" echo "##vso[task.setvariable variable=OriginalTags]$originalTags" - write-host "vso 2" echo "##vso[task.setvariable variable=IntendedTagVersion]$packageVersion" displayName: Get original tags From 10815a6c6cc02219130f7c93cf6e3fa0b7b7486b Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 26 Nov 2024 08:06:30 -0800 Subject: [PATCH 15/34] cleanup --- eng/scripts/verify-npm-tags.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/scripts/verify-npm-tags.ps1 b/eng/scripts/verify-npm-tags.ps1 index 441a8abfd8f3..3a0906d9db20 100644 --- a/eng/scripts/verify-npm-tags.ps1 +++ b/eng/scripts/verify-npm-tags.ps1 @@ -29,7 +29,6 @@ if ($packageDistTags."$intendedTag" -ne $intendedTagVersion) { Write-Warning "Tag not correctly set, current $intendedTag tag is version $($packageDistTags."$intendedTag") instead of $intendedTagVersion." $correctDistTags = $parsedOriginalDistTags $correctDistTags | Add-Member -MemberType NoteProperty -Name $intendedTag -Value $intendedTagVersion -Force - # $correctDistTags."$intendedTag" = $intendedTagVersion Write-Host "Setting AuthToken Deployment" $regAuth = "//registry.npmjs.org/" From af273a5fee6e204a19a5e9c6cc82f2cb22d8c6af Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:07:50 -0800 Subject: [PATCH 16/34] Update eng/common/scripts/Verify-ChangeLog.ps1 --- eng/common/scripts/Verify-ChangeLog.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index b3f5f67c3caf..3024cf77cc24 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -12,7 +12,8 @@ Set-StrictMode -Version 3 . (Join-Path $PSScriptRoot common.ps1) $validChangeLog = $false -if ($ChangeLogLocation -and $VersionString) { +if ($ChangeLogLocation -and $VersionString) +{ $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease } else { From c52499f96bc349111b67da1b7d60966306ffb126 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:08:18 -0800 Subject: [PATCH 17/34] Update eng/common/scripts/Verify-ChangeLog.ps1 --- eng/common/scripts/Verify-ChangeLog.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 3024cf77cc24..2b7ed7e74370 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -16,7 +16,8 @@ if ($ChangeLogLocation -and $VersionString) { $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease } -else { +else +{ $PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceDirectory $ServiceDirectory $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $ForRelease } From da5bf35fc7c7e71b5439bd27f7e17a19cfd81818 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:08:25 -0800 Subject: [PATCH 18/34] Update eng/common/scripts/Verify-ChangeLog.ps1 --- eng/common/scripts/Verify-ChangeLog.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 2b7ed7e74370..a7c3cf760419 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -22,7 +22,8 @@ else $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $ForRelease } -if (!$validChangeLog) { +if (!$validChangeLog) +{ exit 1 } exit 0 From f10c4525e505e3ce09f58909acac942f700c432b Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:08:49 -0800 Subject: [PATCH 19/34] Update eng/common/scripts/Verify-ChangeLog.ps1 --- eng/common/scripts/Verify-ChangeLog.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index a7c3cf760419..ba5070529e0e 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -26,4 +26,5 @@ if (!$validChangeLog) { exit 1 } + exit 0 From 420f2b0d1d2c72b3bc71f66a533af6b5757b7e16 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:10:18 -0800 Subject: [PATCH 20/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index 8e6033cbe54e..b3eb39b8f31e 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -27,8 +27,8 @@ $allPassing = $true foreach ($propertiesFile in $packageProperties) { $PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json if (-not (ShouldVerifyChangeLog $PackageProp.ArtifactDetails)) { - Write-Host "Skipping changelog verification for $($PackageProp.Name)" - continue + Write-Host "Skipping changelog verification for $($PackageProp.Name)" + continue } $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false if (-not $validChangeLog) { From a8b6a1ee34122c0acd1b6a0c380c8fb0da5ff66c Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:10:39 -0800 Subject: [PATCH 21/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index b3eb39b8f31e..b309a3634169 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -30,7 +30,9 @@ foreach ($propertiesFile in $packageProperties) { Write-Host "Skipping changelog verification for $($PackageProp.Name)" continue } + $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false + if (-not $validChangeLog) { $allPassing = $false } From c770db1df0deee3a05bbe0098a773967a717475c Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:10:49 -0800 Subject: [PATCH 22/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index b309a3634169..84c96e14f30b 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -24,7 +24,7 @@ function ShouldVerifyChangeLog ($PkgArtifactDetails) { $packageProperties = Get-ChildItem -Recurse "$PackagePropertiesFolder" *.json # grab the json file, then confirm the changelog entry for it $allPassing = $true -foreach ($propertiesFile in $packageProperties) { +foreach($propertiesFile in $packageProperties) { $PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json if (-not (ShouldVerifyChangeLog $PackageProp.ArtifactDetails)) { Write-Host "Skipping changelog verification for $($PackageProp.Name)" From 9b9d864fb84cbd655abe213b00332299c9ba3c82 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:11:00 -0800 Subject: [PATCH 23/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index 84c96e14f30b..2eecb6738dec 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -22,6 +22,7 @@ function ShouldVerifyChangeLog ($PkgArtifactDetails) { # find which packages we need to confirm the changelog for $packageProperties = Get-ChildItem -Recurse "$PackagePropertiesFolder" *.json + # grab the json file, then confirm the changelog entry for it $allPassing = $true foreach($propertiesFile in $packageProperties) { From fa0e4248fb48da08e8a090879b77c666df71ed12 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:11:36 -0800 Subject: [PATCH 24/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index 2eecb6738dec..e4132fdc63b4 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -32,7 +32,8 @@ foreach($propertiesFile in $packageProperties) { continue } - $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false + $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false + if (-not $validChangeLog) { $allPassing = $false From b50866a445008908960165f94fa8c0abbb78555c Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:11:52 -0800 Subject: [PATCH 25/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index e4132fdc63b4..33e9e574fbaa 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -39,7 +39,8 @@ foreach($propertiesFile in $packageProperties) { $allPassing = $false } } -if (!$allPassing) { +if (!$allPassing) +{ exit 1 } From 1dca35004c9f92949ac55147bedf67d8e638fb66 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:12:45 -0800 Subject: [PATCH 26/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index 33e9e574fbaa..2ad9381e8f3e 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -27,6 +27,7 @@ $packageProperties = Get-ChildItem -Recurse "$PackagePropertiesFolder" *.json $allPassing = $true foreach($propertiesFile in $packageProperties) { $PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json + if (-not (ShouldVerifyChangeLog $PackageProp.ArtifactDetails)) { Write-Host "Skipping changelog verification for $($PackageProp.Name)" continue From d3041196eeabee1e7611a60b48d57904567f41a0 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:13:01 -0800 Subject: [PATCH 27/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index 2ad9381e8f3e..e7f4203aaf7f 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -35,7 +35,6 @@ foreach($propertiesFile in $packageProperties) { $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false - if (-not $validChangeLog) { $allPassing = $false } From c789cdad88fdaddf1fe17d16185041e802226eeb Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:13:20 -0800 Subject: [PATCH 28/34] Update eng/common/scripts/Verify-ChangeLogs.ps1 --- eng/common/scripts/Verify-ChangeLogs.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/Verify-ChangeLogs.ps1 b/eng/common/scripts/Verify-ChangeLogs.ps1 index e7f4203aaf7f..9598472720c5 100644 --- a/eng/common/scripts/Verify-ChangeLogs.ps1 +++ b/eng/common/scripts/Verify-ChangeLogs.ps1 @@ -39,6 +39,7 @@ foreach($propertiesFile in $packageProperties) { $allPassing = $false } } + if (!$allPassing) { exit 1 From 2e069b159da837f1e80f114bb5977b6b05d173ee Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:14:28 -0800 Subject: [PATCH 29/34] Update eng/pipelines/templates/steps/npm-release-task.yml --- eng/pipelines/templates/steps/npm-release-task.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 66562e5bc0c7..233052fdd15d 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -21,7 +21,6 @@ steps: $packageProps = npm view $packageName -json -silent | ConvertFrom-Json $originalTags = "{}" if ($packageProps.error) { - write-host $($packageProps.error) $LASTEXITCODE = 0 if ($packageProps.error.code -ne "E404") { Write-Error $packageProps.error From 49329e604bfee5b35f3441ce573dbba94751ec12 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 26 Nov 2024 08:18:13 -0800 Subject: [PATCH 30/34] testing --- eng/pipelines/templates/steps/npm-release-task.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 66562e5bc0c7..284fe5cb9f80 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -16,7 +16,7 @@ steps: tar -xzf $tarFile -C $tempDir $packageJsonDir = "$tempDir/package/package.json" $pkg = Get-Content -Raw "$packageJsonDir" | ConvertFrom-Json - $packageName = $pkg.Name + $packageName = "@azure/tessssssst"#$pkg.Name $packageVersion = $pkg.Version $packageProps = npm view $packageName -json -silent | ConvertFrom-Json $originalTags = "{}" @@ -31,6 +31,7 @@ steps: else { $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress } + $packageName = $pkg.Name echo "##vso[task.setvariable variable=PackageName]$packageName" echo "##vso[task.setvariable variable=OriginalTags]$originalTags" echo "##vso[task.setvariable variable=IntendedTagVersion]$packageVersion" From 91fc8f772587e5cdf09cd99bb1869c90df1d79c6 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:30:36 -0800 Subject: [PATCH 31/34] Update eng/pipelines/templates/steps/npm-release-task.yml --- eng/pipelines/templates/steps/npm-release-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 44a513797ae7..278a7d61e86e 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -16,7 +16,7 @@ steps: tar -xzf $tarFile -C $tempDir $packageJsonDir = "$tempDir/package/package.json" $pkg = Get-Content -Raw "$packageJsonDir" | ConvertFrom-Json - $packageName = "@azure/tessssssst"#$pkg.Name + $packageName = $pkg.Name $packageVersion = $pkg.Version $packageProps = npm view $packageName -json -silent | ConvertFrom-Json $originalTags = "{}" From 59afafbc34bdffc6de0aca788970ec27a8c4f2ab Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:30:51 -0800 Subject: [PATCH 32/34] Update eng/pipelines/templates/steps/npm-release-task.yml --- eng/pipelines/templates/steps/npm-release-task.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/templates/steps/npm-release-task.yml b/eng/pipelines/templates/steps/npm-release-task.yml index 278a7d61e86e..233052fdd15d 100644 --- a/eng/pipelines/templates/steps/npm-release-task.yml +++ b/eng/pipelines/templates/steps/npm-release-task.yml @@ -30,7 +30,6 @@ steps: else { $originalTags = $packageProps.'dist-tags' | ConvertTo-Json -Compress } - $packageName = $pkg.Name echo "##vso[task.setvariable variable=PackageName]$packageName" echo "##vso[task.setvariable variable=OriginalTags]$originalTags" echo "##vso[task.setvariable variable=IntendedTagVersion]$packageVersion" From 5eacbd93cfb7a84c2cc8c8fdb24541423ebe1be2 Mon Sep 17 00:00:00 2001 From: Albert Cheng <38804567+ckairen@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:16:40 -0800 Subject: [PATCH 33/34] Update eng/pipelines/templates/stages/archetype-sdk-client.yml --- eng/pipelines/templates/stages/archetype-sdk-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 055424a307da..0e959477dd2a 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -57,7 +57,7 @@ extends: Artifacts: ${{ parameters.Artifacts }} ${{ if eq(parameters.ServiceDirectory, 'template') }}: TestPipeline: true - RunUnitTests: false #${{ parameters.RunUnitTests }} + RunUnitTests: ${{ parameters.RunUnitTests }} MatrixConfigs: - ${{ each config in parameters.MatrixConfigs }}: - ${{ config }} From d7bd9fd53ee35d059e55ea68dd514a615e48c02b Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 26 Nov 2024 09:21:16 -0800 Subject: [PATCH 34/34] clean changelog ps1 --- eng/common/scripts/Verify-ChangeLog.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index ba5070529e0e..611f4c737541 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -27,4 +27,4 @@ if (!$validChangeLog) exit 1 } -exit 0 +exit 0 \ No newline at end of file