Repository navigation
ci(milestone): set the release milestone on issues and PRs (#2218) - #2219
Merged
Merged
Conversation
Owner
Author
|
Review: GOOD TO GO at
|
JarryShaw
force-pushed
the
ci/2218-milestone-on-close
branch
from
October 26, 2026 00:24
d55eafa to
86dbdad
Compare
Owner
Author
|
Review: GOOD TO GO at
|
Problem: issues and pull requests carried no release milestone unless
one was set by hand.
Fix: milestone.yml runs util/milestone.py on `issues` and
`pull_request_target` `opened`, `reopened` and `closed`, and on
`workflow_dispatch`. An open item, a merged PR or an issue closed as
completed gets the open `PyPCAPKit v<major>.<minor>` milestone from the
base checkout's `__version__`, read as text, but only when it holds no
other milestone; an unmerged PR or a not-planned/duplicate issue loses
whichever it holds. A missing milestone is a warning, never created. A
dispatch backfills open and closed items with no milestone above the
previous release milestone's highest number, dry-run by default, with
updates a second apart and rate-limited requests retried with backoff.
Runs per item queue with `queue: max`. The job checks out `github.sha`
only, without persisted credentials, under `permissions: {}` plus
`contents: read`, `issues: write` and `pull-requests: write` on the job.
Test: tests/project/test_milestone_2218.py covers the rule, precedence
over a hand-set milestone, the title mapping, both modes against a fake
REST endpoint, the throttle and retry against mocked gh responses, and
the workflow's triggers, scopes, concurrency, base-only checkout and
step script.
JarryShaw
force-pushed
the
ci/2218-milestone-on-close
branch
from
October 26, 2026 00:45
86dbdad to
95feb56
Compare
Owner
Author
|
Review: GOOD TO GO at
|
Contributor
|
Coverage: 91.56% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
Ready to merge at
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
ci— CI configurationDescription
Closes #2218. Milestones stopped being set after #1068. The closed items have been backfilled by hand onto
PyPCAPKit v1.5, and this workflow keeps them set from now on.milestone.yml: runs onissuesandpull_request_target(opened,reopened,closed) and onworkflow_dispatch, with its logic inutil/milestone.py. Opening an item sets the milestone, per the owner on ci: set milestones automatically on close #2218.PyPCAPKit v<major>.<minor>. The version is parsed from the base branch'spcapkit/__init__.py, not imported.workflow_dispatchcovers open and closed items above the previous milestone's highest number, above Prevent maintenance workflow push races #336 today. It defaults todry_run: true.github.sha(the base tip) withpersist-credentials: false, fetching only the three files it needs.permissions: {}at the top; the job holds onlycontents: read,issues: writeandpull-requests: write. The item is re-read through the API, and only its number comes from the payload.workflows.rstdocuments the workflow, andprocess.rstnames the real milestone titles.origin/main. With only the script present, they give 11 failed (all workflow and step tests). Against the close-only version, the open, reopen and precedence tests give 16 failed.tests/projectselection gives 733 passed. actionlint is clean.workflows.rst, andgit merge-treemerges each of them with this cleanly.