Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions eng/versioning/scan_for_unreleased_dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ Get-ChildItem -Path $serviceDirectory -Filter pom*.xml -Recurse -File | ForEach-
Write-Error-With-Color "Error: Cannot release non-beta libraries with beta_ dependencies. dependency=$($versionUpdateTag)"
}
continue
} else {
# If this is an external dependency then continue
if ($versionUpdateTag -match "external_dependency}") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is actually a good idea to do a check for both internal and external dependencies. I'd suggest we use the SemVer.ps1 script we have under common and check to see if our version and if it is not prerelease then we should error for any dependency that is marked as a prerelease.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weshaggard, sure. I can look and see if this is feasible for external_dependencies on Monday. There are, unfortunately, beta external dependencies. Also, I'd have to verify that the SemVer.ps1 does correctly parse all of the external dependency versions first as Maven is a bit more liberal with what it allows for versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we don't depend on external prereleases in our GA packages that will definitely be a recipe for potential disaster.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do but only in a scope. I'm less concerned about external dependencies since the maven-enforcer-plugin was added and every dependency is now being scrutinized (track 2 only though).

continue
}
# If this isn't an external dependency then ensure that if the dependency
# version is beta, that we're releasing a beta, otherwise fail
if ($versionNode.InnerText -like '*-beta.*')
{
if (!$libraryIsBeta)
{
$script:FoundError = $true
Write-Error-With-Color "Error: Cannot release non-beta libraries with beta dependencies. dependency=$($versionUpdateTag), version=$($versionNode.InnerText.Trim())"
}
}
}
}
else
Expand All @@ -106,8 +121,7 @@ if (-Not $script:FoundPomFile) {
exit(1)
}
if ($script:FoundError) {
Write-Error-With-Color "Libaries with unreleased dependencies cannot be released."
exit(1)
}

Write-Host "$($inputGroupId):$($inputArtifactId) looks goood to release" -ForegroundColor Green
Write-Host "$($inputGroupId):$($inputArtifactId) looks good to release" -ForegroundColor Green