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
POM file version scanner updates and fixes (#43243)
* POM file version scanner updates and fixes
* Update to azure-sdk-parent gets scanned as well as signature nodes
* Update eng/versioning/pom_file_version_scanner.ps1
Co-authored-by: Bill Wert <[email protected]>
* Update eng/versioning/pom_file_version_scanner.ps1
Co-authored-by: Bill Wert <[email protected]>
---------
Co-authored-by: Bill Wert <[email protected]>
@@ -252,6 +252,13 @@ function Build-Dependency-Hash-From-File {
252
252
{
253
253
try {
254
254
[Dependency]$dep= [Dependency]::new($line)
255
+
# This is the case where there is no current version but dependency isn't
256
+
# "unreleased_" or "beta_" meaning that the line is either incorrect or
257
+
# has an invalid format
258
+
if (-not$dep.curVer-and (-not$dep.Id.StartsWith("unreleased_")) -and (-not$dep.Id.StartsWith("beta_"))) {
259
+
Write-Error-With-Color "Invalid dependency line='$($line) in file=$($depFile) has no current version and is not unreleased_ or beta_.`nPlease ensure the format is <groupId>:<artifactId>;<dependencyVer>;<currentVer> and the seperators are semicolons (;)"
260
+
$script:FoundError=$true
261
+
}
255
262
if ($depHash.ContainsKey($dep.id))
256
263
{
257
264
Write-Error-With-Color "Error: Duplicate dependency encountered. '$($dep.id)' defined in '$($depFile)' already exists in the dependency list which means it is defined in multiple version_*.txt files."
@@ -262,6 +269,7 @@ function Build-Dependency-Hash-From-File {
262
269
}
263
270
catch {
264
271
Write-Error-With-Color "Invalid dependency line='$($line) in file=$($depFile)"
272
+
$script:FoundError=$true
265
273
}
266
274
}
267
275
else
@@ -278,6 +286,7 @@ function Build-Dependency-Hash-From-File {
278
286
}
279
287
catch {
280
288
Write-Error-With-Color "Invalid external dependency line='$($line) in file=$($depFile)"
Write-Error-With-Color "There were errors encountered building the dependency hash from version_client.txt. Please fix errors and run the script again."
530
+
Write-Error-With-Color "This script can be run locally from the root of the repo. .\eng\versioning\pom_file_version_scanner.ps1"
Write-Error-With-Color "There were errors encountered building the external dependency has from external_dependencies.txt. Please fix errors and run the script again."
548
+
Write-Error-With-Color "This script can be run locally from the root of the repo. .\eng\versioning\pom_file_version_scanner.ps1"
549
+
exit1
550
+
}
520
551
521
552
# Loop through every client and data POM file and perform the verification. Right now
522
553
# management isn't being processed, when it is the checks below will go away and every
# Because this particular case is harder to track down, print the OuterXML which is effectively the entire tag
834
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: signature is missing version element and/or artifactId and groupId elements signatureNode=$($signatureNode.OuterXml)"
835
+
}
836
+
continue
837
+
}
838
+
# signatures should always have an artifact but may not have a groupId
839
+
if (!$groupId)
840
+
{
841
+
$hasError=$true
842
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: signature $($artifactId) is missing its groupId tag"
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: signature is missing version element for groupId=$($groupId), artifactId=$($artifactId) should be <version></version> <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
850
+
continue
851
+
}
852
+
if ($versionNode.NextSibling-and$versionNode.NextSibling.NodeType-eq"Comment")
853
+
{
854
+
# unfortunately because there are POM exceptions we need to wildcard the group which may be
855
+
# something like <area>_groupId
856
+
if ($versionNode.NextSibling.Value.Trim() -notmatch"{x-version-update;(.+)?$($groupId):$($artifactId);\w+}")
857
+
{
858
+
$hasError=$true
859
+
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: signature version update tag for groupId=$($groupId), artifactId=$($artifactId) should be <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
$potentialLogMessage=Join-With-NewLine $potentialLogMessage"Error: Missing signature version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be <!-- {x-version-update;$($groupId):$($artifactId);current|dependency|external_dependency<select one>} -->"
876
+
}
877
+
}
878
+
797
879
# This is for the allowlist dependencies. Fetch the banned dependencies
0 commit comments