Skip to content

Add Contributor Compilation Tool for Release Notes#27284

Merged
tianleiwu merged 5 commits intomainfrom
tlwu/compile_contributors
Feb 9, 2026
Merged

Add Contributor Compilation Tool for Release Notes#27284
tianleiwu merged 5 commits intomainfrom
tlwu/compile_contributors

Conversation

@tianleiwu
Copy link
Contributor

@tianleiwu tianleiwu commented Feb 7, 2026

Summary

This PR introduces a new tool, compile_contributors.py, designed to automate and improve the accuracy of contributor attribution for ONNX Runtime release notes. It accurately identifies original authors even in complex scenarios involving release cherry-pick rounds and meta-PRs.

Key Features

1. Robust Meta-PR & Cherry-Pick Expansion

  • Recursive Expansion: The script automatically detects "Cherry-pick round" meta-PRs and recursively expands them by extracting original PR numbers from titles, bodies, and commit messages using the GitHub CLI (gh).
  • Accurate Filtering: Refined regex logic ensures that only Pull Requests are extracted, explicitly ignoring Issue URLs (e.g., 26985) to ensure code attribution is tied to the authors.

2. High-Fidelity Contributor Attribution

  • Case-Insensitive Consolidation: Deduplicates contributors by normalizing GitHub logins case-insensitively, while preserving the first-seen casing for display.
  • Author Fallback: If an original PR's metadata is unavailable (e.g., private or deleted), the tool automatically falls back to the Meta-PR's authors or the Git commit author to ensure no contribution is missed.
  • Bot Filtering: Includes a comprehensive list of known bots to ensure the final summary reflects human contributors only.

3. Traceability & Output

  • Detailed Execution Logs: Generates a logs.txt file in the output directory, providing a step-by-step audit trail of why every PR was included, expanded, or skipped.
  • Auditable CSV Details: Produces a detail.csv mapping every change to its original PR, title, authors, and target commit.
  • Configurable Control: Added --scan-depth argument to allow users to control the lookback window for deduplication or meta-PR expansion analysis.
  • GitHub-Optimized Summary: Prints a professional, markdown-ready contributor list to both the console and logs. It uses single-line formatting to allow GitHub's GFM to handle responsive wrapping naturally in release notes.

Verification

The tool has been validated across several release scenarios:

  • Verified Issue Filtering: Confirmed that issues like 26985 are ignored during expansion, even when mentioned in titles.
  • Verified Expansion: Successfully expanded meta-PRs like 25563 into underlying work (e.g., 25544).
  • Verified Security: Confirmed that shell=False handling prevents command injection via branch names.

Usage

python tools/python/compile_contributors.py --base <base_ref> --target <target_ref> --dir <output_dir> --scan-depth 100

Requirements:

  • GitHub CLI (gh) must be installed and authenticated.
  • Python 3.7+ (uses capture_output)

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

Adds a new Python tool to generate contributor attribution for ONNX Runtime release notes by diffing git history between a base and target ref, with special handling for cherry-pick “meta-PRs”.

Changes:

  • Introduces tools/python/compile_contributors.py to collect PRs/commits between two refs, expand cherry-pick rounds, and attribute authors.
  • Outputs auditable artifacts (detail.csv, logs.txt) plus a markdown-ready contributor summary.
  • Implements contributor consolidation/deduping (case-insensitive logins) and bot filtering.

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

tianleiwu and others added 2 commits February 7, 2026 11:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.


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

@tianleiwu tianleiwu merged commit bcd5605 into main Feb 9, 2026
90 checks passed
@tianleiwu tianleiwu deleted the tlwu/compile_contributors branch February 9, 2026 22:34
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.

2 participants