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

Update Changelog Logic to accommodate older entries #1335

Merged
3 commits merged into from
Jan 25, 2021

Conversation

chidozieononiwu
Copy link
Member

@chidozieononiwu chidozieononiwu commented Jan 21, 2021

This change is to accommodate parts of the changelog that does not properly indicate the release status as specified in the changelog guideline.
This also switched the logic to use Ordered HashTable so as not to rely on SemVer sorting. This allows us accommodate version that are not SemVer compliant.

@@ -2,7 +2,7 @@
. "${PSScriptRoot}\logging.ps1"
. "${PSScriptRoot}\SemVer.ps1"

$RELEASE_TITLE_REGEX = "(?<releaseNoteTitle>^\#+.*(?<version>\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s+(?<releaseStatus>\(Unreleased\)|\(\d{4}-\d{2}-\d{2}\)))?)"
$RELEASE_TITLE_REGEX = "(?<releaseNoteTitle>^\#+.*(?<version>\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s+(?<releaseStatus>\(.*\))?)"
Copy link
Member

Choose a reason for hiding this comment

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

Why loosen this? If we don't match the title then can we just leave the entry alone?

Copy link
Member Author

@chidozieononiwu chidozieononiwu Jan 21, 2021

Choose a reason for hiding this comment

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

We will be using it in other places though. e.g. in collect changelog to pull out released for the required date. I guess we have to enforce it at some point to make sure its valid date format. We also loosened it for changelog verification before release. But we can just loosen it here and then if we need to make use of the date we can error and indicate the date is wrong then it can be fixed on the changelog itself.

Copy link
Member

Choose a reason for hiding this comment

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

We were depending on the regex to enforce our guidelines but if you loosen it here then we should add extra validation in other places in the helper scripts to ensure people still follow the guidelines.

However I'm not sure why we cannot simply ignore any sections that aren't in the valid format.

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 don't know of any other place we are using this regex. Looks like its only used to grab the release status/date. We do enforce that its a valid date before releasing

so I think we should be fine with loosening it here. We'll be able to accommodate older entries that are not correct while making sure new entries are.

Copy link
Member

Choose a reason for hiding this comment

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

Ok lets see if this helps with the older entries. How do we plan to handle the version numbers with preview but no number?

@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

@chidozieononiwu chidozieononiwu force-pushed the UpdateChangelogOperationTools branch from cba9894 to 27f3f8a Compare January 21, 2021 23:17
@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

@chidozieononiwu chidozieononiwu force-pushed the UpdateChangelogOperationTools branch from 27f3f8a to ea2a808 Compare January 22, 2021 02:42
@chidozieononiwu chidozieononiwu changed the title Loosen up $RELEASE_TITLE_REGEX to accommodate wrongly formatted changelogs Update Changelog Logic to accommodate older entries Jan 22, 2021
@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

@@ -191,16 +191,7 @@ function Set-ChangeLogContent {
$changeLogContent += "# Release History"
$changeLogContent += ""

try
{
$VersionsSorted = [AzureEngSemanticVersion]::SortVersionStrings($ChangeLogEntries.Keys)
Copy link
Member

Choose a reason for hiding this comment

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

OK this is is what removed some of the entries that didn't match? So we no longer sort the entries at all then? That might be easier but I just want to confirm.

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, we were sorting it in three places. I removed two of them. We still do one sorting here. I left that one because it shouldn't be too much of a problem, am just using it to see if an older version than the latest is being used for the update.

)

$results = [Ordered]@{}
$results.Add($Version, $NewChangeLogEntry)
Copy link
Member

Choose a reason for hiding this comment

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

@praveenkuttappan
Copy link
Member

Assuming that this change will resolve storage version increment issue I have mentioned earlier so PR #1331 is not required. right?

@weshaggard
Copy link
Member

@praveenkuttappan yes I closed your PR in favor of this one.

@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

@chidozieononiwu chidozieononiwu force-pushed the UpdateChangelogOperationTools branch from da2862d to b2809e3 Compare January 23, 2021 01:07
@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

@chidozieononiwu chidozieononiwu force-pushed the UpdateChangelogOperationTools branch from b2809e3 to 39b4485 Compare January 25, 2021 17:03
@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 25, 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 e0c8b89 into Azure:master Jan 25, 2021
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