Skip to content

MINOR: Correcting reviewers script for names#22449

Open
apoorvmittal10 wants to merge 1 commit into
apache:trunkfrom
apoorvmittal10:minor-reviewers
Open

MINOR: Correcting reviewers script for names#22449
apoorvmittal10 wants to merge 1 commit into
apache:trunkfrom
apoorvmittal10:minor-reviewers

Conversation

@apoorvmittal10
Copy link
Copy Markdown
Contributor

@apoorvmittal10 apoorvmittal10 commented Jun 2, 2026

The reviewers.py script incorrectly parses reviewer names that start
with characters appearing in "Author:" or "Reviewers:", leading to
truncated names.

Issue

stripped = line.strip().lstrip("Reviewers: ").lstrip("Author: ")

The Problem: lstrip(string) does not remove a prefix string. Instead, it
removes any characters from that character set from the left side of the
string.

Fix

Replace the buggy lstrip() calls with proper prefix removal. Two options
available:

Option 1: Using removeprefix() (Python 3.9+)

stripped = line.strip().removeprefix("Reviewers:
").removeprefix("Author: ")

Requires Python 3.9+

Option 2: Using startswith() (Python 3.0+)

Used option 2 as the script currently supports Python 3+

Example Issue:
When searching for "Apoorv", the script showed:

@github-actions github-actions Bot added the triage PRs from the community label Jun 2, 2026
@apoorvmittal10 apoorvmittal10 requested a review from chia7712 June 2, 2026 09:36
@github-actions github-actions Bot added tools small Small PRs labels Jun 2, 2026
@apoorvmittal10 apoorvmittal10 removed the triage PRs from the community label Jun 2, 2026
@apoorvmittal10 apoorvmittal10 changed the title Minor: Correcting reviewers script for names MINOR: Correcting reviewers script for names Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant