Skip to content

Updates to Update-Changelog.ps1#1299

Merged
1 commit merged intoAzure:masterfrom
chidozieononiwu:UpdateUpdateChangeLog
Jan 5, 2021
Merged

Updates to Update-Changelog.ps1#1299
1 commit merged intoAzure:masterfrom
chidozieononiwu:UpdateUpdateChangeLog

Conversation

@chidozieononiwu
Copy link
Copy Markdown
Member

@chidozieononiwu chidozieononiwu commented Jan 4, 2021

  • This makes sure most of behavior is same as eng\common\Update-Change-Log.ps1 with better handling for out side of normal use cases.

@chidozieononiwu chidozieononiwu requested a review from a team as a code owner January 4, 2021 22:57
@azure-sdk
Copy link
Copy Markdown
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Copy Markdown
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

Comment thread eng/common/scripts/Update-ChangeLog.ps1
)

if ($ReleaseDate -and ($Unreleased -eq $True)) {
[Boolean]$Unreleased = [System.Convert]::ToBoolean($Unreleased)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do the manual conversion here as opposed to just having the parameters be Boolean as they currently are?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We call it from various python and Js scripts. Passing the parameters a Booleans was problematic. It wasn't clear to me how to get it working from all ends with Boolean parameters hence I just did the conversion after.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I figured you could just pass in the string "true" or "false" (or 0/1) as arguments and it would just work. Did that not work when calling it from python/JS?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes that the issue. Even thought "true" and "false" is passed in the JS script . It is still recognized a s string on the PowerShell side and errors if the parameters are Boolean. Python has a similar weirdness.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK. We could also consider making these switches so we don't have to pass a value in most cases. In either case if you keep these as strings it would be nice to add a comment as to why you are doing it so it is clear to use later.

Comment thread eng/common/scripts/Update-ChangeLog.ps1
Comment thread eng/common/scripts/Update-ChangeLog.ps1 Outdated
Comment thread eng/common/scripts/Update-ChangeLog.ps1 Outdated
if ($ReplaceLatestEntryTitle)
{
$newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -Content $ChangeLogEntries[$LatestVersion].ReleaseContent
LogDebug "Resetting latest entry title to [$($newChangeLogEntry.ReleaseTitle)]"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why LogDebug here as opposed to a standard log message?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I could make it the standard output. Just the LogDebug is colored blue on DevOps which looks quite better, that's the only reason am using it here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok I guess LogDebug just didn't seem right in my head as I associated it with Write-Debug which will not write anything unless Debug preference is setup. We may want to think about the naming that function a little more.

}
elseif ($ChangeLogEntries.Contains($Version))
{
$ChangeLogEntries[$Version].ReleaseVersion = $Version
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you know if there was any reason why ReleaseVersion wouldn't match Version? Did we used to set it when we didn't need to?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The ReleaseVersion should be the same as the Version in the title of the Release Entry. Its just that its named ReleaseVersion in the object returned from the ChangeLog operation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok if there is no case were we need to update it then I'm fine with removing this.

@azure-sdk
Copy link
Copy Markdown
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@ghost
Copy link
Copy Markdown

ghost commented Jan 5, 2021

Hello @azure-sdk!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit dd10514 into Azure:master Jan 5, 2021
[String]$PackageName,
[boolean]$Unreleased=$True,
[boolean]$ReplaceLatestEntry = $False,
[String]$Unreleased=$True,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you want these to be strings now we should probably default them to strings instead of booleans.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants