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
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
+
}
173
193
174
-
# If the release status is a valid date then verify like its about to be released
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
+
}
181
198
199
+
$foundRecomendedSection=$false
200
+
$emptySections=@()
201
+
foreach ($keyin$changeLogEntry.Sections.Keys)
202
+
{
203
+
$sectionContent=$changeLogEntry.Sections[$key]
204
+
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
+
}
222
+
}
182
223
return$true
183
224
}
184
225
@@ -321,68 +362,4 @@ function Get-LatestReleaseDateFromChangeLog
if ($changeLogEntry.ReleaseStatus-eq$CHANGELOG_UNRELEASED_STATUS) {
334
-
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)))
342
-
{
343
-
LogError "Date must be in the format $($CHANGELOG_DATE_FORMAT). See https://aka.ms/azsdk/guideline/changelogs for more info."
344
-
$isValid=$false
345
-
}
346
-
if (((Get-Date).AddMonths(-1) -gt$releaseDate) -or ($releaseDate-gt (Get-Date).AddMonths(1)))
347
-
{
348
-
LogError "The date must be within +/- one month from today. See https://aka.ms/azsdk/guideline/changelogs for more info."
349
-
$isValid=$false
350
-
}
351
-
}
352
-
catch {
353
-
LogError "Invalid date [ $status ] passed as status for Version [$($changeLogEntry.ReleaseVersion)]. See https://aka.ms/azsdk/guideline/changelogs for more info."
354
-
$isValid=$false
355
-
}
356
-
}
357
-
358
-
if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) {
359
-
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."
360
-
$isValid=$false
361
-
}
362
-
363
-
$foundRecommendedSection=$false
364
-
$emptySections=@()
365
-
foreach ($keyin$changeLogEntry.Sections.Keys)
366
-
{
367
-
$sectionContent=$changeLogEntry.Sections[$key]
368
-
if ([System.String]::IsNullOrWhiteSpace(($sectionContent|Out-String)))
369
-
{
370
-
$emptySections+=$key
371
-
}
372
-
if ($RecommendedSectionHeaders-contains$key)
373
-
{
374
-
$foundRecommendedSection=$true
375
-
}
376
-
}
377
-
if ($emptySections.Count-gt0)
378
-
{
379
-
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."
380
-
$isValid=$false
381
-
}
382
-
if (!$foundRecommendedSection)
383
-
{
384
-
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."
385
-
}
386
-
Write-Host"Changelog validation failed. Please fix errors above and try again."
0 commit comments