Skip to content

Conversation

@daxian-dbw
Copy link
Member

PR Summary

This PR updates the Get-ChangeLog function to properly handle commits from backport PRs, whose authors are different from the real author from the original PR.

It now detects backport PRs by matching commit subjects and extracting the real author login from the PR body, ensuring correct attribution in the changelog. It also removes [release/vX.X] prefixes from commit subject for cleaner changelog entries.

PR Checklist

Copilot AI review requested due to automatic review settings December 13, 2025 00:07
@daxian-dbw daxian-dbw requested review from a team and jshigetomi as code owners December 13, 2025 00:07
@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 Dec 13, 2025
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 PR enhances the Get-ChangeLog function to correctly handle changelog generation for backport pull requests, which have different commit authors than the original PR authors. The implementation detects backport PRs by matching commit subject patterns, extracts the real author from the PR body using regex, and removes version prefix tags from commit messages for cleaner changelog entries.

Key changes:

  • Introduces a new $script:psteam_logins array to track PowerShell team member GitHub logins
  • Implements backport PR detection by matching [release/vX.X] prefix in commit subjects
  • Moves the GitHub API call earlier in the processing loop to enable backport author extraction
  • Updates the Get-ChangeLogMessage function to strip release branch prefixes

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

@iSazonov
Copy link
Collaborator

One more new scenario is Copilot's commits.

'SeeminglyScience'
'anamnavi'
'sdwheeler'
'Copilot'
Copy link
Collaborator

@iSazonov iSazonov Dec 13, 2025

Choose a reason for hiding this comment

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

Copilot is not the real author. He should have been replaced by the true initiator.

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 won't go that far. The initiator is not necessarily the one that drives it to the end, so it would be tricky to determine who should actually get the credit. Given that MS spends compute resources for a Copilot PR, we may just consider it MS' credit 😆

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe "Assignees" property of PR contains right value if remove Copilot. Is this the same that you do here for backport?

Copy link
Member Author

@daxian-dbw daxian-dbw Dec 14, 2025

Choose a reason for hiding this comment

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

No, for backport PRs, the description template has Triggered by @<user-doing-backport> on behalf of @<original-author>. This PR simply matches that pattern from the backport PR description to get the original author.


# Ignore dependency bumping bot (Dependabot):
$Script:attribution_ignore_list = @(
'dependabot[bot]@users.noreply.github.com'
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 name dependabot[bot] is already included in powershell_team, so this check is no longer needed. Also, the email has now changed to <numbers>+dependabot[bot]@users.noreply.github.com.

@daxian-dbw daxian-dbw merged commit cd06286 into PowerShell:master Dec 16, 2025
35 checks passed
@daxian-dbw daxian-dbw deleted the contributor branch December 16, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BackPort-7.4.x-Consider BackPort-7.5.x-Consider BackPort-7.6.x-Consider 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