Srabasti opened a new pull request, #65914: URL: https://github.com/apache/airflow/pull/65914
This is a fix to ensure duplicate authors do not show up in Top Rookie PR list. ##### Was generative AI tooling used to co-author this PR? - Yes (please specify the tool below) Sonnet 4.6 Adaptive ## Fix duplicate rookie authors in Top Rookie PR list ### Problem When running the script in `--rookie` mode, the same author can appear multiple times in the Top N list. For example, in the April 2026 run, X appeared at both position 10 and 11: This is unfair to other rookie contributors — a single prolific rookie can dominate the list, crowding out other genuine newcomers. ### Root Cause The final selection in `main()` uses `heapq.nlargest` on scores with no per-author constraint: ```python # Applied to both rookie and non-rookie mode — no author deduplication top_final = heapq.nlargest(top_number, scores.items(), key=lambda x: x[1]) ``` ### Fix In `--rookie` mode, enforce a maximum of **1 PR per author** when selecting the Top N, while leaving the non-rookie path completely unchanged: ### Why this is safe - The `else` branch is identical to the original `heapq.nlargest` - non-rookie mode is completely unchanged - `pr_stat.author` consistently uses `pr_data["author"]["login"]` (GitHub login) throughout the script — no mismatch risk - No new imports required — `set` and `sorted` are Python builtins - Only one line in `main()` is replaced — no other logic is touched ### Impact Each rookie author can appear **at most once** in the Top N list, ensuring the award highlights a broader set of new contributors rather than being dominated by a single active newcomer. I have tested local, works fine before and after fix runs. Local pre-commit checks do not give errors related to this PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
