Skip to content

[release/v7.6] Update Get-ChangeLog to handle backport PRs correctly#26706

Merged
daxian-dbw merged 1 commit intoPowerShell:release/v7.6from
daxian-dbw:backport/release/v7.6/26610-cd0628641
Jan 21, 2026
Merged

[release/v7.6] Update Get-ChangeLog to handle backport PRs correctly#26706
daxian-dbw merged 1 commit intoPowerShell:release/v7.6from
daxian-dbw:backport/release/v7.6/26610-cd0628641

Conversation

@daxian-dbw
Copy link
Member

Backport of #26610 to release/v7.6

Triggered by @daxian-dbw on behalf of @daxian-dbw

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Customer Impact

  • Customer reported
  • Found internally

Tooling improvement for changelog generation. The Get-ChangeLog function now correctly handles backport PRs by extracting the real author from the PR body, ensuring proper attribution in changelogs.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

The fix has been tested in the original PR. The changes can be verified by running Get-ChangeLog on a release branch that contains backport PRs and confirming that the changelog correctly attributes the commits to the original authors rather than the backport PR creators.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

The changes only affect the changelog generation script used during the release process. It improves attribution accuracy for backport PRs by detecting them and extracting the real author from the PR body. This is tooling-only code that does not affect the product itself.

@daxian-dbw daxian-dbw requested review from a team and jshigetomi as code owners January 20, 2026 22:26
@daxian-dbw daxian-dbw added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Jan 20, 2026
Copilot AI review requested due to automatic review settings January 20, 2026 22:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request backports changelog generation improvements from the main branch to release/v7.6. The changes enhance the Get-ChangeLog function to properly handle backport PRs by extracting the original author from the PR description, ensuring accurate attribution in changelogs.

Changes:

  • Added new PowerShell team member GitHub logins list for author attribution
  • Enhanced backport PR detection and real author extraction from PR body
  • Improved API error handling with proper status code checks
  • Fixed variable naming issue ($input$value) to avoid PowerShell automatic variable conflicts
  • Removed deprecated attribution ignore list in favor of new team logins approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
}

if ($commitSubject -match '^\[release/v\d\.\d\] ') {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The regex pattern '^\[release/v\d\.\d\] ' only matches single-digit version numbers. This will fail for future versions like [release/v10.0] or patch versions like [release/v7.10]. The pattern should be '^\[release/v\d+\.\d+\] ' to match one or more digits in each version component, consistent with the pattern used in the Invoke-PRBackport function on line 903.

Suggested change
if ($commitSubject -match '^\[release/v\d\.\d\] ') {
if ($commitSubject -match '^\[release/v\d+\.\d+\] ') {

Copilot uses AI. Check for mistakes.
'^Build\(deps\): ' {
return $OriginalMessage.replace($Matches.0,'')
}
'^\[release/v\d\.\d\] ' {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The regex pattern '^\[release/v\d\.\d\] ' only matches single-digit version numbers. This should be '^\[release/v\d+\.\d+\] ' to match one or more digits in each version component, ensuring consistency with line 301 and supporting future versions like v10.x or v7.10.

Suggested change
'^\[release/v\d\.\d\] ' {
'^\[release/v\d+\.\d+\] ' {

Copilot uses AI. Check for mistakes.
Comment on lines +351 to 352
$commit.ChangeLogMessage = ("- {0} (Thanks @{1}!)" -f (Get-ChangeLogMessage $commitSubject), $commit.AuthorGitHubLogin)
$commit.ThankYouMessage = ("@{0}" -f ($commit.AuthorGitHubLogin))
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

If the GitHub API call fails or returns no response (lines 329-342), $commit.AuthorGitHubLogin may be null or empty. Line 351 then creates a changelog message with (Thanks @!) which is invalid. Consider adding a check to ensure $commit.AuthorGitHubLogin has a valid value before using it in the message, or provide a fallback when the GitHub login cannot be determined.

Suggested change
$commit.ChangeLogMessage = ("- {0} (Thanks @{1}!)" -f (Get-ChangeLogMessage $commitSubject), $commit.AuthorGitHubLogin)
$commit.ThankYouMessage = ("@{0}" -f ($commit.AuthorGitHubLogin))
if (-not [string]::IsNullOrWhiteSpace($commit.AuthorGitHubLogin)) {
$commit.ChangeLogMessage = ("- {0} (Thanks @{1}!)" -f (Get-ChangeLogMessage $commitSubject), $commit.AuthorGitHubLogin)
$commit.ThankYouMessage = ("@{0}" -f ($commit.AuthorGitHubLogin))
} else {
$commit.ChangeLogMessage = "- {0}" -f (Get-ChangeLogMessage $commitSubject)
}

Copilot uses AI. Check for mistakes.
@daxian-dbw daxian-dbw merged commit d02a4cc into PowerShell:release/v7.6 Jan 21, 2026
41 checks passed
@daxian-dbw daxian-dbw deleted the backport/release/v7.6/26610-cd0628641 branch January 21, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants