Skip to content

Commit

Permalink
Merge e870744 into 3110870
Browse files Browse the repository at this point in the history
  • Loading branch information
ckairen authored Nov 26, 2024
2 parents 3110870 + e870744 commit 73750a3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 50 deletions.
18 changes: 2 additions & 16 deletions eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
exit 0
26 changes: 1 addition & 25 deletions eng/common/scripts/Verify-ChangeLogs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 }}
MatrixConfigs:
- ${{ each config in parameters.MatrixConfigs }}:
- ${{ config }}
Expand Down
25 changes: 21 additions & 4 deletions eng/pipelines/templates/steps/npm-release-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,35 @@ 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 = "@azure/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
$LASTEXITCODE = 0
$originalTags = "{}"
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
Expand Down
10 changes: 6 additions & 4 deletions eng/scripts/verify-npm-tags.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}

0 comments on commit 73750a3

Please sign in to comment.