Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 2093 (#1063)
Browse files Browse the repository at this point in the history
* Consume Codeowners parser library, ceperate users from teams in codeownerse

* Update get-pr-owners and related logic

Co-authored-by: Chidozie Ononiwu <[email protected]>
  • Loading branch information
azure-sdk and chidozieononiwu authored Oct 20, 2021
1 parent b06c8c9 commit f85cd06
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 70 deletions.
48 changes: 28 additions & 20 deletions eng/common/pipelines/templates/steps/get-pr-owners.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
parameters:
TargetVariable: ''
TargetUserVariable: 'notspecified'
TargetTeamVariable: 'notspecified'
TargetLabelVariable: 'notspecified'
ServiceDirectory: ''
DevOpsFeed: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"

steps:
- pwsh: |
git clone https://github.com/Azure/azure-sdk-tools.git $(Build.SourcesDirectory)/tools_repo
cd $(Build.SourcesDirectory)/tools_repo
git checkout azure-sdk-tools_20210114.1
displayName: Setup Identity Resolver
- task: DotNetCoreCLI@2
displayName: 'Install Identity Resolver'
inputs:
command: custom
custom: 'tool'
arguments: 'install --global --add-source "${{ parameters.DevOpsFeed }}" --version "1.0.0-dev.20211018.1" "Azure.Sdk.Tools.IdentityResolver"'
workingDirectory: '$(Agent.BuildDirectory)'

- task: DotNetCoreCLI@2
displayName: 'Install CodeOwners Retriever'
inputs:
command: custom
custom: 'tool'
arguments: 'install --global --add-source "${{ parameters.DevOpsFeed }}" --version "1.0.0-dev.20211019.1" "Azure.Sdk.Tools.RetrieveCodeOwners"'
workingDirectory: '$(Agent.BuildDirectory)'

- pwsh: |
dotnet run -v q -- `
identity-resolver `
--aad-app-id-var APP_ID `
--aad-app-secret-var APP_SECRET `
--aad-tenant-var AAD_TENANT `
Expand All @@ -19,10 +33,9 @@ steps:
--kusto-table-var KUSTO_TABLE `
--identity-name "$(Build.QueuedBy)" `
--identity-email "$(Build.RequestedForEmail)" `
--targetvar "${{ parameters.TargetVariable }}"
--targetvar "${{ coalesce(parameters.TargetVariable, parameters.TargetUserVariable) }}"
displayName: 'Resolving Queuing User'
continueOnError: true
workingDirectory: $(Build.SourcesDirectory)/tools_repo/tools/notification-configuration/identity-resolver
env:
APP_ID: $(notification-aad-app-id)
APP_SECRET: $(notification-aad-secret)
Expand All @@ -32,15 +45,10 @@ steps:
KUSTO_TABLE: $(notification-kusto-table)
- pwsh: |
Remove-Item -Force -Recurse $(Build.SourcesDirectory)/tools_repo
displayName: Clean Up Cloned Tools Repo
- task: PowerShell@2
displayName: Add CodeOwners if Present
inputs:
pwsh: true
filePath: $(Build.SourcesDirectory)/eng/common/scripts/get-codeowners.ps1
arguments: >
-TargetDirectory "/sdk/${{ parameters.ServiceDirectory }}/"
-RootDirectory "$(Build.SourcesDirectory)"
-VsoVariable "${{ parameters.TargetVariable }}"
retrieve-codeowners `
--target-directory "/sdk/${{ parameters.ServiceDirectory }}/" `
--root-directory "$(Build.SourcesDirectory)" `
--vso-owning-users "${{ coalesce(parameters.TargetVariable, parameters.TargetUserVariable) }}" `
--vso-owning-teams "${{ parameters.TargetTeamVariable }}" `
--vso-owning-labels "${{ parameters.TargetLabelVariable }}"
displayName: 'Add CodeOwners if Present'
50 changes: 0 additions & 50 deletions eng/common/scripts/get-codeowners.ps1

This file was deleted.

0 comments on commit f85cd06

Please sign in to comment.