Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement (entrypoint): Standardize and improve clarity of verbose output #115

Merged
Show file tree
Hide file tree
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: 13 additions & 5 deletions src/scripts/ci/Invoke-Generate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,40 @@ try {

# Generate release notes
if ($env:PROJECT_DIRECTORY) {
"Using specified project directory '$env:PROJECT_DIRECTORY'" | Write-Verbose
$private:ProjectDir = $env:PROJECT_DIRECTORY
}else {
$private:superProjectDir = git rev-parse --show-superproject-working-tree
if ($private:superProjectDir) {
$private:ProjectDir = $private:superProjectDir
"Using superproject path '$private:ProjectDir'" | Write-Verbose
"Using superproject directory '$private:ProjectDir'" | Write-Verbose
}else {
throw "`$env:PROJECT_DIRECTORY is undefined or superproject directory cannot be determined." | Write-Verbose
}
}
$private:generateArgs = @{
Path = $private:ProjectDir
TagName = if ($env:RELEASE_TAG_REF) {
$env:RELEASE_TAG_REF
"Using specified ref '$env:RELEASE_TAG_REF'" | Write-Verbose
$env:RELEASE_TAG_REF
}else {
"`$env:RELEASE_TAG_REF is null or undefined. Using the default ref 'HEAD'" | Write-Verbose
"Using default ref 'HEAD'" | Write-Verbose
'HEAD'
}
Variant = if ($env:RELEASE_NOTES_VARIANT) { $env:RELEASE_NOTES_VARIANT } else { 'VersionDate-HashSubject-NoMerges-CategorizedSorted' }
Variant = if ($env:RELEASE_NOTES_VARIANT) {
"Using specified release notes variant '$env:RELEASE_NOTES_VARIANT'" | Write-Verbose
$env:RELEASE_NOTES_VARIANT
}else {
"Using default release notes variant 'VersionDate-HashSubject-NoMerges-CategorizedSorted'" | Write-Verbose
'VersionDate-HashSubject-NoMerges-CategorizedSorted'
}
ReleaseNotesPath = if ($env:RELEASE_NOTES_PATH) {
"Using specified release notes path '$env:RELEASE_NOTES_PATH'" | Write-Verbose
if ([System.IO.Path]::IsPathRooted($env:RELEASE_NOTES_PATH)) { $env:RELEASE_NOTES_PATH }
else { "$private:ProjectDir/$env:RELEASE_NOTES_PATH" }
}else {
$private:defaultReleaseNotesPath = "$(git rev-parse --show-toplevel)/.release-notes.md"
"Using the default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
"Using default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
$private:defaultReleaseNotesPath
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/scripts/ci/Invoke-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ try {

# Create GitHub release
if ($env:PROJECT_DIRECTORY) {
"Using specified project directory '$env:PROJECT_DIRECTORY'" | Write-Verbose
$private:ProjectDir = $env:PROJECT_DIRECTORY
}else {
$private:superProjectDir = git rev-parse --show-superproject-working-tree
if ($private:superProjectDir) {
$private:ProjectDir = $private:superProjectDir
"Using superproject path '$private:ProjectDir'" | Write-Verbose
"Using superproject directory '$private:ProjectDir'" | Write-Verbose
}else {
throw "`$env:PROJECT_DIRECTORY is undefined or superproject directory cannot be determined." | Write-Verbose
}
Expand All @@ -40,7 +41,7 @@ try {
}else {
$private:defaultReleaseNotesPath = "$(git rev-parse --show-toplevel)/.release-notes.md"
if (Test-Path -Path $private:defaultReleaseNotesPath -PathType Leaf) {
"Sourcing from the default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
"Sourcing from default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
$private:createReleaseArgs['ReleaseNotesPath'] = $private:defaultReleaseNotesPath
}else {
"Default release notes not found at the path '$private:defaultReleaseNotesPath'. No release notes will be included with the release." | Write-Verbose
Expand Down