Skip to content

Commit a72655b

Browse files
authored
Merge pull request Azure#5079 from twitchax/group_fix
Break the build when cmdlets do not map to doc grouping.
2 parents 1047cd0 + 96900a3 commit a72655b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

tools/CreateMappings.ps1

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ $cmdlets | ForEach-Object {
4141
} else {
4242
$results[$cmdlet] = $matchedRule.Alias;
4343
}
44-
45-
# Progress stuff.
46-
if($k % 100 -eq 0) {
47-
$percent = [math]::Floor($k / $cmdlets.Count * 100);
48-
Write-Progress -Activity "Processing cmdlets..." -Status "$($percent)%" -PercentComplete $percent;
49-
}
50-
$k++;
5144
};
5245

5346
# Write to files.
@@ -57,5 +50,9 @@ $results | ConvertTo-Json | Out-File $OutputFile;
5750
# Print conclusion.
5851
Write-Host ""
5952
Write-Host "$($results.Count) cmdlets successfully mapped: $($OutputFile)." -ForegroundColor Green;
60-
Write-Host "$($warnings.Count) cmdlets could not be mapped and were placed in 'Other': $($WarningFile)." -ForegroundColor Yellow;
6153
Write-Host ""
54+
55+
if($warnings.Count -gt 0) {
56+
Write-Host "$($warnings.Count) cmdlets could not be mapped and were placed in 'Other': $($WarningFile)." -ForegroundColor Yellow;
57+
throw "Some cmdlets could not be properly mapped to a documentation grouping: $($warnings -join ", "). Please add a mapping rule to $(Resolve-Path -Path $RulesFile).";
58+
}

tools/CreateMappings_rules.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797

9898
{ "regex": "TrafficManager", "alias": "Traffic Manager" },
9999

100+
{ "regex": "Marketplace", "alias": "Marketplace" },
101+
102+
{ "regex": "DataMigration", "alias": "Data Migration" },
103+
100104
{ "regex": "Consumption", "group": "Billing", "alias": "Billing" },
101105
{ "regex": "Billing", "group": "Billing", "alias": "Billing" },
102106

@@ -116,6 +120,8 @@
116120

117121
{ "regex": "Reservations", "alias": "Reservations" },
118122

123+
{ "regex": "Subscription", "alias": "Subscription" },
124+
119125
{ "regex": "Policy", "group": "Resources", "alias": "Policies" },
120126
{ "regex": "AD", "group": "Resources", "alias": "Active Directory" },
121127
{ "regex": "Resources", "group": "Resources", "alias": "Resources" }

0 commit comments

Comments
 (0)