Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository for Tools P…
Browse files Browse the repository at this point in the history
…R 2086
  • Loading branch information
sima-zhu authored and azure-sdk committed Oct 20, 2021
1 parent 305de68 commit dc173cd
Showing 1 changed file with 21 additions and 29 deletions.
50 changes: 21 additions & 29 deletions eng/common/pipelines/templates/steps/get-pr-owners.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
parameters:
TargetVariable: ''
TargetUserVariable: ''
TargetTeamVariable: ''
TargetLabelVariable: ''
ServiceDirectory: ''
DevOpsFeed: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"

steps:
- 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: |
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
- pwsh: |
identity-resolver `
dotnet run -v q -- `
--aad-app-id-var APP_ID `
--aad-app-secret-var APP_SECRET `
--aad-tenant-var AAD_TENANT `
--kusto-url-var KUSTO_URL `
--kusto-database-var KUSTO_DB `
--kusto-table-var KUSTO_TABLE `
--identity-name "$(Build.QueuedBy)" `
--identity "$(Build.QueuedBy)" `
--identity-email "$(Build.RequestedForEmail)" `
--targetvar "${{ coalesce(parameters.TargetVariable, parameters.TargetUserVariable) }}"
--targetvar "${{ parameters.TargetVariable }}"
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 @@ -45,10 +32,15 @@ steps:
KUSTO_TABLE: $(notification-kusto-table)
- pwsh: |
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'
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 }}"

0 comments on commit dc173cd

Please sign in to comment.