Files
Python/scripts
priya-sundaram-dev 6372acb164 fix(ci): persist Hacktoberfest tracker via a PR (protected-branch push was silently failing) (#15231)
* fix(ci): open a PR to persist Hacktoberfest tracker instead of pushing to protected master

* ci: use bundled gh CLI instead of peter-evans/create-pull-request

Per @cclauss / zizmor 'superfluous actions' audit, persist the rolling
tracker PR with the gh CLI rather than a third-party action.

* fix(ci): make tracker refresh degrade gracefully when rate limited

The dry run was failing because a run can exhaust the GITHUB_TOKEN's
1000/hour-per-repo budget (shared across concurrent runs) — chiefly the
awaiting-reviews directory scan. A single exhausted request then raised
and killed the whole job.

- _request now honours Retry-After (secondary limits) and, once retries
  are exhausted, raises BestEffortError instead of a bare RuntimeError.
- Row resolution, the directory scan, and the search counts catch
  BestEffortError and degrade (keep the row / mark the stat unavailable)
  instead of failing. Only the post-Oct-1 retirement exits non-zero.
- Trim the directory scan to 120 PRs and CONCURRENCY to 5 to stay well
  under the shared budget in the first place.
2026-09-09 07:13:11 +02:00
..

Dealing with the onslaught of Hacktoberfest

Each year, October brings a swarm of new contributors participating in Hacktoberfest. This event has its pros and cons, but it presents a monumental workload for the few active maintainers of this repo. The maintainer workload is further impacted by a new version of CPython being released in the first week of each October.

To help make our algorithms more valuable to visitors, our CONTRIBUTING.md file outlines several strict requirements, such as tests, type hints, descriptive names, functions, and/or classes. Maintainers reviewing pull requests should try to encourage improvements to meet these goals, but when the workload becomes overwhelming (esp. in October), pull requests that do not meet these goals should be closed.

Below are a few gh scripts that should close pull requests that do not match the definition of an acceptable algorithm as defined in CONTRIBUTING.md. I tend to run these scripts in the following order.

  • close_pull_requests_with_require_descriptive_names.sh
  • close_pull_requests_with_require_tests.sh
  • close_pull_requests_with_require_type_hints.sh
  • close_pull_requests_with_failing_tests.sh
  • close_pull_requests_with_awaiting_changes.sh
  • find_git_conflicts.sh

Run on 14 Oct 2025: 107 of 541 (19.77%) pull requests closed.

Script run Open pull requests Pull requests closed
None 541 0
require_descriptive_names 515 26
require_tests 498 17
require_type_hints 496 2
failing_tests 438 58
awaiting_changes 434 4
git_conflicts [ broken ] 0