-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Sync eng/common directory with azure-sdk-tools for PR 15192 #48857
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
Merged
azure-sdk
merged 4 commits into
main
from
sync-eng/common-djurek/codeowners-block-release-pipeline-templates-15192
Apr 18, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
eng/common/pipelines/templates/steps/verify-codeowners.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| parameters: | ||
| - name: ArtifactPath | ||
| type: string | ||
| default: $(Build.ArtifactStagingDirectory)/PackageInfo | ||
| - name: Repo | ||
| type: string | ||
| default: $(Build.Repository.Name) | ||
| - name: SdkTypes | ||
| type: object | ||
| default: | ||
| - client | ||
| - compat | ||
| - data | ||
| - functions | ||
| - datamovement | ||
|
|
||
| steps: | ||
| - template: /eng/common/pipelines/templates/steps/install-azsdk-cli.yml | ||
| parameters: | ||
| Condition: and(succeeded(), ne(variables['Skip.VerifyCodeowners'], 'true')) | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: Verify Codeowners | ||
| condition: and(succeeded(), ne(variables['Skip.VerifyCodeowners'], 'true')) | ||
| inputs: | ||
| pwsh: true | ||
| filePath: $(Build.SourcesDirectory)/eng/common/scripts/Test-CodeownersForArtifacts.ps1 | ||
| arguments: >- | ||
| -AzsdkPath '$(AZSDK)' | ||
| -PackageInfoDirectory '${{ parameters.ArtifactPath }}' | ||
| -SdkTypes ${{ join(',', parameters.SdkTypes) }} | ||
| -Repo '${{ parameters.Repo }}' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| [CmdletBinding()] | ||
| param( | ||
| [string] $AzsdkPath, | ||
| [string] $PackageInfoDirectory, | ||
| [array] $SdkTypes, | ||
| [string] $Repo | ||
| ) | ||
|
|
||
| . "$PSScriptRoot/common.ps1" | ||
|
|
||
| Set-StrictMode -Version 3 | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| $failedPackages = @() | ||
|
|
||
| foreach ($pkgPropertiesFile in Get-ChildItem -Path $PackageInfoDirectory -Filter '*.json' -File) { | ||
| $pkgProperties = Get-Content -Raw -Path $pkgPropertiesFile | ConvertFrom-Json | ||
|
danieljurek marked this conversation as resolved.
|
||
| if ($SdkTypes -notcontains $pkgProperties.SdkType) { | ||
| Write-Host "Skipping package: $($pkgProperties.Name) $($pkgProperties.DirectoryPath) because its SdkType '$($pkgProperties.SdkType)' is not in the list of SdkTypes to validate." | ||
| continue | ||
| } | ||
|
|
||
| Write-Host "Validating codeowners for package: $($pkgProperties.Name) $($pkgProperties.DirectoryPath)" | ||
|
|
||
| if (!$pkgProperties.ReleaseStatus) { | ||
| LogError "Package $($pkgProperties.Name) at $($pkgProperties.DirectoryPath) is missing a ReleaseStatus property." | ||
| $failedPackages += $pkgProperties.DirectoryPath | ||
| continue | ||
| } | ||
|
|
||
| # Validate packages with a release date (intended to release) | ||
| if ($pkgProperties.ReleaseStatus -ne "Unreleased") { | ||
| $output = & $AzsdkPath config codeowners check-package ` | ||
| --directory-path $pkgProperties.DirectoryPath ` | ||
| --repo $Repo ` | ||
| --output json 2>&1 | ||
|
|
||
| if ($LASTEXITCODE) { | ||
| LogError "Codeowners validation failed for package: $($pkgProperties.DirectoryPath)" | ||
| $output | Write-Host | ||
| $failedPackages += $pkgProperties.DirectoryPath | ||
| } else { | ||
| Write-Host " Codeowners validation succeeded for package: $($pkgProperties.DirectoryPath)" | ||
| } | ||
| } else { | ||
| Write-Host " Skipping CODEOWNERS validation, package is not intended to release." | ||
| } | ||
| } | ||
|
|
||
| if ($failedPackages.Count -gt 0) { | ||
| Write-Host "" | ||
| Write-Host "Failed Packages:" | ||
| foreach ($directoryPath in $failedPackages) { | ||
| LogError " - $directoryPath does not have sufficient code owners coverage" | ||
| } | ||
| LogError "Codeowners validation failed for one or more packages. See http://aka.ms/azsdk/codeowners for instructions to fix the issue." | ||
|
danieljurek marked this conversation as resolved.
|
||
| exit 1 | ||
| } | ||
| exit 0 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.