Skip to content

Commitlist (Release note utils )document fix#78330

Open
A-nnonymous wants to merge 3 commits intoPaddlePaddle:developfrom
A-nnonymous:commitlist_document_fix
Open

Commitlist (Release note utils )document fix#78330
A-nnonymous wants to merge 3 commits intoPaddlePaddle:developfrom
A-nnonymous:commitlist_document_fix

Conversation

@A-nnonymous
Copy link
Copy Markdown
Contributor

PR Category

User Experience

PR Types

Docs

Description

Commitlist document fix

pcard-91067

是否引起精度变化

A-nnonymous and others added 2 commits March 16, 2026 20:47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 17, 2026 06:55
@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented Mar 17, 2026

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Copy Markdown
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/updates a tools/commitlist.py utility to generate release-note worksheets from a git commit range, optionally enriching commit-derived PR numbers with GitHub GraphQL metadata and exporting per-category Markdown/CSV artifacts.

Changes:

  • Introduce a CLI tool to collect commits between two refs (merge-base default) and extract PR numbers from commit titles.
  • Fetch PR metadata (labels, author, approvals, body sections) via GitHub GraphQL with a local JSON cache.
  • Generate commitlist.csv, contributors.txt, and per-category export/<category>/result_<category>.{md,csv} outputs.
Comments suppressed due to low confidence (4)

tools/commitlist.py:589

  • render_markdown() is defined but never used (no call sites in this script). If a combined markdown summary is intended, consider writing it to an output file (and documenting it); otherwise removing the unused function will reduce maintenance surface.


def render_markdown(
    commits: list[CommitRow], base_ref: str, head_ref: str
) -> str:
    lines = [
        '# Release Notes\n\n',
        f'- Range: `{base_ref}..{head_ref}`\n',
        f'- Commits: {len(commits)}\n\n',
    ]

    categories = ordered_values(
        (commit.category for commit in commits), PR_CATEGORIES
    )
    for category in categories:
        lines.append(f'## {category}\n\n')
        category_commits = [
            commit for commit in commits if commit.category == category
        ]
        topics = ordered_values(
            (commit.topic for commit in category_commits), PR_TYPES
        )
        for topic in topics:
            topic_commits = [
                commit for commit in category_commits if commit.topic == topic
            ]
            if not topic_commits:
                continue
            lines.append(f'### {topic}\n\n')
            for commit in topic_commits:
                lines.append(
                    f'- {markdown_entry_text(commit)} ({get_hash_or_pr_url(commit)})\n'
                )
            lines.append('\n')

tools/commitlist.py:552

  • The generated worksheet header text has grammatical issues (e.g., "human read friendly"). Since this content is written into output docs, please adjust the wording to something like "human-readable" to avoid propagating typos into release-note worksheets.

def get_markdown_header(category: str) -> str:
    return (
        f'# Release Notes worksheet {category}\n'
        '- polish PR title to make it human read friendly.\n'

tools/commitlist.py:283

  • Parsing git log output with record.split('\x1f') can raise ValueError if the commit subject unexpectedly contains the separator character, which would crash the script. Consider switching to a separator that cannot appear in commit subjects (e.g., NUL via %x00) and/or guarding against malformed splits so the tool degrades gracefully.

    commits = []
    for record in raw_log.split('\x1e'):
        record = record.strip()
        if not record:
            continue

tools/commitlist.py:301

  • PullRequestCache assumes the cache file is valid JSON; if it becomes truncated/corrupted, json.loads() will raise and the tool will fail even though it could regenerate the cache. Consider catching JSONDecodeError/OSError here and treating it as an empty cache (optionally warning to stderr).

class PullRequestCache:
    def __init__(self, path: Path):
        self.path = path
        self.path.parent.mkdir(parents=True, exist_ok=True)
        self._data: dict[str, dict[str, object]] = {}
        if self.path.exists():

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread tools/commitlist.py
Comment on lines 15 to +31


"""Generate release-note worksheets from git history and GitHub PR metadata.

By default the script walks commits in
`merge-base(base_ref, head_ref)..head_ref`, extracts PR numbers from commit
titles such as `... (#12345)`, optionally enriches them with GitHub GraphQL
metadata, and writes:

- `commitlist.csv`
- `contributors.txt`
- `export/<category>/result_<category>.md`
- `export/<category>/result_<category>.csv`

Category and topic prefer the `release notes:` and `topic:` labels. If those
labels are absent, the script falls back to the `PR Category`, `PR Types`, and
`Description` sections in the PR body. `--local-only` skips GitHub lookups and
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