Skip to content

fix(ci): correct the Hacktoberfest tracker's open-issue count and add a countdown - #15235

Merged
cclauss merged 2 commits into
TheAlgorithms:masterfrom
priya-sundaram-dev:chore/hacktoberfest-stats-fix
Sep 9, 2026
Merged

fix(ci): correct the Hacktoberfest tracker's open-issue count and add a countdown#15235
cclauss merged 2 commits into
TheAlgorithms:masterfrom
priya-sundaram-dev:chore/hacktoberfest-stats-fix

Conversation

@priya-sundaram-dev

Copy link
Copy Markdown
Contributor

@cclauss — this addresses both of your review notes.

Not an algorithm change — this is a CI/tracker fix, so the algorithm-specific checkboxes below don't apply. Marking the ones that do so the keeper doesn't auto-close it again.

The 621 bug

docs/hacktober_2026_prep.md reported Open issues: 621 when the repo has 107. Root cause: GitHub's /search/issues is:issue / is:pr qualifiers are unreliable on a repo this large and high-churn — some runs return the pull-request pool for both queries, which is why "Open issues" and "Open pull requests" printed the same number (621).

I replaced the two search calls with deterministic ones:

  • open PRs — the Link: rel="last" page number of /repos/{repo}/pulls?state=open&per_page=1 (that endpoint still uses page-numbered pagination, so the last page number is the count);
  • open issues — the repo endpoint's open_issues_count (which counts issues and PRs) minus the open-PR total. Self-checking: 728 − 621 = 107. ✅

(The awaiting reviews line still uses search; I paginated it fully and confirmed 458 is the true count, so I left it — happy to harden it the same way if you'd like.)

New Hacktoberfest countdown

Added the three metrics you asked for to ## Automated statistics:

  • Days until Hacktoberfest (2026-10-01)
  • Issues to close per day to clear the backlog
  • Pull requests to merge or close per day to clear the backlog

Per-day numbers round up (finishing a day early beats a day late) and degrade to a plain message once Hacktoberfest starts, so the block never divides by zero on the final day.

Live output (regenerated into the doc)

- **Open issues:** 107
- **Open pull requests:** 621
- **Open PRs labelled `awaiting reviews`:** 458
- **Days until Hacktoberfest (2026-10-01):** 22
- **Issues to close per day to clear the backlog:** 5 per day (over 22 days)
- **Pull requests to merge or close per day to clear the backlog:** 29 per day (over 22 days)

ruff check, ruff format --check, and ty check all pass. Verified the new counters against the live API before committing.

Describe your change:

Fixes the Hacktoberfest prep tracker's Open issues count (was echoing the PR count, now deterministic) and adds the three requested countdown metrics. Touches scripts/hacktoberfest_prep_update.py and the generated docs/hacktober_2026_prep.md.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

The tracker's "Open issues" line was showing the pull-request total (e.g.
621) instead of the issue total (107). GitHub's `/search/issues`
`is:issue` / `is:pr` qualifiers are unreliable on this large, high-churn
repo -- some runs return the PR pool for *both* queries, so the two lines
printed the same number.

Count without the flaky qualifiers instead:
- open PRs = the `Link: rel="last"` page number of `/repos/{repo}/pulls`
  (deterministic, page-numbered pagination);
- open issues = the repo endpoint's `open_issues_count` (issues + PRs)
  minus the open-PR total -- self-checking and stable.

Also add the requested Hacktoberfest countdown to the stats block:
- days until 2026-10-01;
- issues to close per day to clear the backlog;
- PRs to merge or close per day to clear the backlog.

Per-day figures round up (finishing a day early beats a day late) and
degrade to a clear message once Hacktoberfest starts, so the block never
divides by zero on the final day.
@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed documentation This PR modified documentation files labels Sep 9, 2026
@algorithms-keeper algorithms-keeper Bot removed the awaiting reviews This PR is ready to be reviewed label Sep 9, 2026
@cclauss
cclauss merged commit 15c5af0 into TheAlgorithms:master Sep 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation This PR modified documentation files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants