Skip to content

Commit d85f430

Browse files
authored
do not allow unreleased test dependencies (#14382)
1 parent 8142b48 commit d85f430

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

eng/versioning/scan_for_unreleased_dependencies.ps1

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ param(
99

1010
# Given an input groupId, artifactId and root service directory, scan the service directory for the
1111
# POM file that matches the group/artifact. If the POM file is found, scan for any unreleased_ dependency
12-
# tags otherwise report an error. If there are unreleased dependency tags then report them and return an
12+
# tags otherwise report an error. If there are unreleased dependency tags then report them and return an
1313
# error, otherwise report success and allow the release to continue.
1414

1515
$script:FoundPomFile = $false
@@ -60,13 +60,20 @@ Get-ChildItem -Path $serviceDirectory -Filter pom*.xml -Recurse -File | ForEach-
6060
$versionUpdateTag = $versionNode.NextSibling.Value.Trim()
6161
if ($versionUpdateTag -match "{x-version-update;unreleased_$($groupId)")
6262
{
63-
# before reporting an error, check to see if there's a scope element and
64-
# if the scope is test then don't fail
65-
$scopeNode = $dependencyNode.GetElementsByTagName("scope")[0]
66-
if ($scopeNode -and $scopeNode.InnerText.Trim() -eq "test")
67-
{
68-
continue
69-
}
63+
# mvn dependency:copy-dependencies is used to copy the dependencies from maven for analysis
64+
# as part of the doc build which requires pulling down all dependencies including test
65+
# dependencies. Until such a time that a better solution is found, disable release of a
66+
# library with unreleased test dependencies. When a better solution is found, just uncomment
67+
# the code below.
68+
69+
# # before reporting an error, check to see if there's a scope element and
70+
# # if the scope is test then don't fail
71+
# $scopeNode = $dependencyNode.GetElementsByTagName("scope")[0]
72+
# if ($scopeNode -and $scopeNode.InnerText.Trim() -eq "test")
73+
# {
74+
# continue
75+
# }
76+
7077
$script:FoundError = $true
7178
Write-Error-With-Color "Error: Cannot release libraries with unreleased dependencies. dependency=$($versionUpdateTag)"
7279
continue

0 commit comments

Comments
 (0)