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 7855 (#34857)
* Pipeline template to validate package and update package work item
* Changes to restructure validations
* Additional fixes as per comments
* Remove explicit exit code
* Set erroractionpreference for change log check
---------
Co-authored-by: Praveen Kuttappan <[email protected]>
LogError "ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}."
159
+
$ChangeLogStatus.Message="ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}."
160
+
$ChangeLogStatus.IsValid=$false
161
+
LogError "$($ChangeLogStatus.Message)"
149
162
return$false
150
163
}
151
164
@@ -161,24 +174,28 @@ function Confirm-ChangeLogEntry {
161
174
Write-Host"-----"
162
175
163
176
if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) {
164
-
LogError "Entry does not have a correct release status. Please ensure the status is set to a date '($CHANGELOG_DATE_FORMAT)' or '$CHANGELOG_UNRELEASED_STATUS' if not yet released. See https://aka.ms/azsdk/guideline/changelogs for more info."
177
+
$ChangeLogStatus.Message="Entry does not have a release status. Please ensure the status is set to a date '($CHANGELOG_DATE_FORMAT)' or '$CHANGELOG_UNRELEASED_STATUS' if not yet released. See https://aka.ms/azsdk/guideline/changelogs for more info."
178
+
$ChangeLogStatus.IsValid=$false
179
+
LogError "$($ChangeLogStatus.Message)"
165
180
return$false
166
181
}
167
182
168
183
if ($ForRelease-eq$True)
169
184
{
170
185
LogDebug "Verifying as a release build because ForRelease parameter is set to true"
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."
349
-
$isValid=$false
372
+
$ChangeLogStatus.Message="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
381
{
357
-
LogError "Date must be in the format $($CHANGELOG_DATE_FORMAT). See https://aka.ms/azsdk/guideline/changelogs for more info."
358
-
$isValid=$false
382
+
$ChangeLogStatus.Message="Date must be in the format $($CHANGELOG_DATE_FORMAT). See https://aka.ms/azsdk/guideline/changelogs for more info."
383
+
$ChangeLogStatus.IsValid=$false
384
+
LogError "$($ChangeLogStatus.Message)"
359
385
}
360
386
361
387
if (@($entries.ReleaseStatus)[0] -ne$changeLogEntry.ReleaseStatus)
362
388
{
363
-
LogError "Invalid date [ $status ]. The date for the changelog being released must be the latest in the file."
364
-
$isValid=$false
389
+
$ChangeLogStatus.Message="Invalid date [ $status ]. The date for the changelog being released must be the latest in the file."
390
+
$ChangeLogStatus.IsValid=$false
391
+
LogError "$($ChangeLogStatus.Message)"
365
392
}
366
393
}
367
394
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
395
+
$ChangeLogStatus.Message="Invalid date [ $status ] passed as status for Version [$($changeLogEntry.ReleaseVersion)]. See https://aka.ms/azsdk/guideline/changelogs for more info."
396
+
$ChangeLogStatus.IsValid=$false
397
+
LogError "$($ChangeLogStatus.Message)"
370
398
}
371
399
}
372
400
373
401
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
402
+
$ChangeLogStatus.Message="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."
403
+
$ChangeLogStatus.IsValid=$false
404
+
LogError "$($ChangeLogStatus.Message)"
376
405
}
377
406
378
407
$foundRecommendedSection=$false
@@ -391,12 +420,14 @@ function Confirm-ChangeLogForRelease {
391
420
}
392
421
if ($emptySections.Count-gt0)
393
422
{
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
423
+
$ChangeLogStatus.Message="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."
424
+
$ChangeLogStatus.IsValid=$false
425
+
LogError "$($ChangeLogStatus.Message)"
396
426
}
397
427
if (!$foundRecommendedSection)
398
428
{
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."
429
+
$ChangeLogStatus.Message="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