You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync eng/common directory with azure-sdk-tools for PR 2963 (Azure#17496)
* Verify changelog like a release is about to take place if a vlaid date is present
* Update eng/common/scripts/ChangeLog-Operations.ps1
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
* Update eng/common/scripts/ChangeLog-Operations.ps1
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
* Update eng/common/scripts/ChangeLog-Operations.ps1
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
* Update eng/common/scripts/ChangeLog-Operations.ps1
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
* Update eng/common/scripts/ChangeLog-Operations.ps1
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
* Remove strict date verification
* Add function for sorting changelog entries
* Minor cleanups
Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
Co-authored-by: Chidozie Ononiwu (His Righteousness) <31145988+chidozieononiwu@users.noreply.github.com>
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
Copy file name to clipboardExpand all lines: eng/common/scripts/ChangeLog-Operations.ps1
+99-62Lines changed: 99 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -165,61 +165,20 @@ function Confirm-ChangeLogEntry {
165
165
return$false
166
166
}
167
167
168
-
if ($ForRelease-eq$True) {
169
-
if ($changeLogEntry.ReleaseStatus-eq$CHANGELOG_UNRELEASED_STATUS) {
170
-
LogError "Entry has no release date set. Please ensure to set a release date with format '$CHANGELOG_DATE_FORMAT'. See https://aka.ms/azsdk/guideline/changelogs for more info."
if ($status-ne ($releaseDate.ToString($CHANGELOG_DATE_FORMAT)))
178
-
{
179
-
LogError "Date must be in the format $($CHANGELOG_DATE_FORMAT). See https://aka.ms/azsdk/guideline/changelogs for more info."
180
-
return$false
181
-
}
182
-
if (((Get-Date).AddMonths(-1) -gt$releaseDate) -or ($releaseDate-gt (Get-Date).AddMonths(1)))
183
-
{
184
-
LogError "The date must be within +/- one month from today. See https://aka.ms/azsdk/guideline/changelogs for more info."
185
-
return$false
186
-
}
187
-
}
188
-
catch {
189
-
LogError "Invalid date [ $status ] passed as status for Version [$($changeLogEntry.ReleaseVersion)]. See https://aka.ms/azsdk/guideline/changelogs for more info."
190
-
return$false
191
-
}
192
-
}
193
-
194
-
if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) {
195
-
LogError "Entry has no content. Please ensure to provide some content of what changed in this version. See https://aka.ms/azsdk/guideline/changelogs for more info."
196
-
return$false
197
-
}
168
+
if ($ForRelease-eq$True)
169
+
{
170
+
LogDebug "Verifying as a release build because ForRelease parameter is set to true"
if ([System.String]::IsNullOrWhiteSpace(($sectionContent|Out-String)))
205
-
{
206
-
$emptySections+=$key
207
-
}
208
-
if ($RecommendedSectionHeaders-contains$key)
209
-
{
210
-
$foundRecomendedSection=$true
211
-
}
212
-
}
213
-
if ($emptySections.Count-gt0)
214
-
{
215
-
LogError "The changelog entry has the following sections with no content ($($emptySections-join', ')). Please ensure to either remove the empty sections or add content to the section."
216
-
return$false
217
-
}
218
-
if (!$foundRecomendedSection)
219
-
{
220
-
LogWarning "The changelog entry did not contain any of the recommended sections ($($RecommendedSectionHeaders-join', ')), pease add at least one. See https://aka.ms/azsdk/guideline/changelogs for more info."
221
-
}
174
+
# If the release status is a valid date then verify like its about to be released
if ($changeLogEntry.ReleaseStatus-eq$CHANGELOG_UNRELEASED_STATUS) {
348
+
LogError "Entry has no release date set. Please ensure to set a release date with format '$CHANGELOG_DATE_FORMAT'. See https://aka.ms/azsdk/guideline/changelogs for more info."
if ($status-ne ($releaseDate.ToString($CHANGELOG_DATE_FORMAT)))
356
+
{
357
+
LogError "Date must be in the format $($CHANGELOG_DATE_FORMAT). See https://aka.ms/azsdk/guideline/changelogs for more info."
358
+
$isValid=$false
359
+
}
360
+
361
+
if (@($entries.ReleaseStatus)[0] -ne$changeLogEntry.ReleaseStatus)
362
+
{
363
+
LogError "Invalid date [ $status ]. The date for the changelog being released must be the latest in the file."
364
+
$isValid=$false
365
+
}
366
+
}
367
+
catch {
368
+
LogError "Invalid date [ $status ] passed as status for Version [$($changeLogEntry.ReleaseVersion)]. See https://aka.ms/azsdk/guideline/changelogs for more info."
369
+
$isValid=$false
370
+
}
371
+
}
372
+
373
+
if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) {
374
+
LogError "Entry has no content. Please ensure to provide some content of what changed in this version. See https://aka.ms/azsdk/guideline/changelogs for more info."
375
+
$isValid=$false
376
+
}
377
+
378
+
$foundRecommendedSection=$false
379
+
$emptySections=@()
380
+
foreach ($keyin$changeLogEntry.Sections.Keys)
381
+
{
382
+
$sectionContent=$changeLogEntry.Sections[$key]
383
+
if ([System.String]::IsNullOrWhiteSpace(($sectionContent|Out-String)))
384
+
{
385
+
$emptySections+=$key
386
+
}
387
+
if ($RecommendedSectionHeaders-contains$key)
388
+
{
389
+
$foundRecommendedSection=$true
390
+
}
391
+
}
392
+
if ($emptySections.Count-gt0)
393
+
{
394
+
LogError "The changelog entry has the following sections with no content ($($emptySections-join', ')). Please ensure to either remove the empty sections or add content to the section."
395
+
$isValid=$false
396
+
}
397
+
if (!$foundRecommendedSection)
398
+
{
399
+
LogWarning "The changelog entry did not contain any of the recommended sections ($($RecommendedSectionHeaders-join', ')), please add at least one. See https://aka.ms/azsdk/guideline/changelogs for more info."
0 commit comments