Skip to content

Commit 8e20c17

Browse files
Sync eng/common directory with azure-sdk-tools for PR 2093 (Azure#24927)
* Consume Codeowners parser library, ceperate users from teams in codeownerse * Update get-pr-owners and related logic Co-authored-by: Chidozie Ononiwu <[email protected]>
1 parent 3736b99 commit 8e20c17

File tree

2 files changed

+28
-70
lines changed

2 files changed

+28
-70
lines changed
Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
parameters:
22
TargetVariable: ''
3+
TargetUserVariable: 'notspecified'
4+
TargetTeamVariable: 'notspecified'
5+
TargetLabelVariable: 'notspecified'
36
ServiceDirectory: ''
7+
DevOpsFeed: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"
48

59
steps:
6-
- pwsh: |
7-
git clone https://github.com/Azure/azure-sdk-tools.git $(Build.SourcesDirectory)/tools_repo
8-
cd $(Build.SourcesDirectory)/tools_repo
9-
git checkout azure-sdk-tools_20210114.1
10-
displayName: Setup Identity Resolver
10+
- task: DotNetCoreCLI@2
11+
displayName: 'Install Identity Resolver'
12+
inputs:
13+
command: custom
14+
custom: 'tool'
15+
arguments: 'install --global --add-source "${{ parameters.DevOpsFeed }}" --version "1.0.0-dev.20211018.1" "Azure.Sdk.Tools.IdentityResolver"'
16+
workingDirectory: '$(Agent.BuildDirectory)'
17+
18+
- task: DotNetCoreCLI@2
19+
displayName: 'Install CodeOwners Retriever'
20+
inputs:
21+
command: custom
22+
custom: 'tool'
23+
arguments: 'install --global --add-source "${{ parameters.DevOpsFeed }}" --version "1.0.0-dev.20211019.1" "Azure.Sdk.Tools.RetrieveCodeOwners"'
24+
workingDirectory: '$(Agent.BuildDirectory)'
1125

1226
- pwsh: |
13-
dotnet run -v q -- `
27+
identity-resolver `
1428
--aad-app-id-var APP_ID `
1529
--aad-app-secret-var APP_SECRET `
1630
--aad-tenant-var AAD_TENANT `
@@ -19,10 +33,9 @@ steps:
1933
--kusto-table-var KUSTO_TABLE `
2034
--identity-name "$(Build.QueuedBy)" `
2135
--identity-email "$(Build.RequestedForEmail)" `
22-
--targetvar "${{ parameters.TargetVariable }}"
36+
--targetvar "${{ coalesce(parameters.TargetVariable, parameters.TargetUserVariable) }}"
2337
displayName: 'Resolving Queuing User'
2438
continueOnError: true
25-
workingDirectory: $(Build.SourcesDirectory)/tools_repo/tools/notification-configuration/identity-resolver
2639
env:
2740
APP_ID: $(notification-aad-app-id)
2841
APP_SECRET: $(notification-aad-secret)
@@ -32,15 +45,10 @@ steps:
3245
KUSTO_TABLE: $(notification-kusto-table)
3346
3447
- pwsh: |
35-
Remove-Item -Force -Recurse $(Build.SourcesDirectory)/tools_repo
36-
displayName: Clean Up Cloned Tools Repo
37-
38-
- task: PowerShell@2
39-
displayName: Add CodeOwners if Present
40-
inputs:
41-
pwsh: true
42-
filePath: $(Build.SourcesDirectory)/eng/common/scripts/get-codeowners.ps1
43-
arguments: >
44-
-TargetDirectory "/sdk/${{ parameters.ServiceDirectory }}/"
45-
-RootDirectory "$(Build.SourcesDirectory)"
46-
-VsoVariable "${{ parameters.TargetVariable }}"
48+
retrieve-codeowners `
49+
--target-directory "/sdk/${{ parameters.ServiceDirectory }}/" `
50+
--root-directory "$(Build.SourcesDirectory)" `
51+
--vso-owning-users "${{ coalesce(parameters.TargetVariable, parameters.TargetUserVariable) }}" `
52+
--vso-owning-teams "${{ parameters.TargetTeamVariable }}" `
53+
--vso-owning-labels "${{ parameters.TargetLabelVariable }}"
54+
displayName: 'Add CodeOwners if Present'

eng/common/scripts/get-codeowners.ps1

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)