Skip to content

Commit b6ce805

Browse files
committed
cleanup
1 parent ca46487 commit b6ce805

4 files changed

Lines changed: 142 additions & 159 deletions

File tree

.github/workflows/ado-migration-process-workitem-backfill-between.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ on:
66
SourceOrganizationName:
77
description: "Name of the Source Organization"
88
required: true
9-
default: "AIZ-GL"
9+
default: ""
1010
SourceProjectName:
1111
description: "Name of the Source Project"
1212
required: true
13-
default: "GL.CL-Elita"
13+
default: ""
1414
TargetOrganizationName:
1515
description: "Name of the Target Organization"
1616
required: true
17-
default: "AIZ-Global"
17+
default: ""
1818
TargetProjectName:
1919
description: "Name of the Target Project"
2020
required: true
21-
default: "GL.CL-Elita-migrated"
21+
default: ""
2222
StartDate:
2323
description: "Start Changed Date (month/day/year)"
2424
required: true
@@ -65,7 +65,7 @@ on:
6565
jobs:
6666
run-powershell-script:
6767
name: Run PowerShell Script
68-
runs-on: 'AEC0WGEMP001'
68+
runs-on: "AEC0WGEMP001"
6969
timeout-minutes: 7200
7070
env:
7171
AZURE_DEVOPS_MIGRATION_PAT: ${{ secrets.AZURE_DEVOPS_MIGRATION_PAT }}
@@ -88,7 +88,7 @@ jobs:
8888
run: |
8989
Get-ChildItem "${{ vars.WORKITEMMIGRATORDIRECTORY_V16_0_9 }}/logs" -Recurse | Remove-Item -Recurse
9090
91-
- name: Set Migration Configuration
91+
- name: Set Migration Configuration
9292
shell: pwsh
9393
run: |
9494
$SourceOrganizationUrl = "https://dev.azure.com/${{ github.event.inputs.SourceOrganizationName }}/"
@@ -98,7 +98,7 @@ jobs:
9898
$LocalConfigPath = "configuration\configuration.json"
9999
$filePath = Resolve-Path -Path "$LocalConfigPath"
100100
Write-Host "FILEPATH: $filePath"
101-
101+
102102
$configuration = [Object](Get-Content $LocalConfigPath | Out-String | ConvertFrom-Json)
103103
$configuration.SourceProject.Organization = "$SourceOrganizationUrl"
104104
$configuration.SourceProject.ProjectName = "${{ github.event.inputs.SourceProjectName }}"
@@ -112,7 +112,7 @@ jobs:
112112
$configuration.DevOpsMigrationToolConfigurationFile = "${{ vars.DevOpsMigrationToolConfigurationFile }}"
113113
$configuration.ArtifactFeedPackageVersionLimit = ${{ vars.ArtifactFeedPackageVersionLimit }}
114114
$configuration | ConvertTo-Json -Depth 100 | Set-Content $LocalConfigPath
115-
115+
116116
$configuration2 = [Object](Get-Content $LocalConfigPath | Out-String | ConvertFrom-Json)
117117
Write-Host (ConvertTo-Json -Depth 100 $configuration2)
118118
@@ -128,7 +128,7 @@ jobs:
128128
$whatIfDryRun = "${{ github.event.inputs.WhatIf }}"
129129
$WhatIf = $whatIfDryRun -match "true"
130130
$format = "MM/dd/yyyy"
131-
131+
132132
echo $selection
133133
echo $start
134134
echo $end
@@ -169,4 +169,3 @@ jobs:
169169
with:
170170
name: migration-run-logs
171171
path: "./Projects"
172-

.github/workflows/ado-migration-process-workitem-backfill.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ on:
66
SourceOrganizationName:
77
description: "Name of the Source Organization"
88
required: true
9-
default: "AIZ-GL"
9+
default: ""
1010
SourceProjectName:
1111
description: "Name of the Source Project"
1212
required: true
13-
default: "GL.CL-Elita"
13+
default: ""
1414
TargetOrganizationName:
1515
description: "Name of the Target Organization"
1616
required: true
17-
default: "AIZ-Global"
17+
default: ""
1818
TargetProjectName:
1919
description: "Name of the Target Project"
2020
required: true
21-
default: "GL.CL-Elita-migrated"
21+
default: ""
2222
NumberOfDays:
2323
description: "Number of days with Changes"
2424
required: false
@@ -61,7 +61,7 @@ on:
6161
jobs:
6262
run-powershell-script:
6363
name: Run PowerShell Script
64-
runs-on: 'AEC0WGEMP001'
64+
runs-on: "AEC0WGEMP001"
6565
timeout-minutes: 7200
6666
env:
6767
AZURE_DEVOPS_MIGRATION_PAT: ${{ secrets.AZURE_DEVOPS_MIGRATION_PAT }}
@@ -85,7 +85,7 @@ jobs:
8585
Get-ChildItem "${{ vars.WORKITEMMIGRATORDIRECTORY_V16_0_9 }}/logs" -Recurse | Remove-Item -Recurse
8686
Get-ChildItem "c:\\temp\\WorkItemAttachmentWorkingFolder" -Recurse | Remove-Item -Recurse
8787
88-
- name: Set Migration Configuration
88+
- name: Set Migration Configuration
8989
shell: pwsh
9090
run: |
9191
$SourceOrganizationUrl = "https://dev.azure.com/${{ github.event.inputs.SourceOrganizationName }}/"
@@ -95,7 +95,7 @@ jobs:
9595
$LocalConfigPath = "configuration\configuration.json"
9696
$filePath = Resolve-Path -Path "$LocalConfigPath"
9797
Write-Host "FILEPATH: $filePath"
98-
98+
9999
$configuration = [Object](Get-Content $LocalConfigPath | Out-String | ConvertFrom-Json)
100100
$configuration.SourceProject.Organization = "$SourceOrganizationUrl"
101101
$configuration.SourceProject.ProjectName = "${{ github.event.inputs.SourceProjectName }}"
@@ -109,7 +109,7 @@ jobs:
109109
$configuration.DevOpsMigrationToolConfigurationFile = "${{ vars.DevOpsMigrationToolConfigurationFile }}"
110110
$configuration.ArtifactFeedPackageVersionLimit = ${{ vars.ArtifactFeedPackageVersionLimit }}
111111
$configuration | ConvertTo-Json -Depth 100 | Set-Content $LocalConfigPath
112-
112+
113113
$configuration2 = [Object](Get-Content $LocalConfigPath | Out-String | ConvertFrom-Json)
114114
Write-Host (ConvertTo-Json -Depth 100 $configuration2)
115115

admin-tools/AzureDevOps-WorkItemHelpers.ps1

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Get-ADOWorkItemTypes([string]$ProcessId, [string]$WorkItemType, [string
1919
$results = $client.GetStringAsync($url)
2020
$workItemTypes = ($results.Result | convertfrom-json).value
2121
if ($WorkItemType) {
22-
return $workItemTypes | Where-Object {$_.name -ieq $WorkItemType}
22+
return $workItemTypes | Where-Object { $_.name -ieq $WorkItemType }
2323
}
2424
else {
2525
return $workItemTypes
@@ -57,7 +57,7 @@ function Get-ADOLists([string]$listName, [string]$org) {
5757
$results = $client.GetStringAsync($url)
5858
$lists = ($results.Result | convertfrom-json).value
5959
if ($listName) {
60-
return $lists | Where-Object {$_.name -ieq $listName}
60+
return $lists | Where-Object { $_.name -ieq $listName }
6161
}
6262
else {
6363
return $lists
@@ -77,26 +77,26 @@ function Add-ADOProjectFields([string]$project, [string]$witRefName, [string]$cs
7777
$isPickList = $false
7878
if ($_.picklist) {
7979
$pickListName = $_.picklist
80-
$list = $lists | Where-Object {$_.name -ieq $pickListName}
80+
$list = $lists | Where-Object { $_.name -ieq $pickListName }
8181
$isPickList = $true
8282
}
8383

8484
$field = [PSCustomObject]@{
85-
_links = $null
86-
canSortyBy = $true
87-
description = $null
88-
isIdentity = ($_.type -ieq "identity")
89-
isPicklist = $isPickList
85+
_links = $null
86+
canSortyBy = $true
87+
description = $null
88+
isIdentity = ($_.type -ieq "identity")
89+
isPicklist = $isPickList
9090
isPicklistSuggested = $false
91-
isQueryable = $true
92-
name = $_.name
93-
picklistId = $list.id
94-
readOnly = $false
95-
referenceName = $_.refName
91+
isQueryable = $true
92+
name = $_.name
93+
picklistId = $list.id
94+
readOnly = $false
95+
referenceName = $_.refName
9696
supportedOperations = $null
97-
type = $_.type
98-
url = $baseUrl + $_.refname
99-
usage = "workItem"
97+
type = $_.type
98+
url = $baseUrl + $_.refname
99+
usage = "workItem"
100100
}
101101

102102
$fieldjson = $field | convertto-json
@@ -120,26 +120,26 @@ function Add-ADOFields([string]$processId, [string]$witRefName, [string]$csvFile
120120
$picklist = $null
121121
if ($_.picklist) {
122122
$pickListName = $_.picklist
123-
$list = $lists | Where-Object {$_.name -ieq $pickListName}
123+
$list = $lists | Where-Object { $_.name -ieq $pickListName }
124124
$picklist = [PSCustomObject]@{
125-
id = $list.id
125+
id = $list.id
126126
isSuggested = $null
127-
Name = $pickListName
128-
type = $null
129-
url = $null
127+
Name = $pickListName
128+
type = $null
129+
url = $null
130130
}
131131
}
132132

133133
$field = [PSCustomObject]@{
134134
referenceName = $_.refName
135-
name = $_.name
136-
type = $_.type
137-
pickList = $picklist
138-
readOnly = $false
139-
required = $false
140-
defaultValue = $null
141-
url = $baseUrl + $_.refName
142-
allowGroups = $null
135+
name = $_.name
136+
type = $_.type
137+
pickList = $picklist
138+
readOnly = $false
139+
required = $false
140+
defaultValue = $null
141+
url = $baseUrl + $_.refName
142+
allowGroups = $null
143143
}
144144

145145
$fieldjson = $field | convertto-json
@@ -157,7 +157,7 @@ function Get-ADOProjectFields([string]$projectName, [string]$org, [string]$pat)
157157

158158
$headers = (New-HTTPHeaders -pat $pat)
159159

160-
$url = "$org/_apis/projects/"+$projectName+"?api-version=5.1"
160+
$url = "$org/_apis/projects/" + $projectName + "?api-version=5.1"
161161
try {
162162
$project = Invoke-RestMethod -Method Get -uri $url -headers $headers
163163
}
@@ -166,7 +166,7 @@ function Get-ADOProjectFields([string]$projectName, [string]$org, [string]$pat)
166166
return
167167
}
168168

169-
$fieldsUrl = "$org/"+$project.id+"/_apis/wit/fields?api-version=5.0-preview.2"
169+
$fieldsUrl = "$org/" + $project.id + "/_apis/wit/fields?api-version=5.0-preview.2"
170170
try {
171171
$fields = Invoke-RestMethod -Method Get -uri $fieldsUrl -headers $headers
172172
}
@@ -178,7 +178,7 @@ function Get-ADOProjectFields([string]$projectName, [string]$org, [string]$pat)
178178
}
179179

180180
function Delete-ADOWorkItemField([string]$fieldName, [string]$org, [string]$pat) {
181-
#DELETE https://dev.azure.com/aiz-test/_apis/wit/fields/Custom.ARCID
181+
#DELETE https://dev.azure.com/org-name/_apis/wit/fields/Custom.ARCID
182182
try {
183183
$results = Invoke-RestMethod -Method Delete -uri "$org/_apis/wit/fields/$fieldName" -headers (New-HTTPHeaders -pat $pat)
184184
}

0 commit comments

Comments
 (0)