Skip to content

chore: add scripts/next_pr_number.py to predict a changelog entry's PR number - #5968

Merged
BradyPlanden merged 1 commit into
mainfrom
chore/next-pr-number
Oct 22, 2026
Merged

BradyPlanden merged 1 commit into
mainfrom
chore/next-pr-number

Conversation

@BradyPlanden

@BradyPlanden BradyPlanden commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

A changelog entry ends with its PR's link, but a PR has no number until it is opened. scripts/next_pr_number.py prints a prediction so the entry can be written first.

next_pr_number.py
  query the newest issue, PR, and discussion in pybamm-team/PyBaMM   # they share one number sequence
  print max + 1

The prediction loses a race if someone opens an issue, PR, or discussion first. That is rare, so the script does not try to detect or repair it: no --check/--fix, no fork or open-PR lookup. AGENTS.md and CONTRIBUTING.md say to fix the entry by hand when it happens.

It runs with uv run --no-project, because a plain uv run syncs the workspace and builds pybammsolvers. It needs only the standard library and a logged-in gh.

The query is from ichard26/next-pr-number (MIT), written by Jakub Kuczys.

No CHANGELOG entry: this is internal tooling.

@BradyPlanden
BradyPlanden marked this pull request as ready for review October 22, 2026 12:20
@BradyPlanden
BradyPlanden requested a review from a team as a code owner October 22, 2026 12:20
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (1495fe3) to head (bb2fcf8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5968   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files         348      348           
  Lines       35761    35761           
=======================================
+ Hits        35130    35131    +1     
+ Misses        631      630    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BradyPlanden
BradyPlanden merged commit 9081e68 into main Oct 22, 2026
38 of 39 checks passed
@BradyPlanden
BradyPlanden deleted the chore/next-pr-number branch October 22, 2026 15:49
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