Skip to content

Commit 2010c3e

Browse files
committed
Resolve code review comments
1 parent b4fb290 commit 2010c3e

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ For more information on cleaning up the commits in a pull request, such as how t
106106

107107
#### Breaking Changes
108108

109-
Breaking changes should **not** be introduced into the repository without giving customers at least six months notice. For a full list of breaking changes in Azure PowerShell, click [here](https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes.md).
109+
Breaking changes should **not** be introduced into the repository without giving customers at least six months notice. For a description of breaking changes in Azure PowerShell, see [here](https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes.md).
110110

111111
Whenever a service team announces a breaking change, they must add it to the `upcoming-breaking-changes.md` file in their respective service folder. When the service team is ready to release the module with the breaking change, they must move the corresponding information from `upcoming-breaking-changes.md` into the `current-breaking-changes.md` file located in their service folder.
112112

tools/UpdateBreakingChangeDocs.ps1

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,27 +109,7 @@ This function will use the given psd1 file to grab the module version.
109109
#>
110110
function GetModuleVersion([string]$PathToModule)
111111
{
112-
# Get the content of the psd1 file
113-
$content = Get-Content -Path $PathToModule -Encoding UTF8
114-
115-
# For each line of the file, check if we have found the module version
116-
for ($idx = 0; $idx -lt $content.Length; $idx++)
117-
{
118-
# If we have found the module version, grab the value and return it
119-
if ($content[$idx] -like "ModuleVersion*")
120-
{
121-
$start = $content[$idx].IndexOf("'") + 1
122-
123-
$end = $content[$idx].LastIndexOf("'")
124-
125-
$length = $end - $start
126-
127-
return $content[$idx].Substring($start, $length)
128-
}
129-
}
130-
131-
# Throw if we are unable to find the module version
132-
throw "Could not find module version for file $PathToModule"
112+
return (Test-ModuleManifest -Path $PathToModule).Version.ToString()
133113
}
134114

135115
<#
@@ -149,7 +129,14 @@ function UpdateARMBreakingChangeDocs([string]$PathToServices)
149129
$currentDocPath = "$($doc.FullName)\current-breaking-changes.md"
150130
$upcomingDocPath = "$($doc.FullName)\upcoming-breaking-changes.md"
151131

152-
$modulePath = "$($doc.FullName)\..\*.psd1"
132+
$Service = Get-Item -Path "$($doc.FullName)\.."
133+
134+
$serviceName = $Service.Name
135+
136+
if ($serviceName -eq "AzureBackup") { $serviceName = "Backup" }
137+
if ($serviceName -eq "AzureBatch") { $serviceName = "Batch" }
138+
139+
$modulePath = "$PathToRepo\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.$serviceName\AzureRM.$serviceName.psd1"
153140

154141
$moduleVersion = GetModuleVersion -PathToModule $modulePath
155142

@@ -218,18 +205,20 @@ if (!$PathToRepo)
218205
$PathToRepo = "$PSScriptRoot\.."
219206
}
220207

208+
Import-Module PowerShellGet
209+
221210
# Update all of the ResourceManager breaking change docs
222211
$ResourceManagerChanges = UpdateARMBreakingChangeDocs -PathToServices $PathToRepo\src\ResourceManager
223212

224213
# Update the ServiceManagement breaking change doc
225214
$PathToCurrentDoc = "$PathToRepo\src\ServiceManagement\Services\Commands.Utilities\documentation\current-breaking-changes.md"
226-
$ModuleVersion = GetModuleVersion -PathToModule $PathToRepo\src\ServiceManagement\Services\Commands.Utilities\Azure.psd1
215+
$ModuleVersion = GetModuleVersion -PathToModule $PathToRepo\src\Package\Debug\ServiceManagement\Azure\Azure.psd1
227216

228217
$ServiceManagementChanges = UpdateCurrentDoc -PathToCurrentDoc $PathToCurrentDoc -ModuleVersion $ModuleVersion
229218

230219
# Update the Storage breaking change doc
231220
$PathToCurrentDoc = "$PathToRepo\src\Storage\documentation\current-breaking-changes.md"
232-
$ModuleVersion = GetModuleVersion -PathToModule $PathToRepo\src\Storage\Azure.Storage.psd1
221+
$ModuleVersion = GetModuleVersion -PathToModule $PathToRepo\src\Package\Debug\Storage\Azure.Storage\Azure.Storage.psd1
233222

234223
$StorageChanges = UpdateCurrentDoc -PathToCurrentDoc $PathToCurrentDoc -ModuleVersion $ModuleVersion
235224

0 commit comments

Comments
 (0)