Skip to content
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

[bug fix] esrp safety net for initial packages #31878

Merged
merged 37 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c13a370
fix esrp safety net for initial packages
ckairen Nov 21, 2024
e2bf654
test
ckairen Nov 21, 2024
47ec84e
disable verify changelog
ckairen Nov 21, 2024
4287c07
disable verify changelog
ckairen Nov 22, 2024
03797b1
disable verify changelog
ckairen Nov 22, 2024
2ff918d
disable verify changelog
ckairen Nov 25, 2024
e6692b0
merge main
ckairen Nov 25, 2024
c9c5fb6
supress unit test
ckairen Nov 25, 2024
2a7b575
error action preference
ckairen Nov 25, 2024
d4224bf
echo
ckairen Nov 25, 2024
c10b32b
fix error branch
ckairen Nov 25, 2024
d646454
fix error branch
ckairen Nov 25, 2024
d45a45a
telem
ckairen Nov 25, 2024
e870744
clear out last exit code
ckairen Nov 26, 2024
ebe71a3
cleanup
ckairen Nov 26, 2024
10815a6
cleanup
ckairen Nov 26, 2024
af273a5
Update eng/common/scripts/Verify-ChangeLog.ps1
ckairen Nov 26, 2024
c52499f
Update eng/common/scripts/Verify-ChangeLog.ps1
ckairen Nov 26, 2024
da5bf35
Update eng/common/scripts/Verify-ChangeLog.ps1
ckairen Nov 26, 2024
f10c452
Update eng/common/scripts/Verify-ChangeLog.ps1
ckairen Nov 26, 2024
420f2b0
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
a8b6a1e
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
c770db1
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
9b9d864
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
fa0e424
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
b50866a
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
1dca350
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
d304119
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
c789cda
Update eng/common/scripts/Verify-ChangeLogs.ps1
ckairen Nov 26, 2024
2e069b1
Update eng/pipelines/templates/steps/npm-release-task.yml
ckairen Nov 26, 2024
49329e6
testing
ckairen Nov 26, 2024
fa7d505
Merge branch 'al/esrp' of https://github.com/ckairen/azure-sdk-for-js…
ckairen Nov 26, 2024
91fc8f7
Update eng/pipelines/templates/steps/npm-release-task.yml
ckairen Nov 26, 2024
59afafb
Update eng/pipelines/templates/steps/npm-release-task.yml
ckairen Nov 26, 2024
5eacbd9
Update eng/pipelines/templates/stages/archetype-sdk-client.yml
ckairen Nov 26, 2024
d7bd9fd
clean changelog ps1
ckairen Nov 26, 2024
0c7bc0a
Merge branch 'al/esrp' of https://github.com/ckairen/azure-sdk-for-js…
ckairen Nov 26, 2024
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
2 changes: 1 addition & 1 deletion eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ if (!$validChangeLog)
exit 1
}

exit 0
exit 0
ckairen marked this conversation as resolved.
Show resolved Hide resolved
ckairen marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 2 additions & 4 deletions eng/common/scripts/Verify-ChangeLogs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,19 @@ $packageProperties = Get-ChildItem -Recurse "$PackagePropertiesFolder" *.json
$allPassing = $true
foreach($propertiesFile in $packageProperties) {
$PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json

if (-not (ShouldVerifyChangeLog $PackageProp.ArtifactDetails)) {
ckairen marked this conversation as resolved.
Show resolved Hide resolved
Write-Host "Skipping changelog verification for $($PackageProp.Name)"
continue
}

$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false


ckairen marked this conversation as resolved.
Show resolved Hide resolved
if (-not $validChangeLog) {
$allPassing = $false
}
}
ckairen marked this conversation as resolved.
Show resolved Hide resolved

if (!$allPassing)
{
if (!$allPassing) {
ckairen marked this conversation as resolved.
Show resolved Hide resolved
exit 1
}

Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extends:
Artifacts: ${{ parameters.Artifacts }}
${{ if eq(parameters.ServiceDirectory, 'template') }}:
TestPipeline: true
RunUnitTests: ${{ parameters.RunUnitTests }}
RunUnitTests: false #${{ parameters.RunUnitTests }}
ckairen marked this conversation as resolved.
Show resolved Hide resolved
MatrixConfigs:
- ${{ each config in parameters.MatrixConfigs }}:
- ${{ config }}
Expand Down
17 changes: 14 additions & 3 deletions eng/pipelines/templates/steps/npm-release-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ steps:
$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
$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) {
write-host $($packageProps.error)
ckairen marked this conversation as resolved.
Show resolved Hide resolved
$LASTEXITCODE = 0
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"
echo "##vso[task.setvariable variable=OriginalTags]$originalTags"
echo "##vso[task.setvariable variable=IntendedTagVersion]$packageVersion"
Expand Down
9 changes: 5 additions & 4 deletions eng/scripts/verify-npm-tags.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@ 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

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."
}