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

Updates to Update-Changelog.ps1 #1299

Merged
1 commit merged into from
Jan 5, 2021

Conversation

chidozieononiwu
Copy link
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
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
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

[String]$ReleaseDate
)

if ($ReleaseDate -and ($Unreleased -eq $True)) {
[Boolean]$Unreleased = [System.Convert]::ToBoolean($Unreleased)
Copy link
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
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
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
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
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.

{
$newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -Content $ChangeLogEntries[$LatestVersion].ReleaseContent
LogDebug "Resetting latest entry title to [$($newChangeLogEntry.ReleaseTitle)]"
Copy link
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
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
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
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
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
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
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

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
@@ -12,41 +12,46 @@ param (
[String]$ServiceDirectory,
[Parameter(Mandatory = $true)]
[String]$PackageName,
[boolean]$Unreleased=$True,
[boolean]$ReplaceLatestEntry = $False,
[String]$Unreleased=$True,
Copy link
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