Skip to content

feat: add milestone management workflow#750

Open
hussain-s wants to merge 1 commit into
apache:mainfrom
hussain-s:feat/issue-722-milestone-management-workflow
Open

feat: add milestone management workflow#750
hussain-s wants to merge 1 commit into
apache:mainfrom
hussain-s:feat/issue-722-milestone-management-workflow

Conversation

@hussain-s
Copy link
Copy Markdown

Add milestone management automation for release tracking.

Changes

  • add .github/workflows/milestone-management.yml to auto-assign milestones on merged PRs
  • support merged PRs targeting main and release/test branch patterns
  • add workflow_dispatch support to create or re-open upcoming X.Y.Z milestones
  • document milestone naming and branch mapping in scripts/README.md
  • add scripts/milestone_management_preview.py for local milestone-selection checks
  • add unit coverage for the branch-to-milestone logic in tests/test_milestone_management_preview.py

How I tested this

  • ran .venv311/bin/python -m pytest tests/
  • ran PRE_COMMIT_HOME=.pre-commit-cache .venv311/bin/pre-commit run --all-files
  • ran .venv311/bin/python -m pytest tests/test_milestone_management_preview.py
  • exercised scripts/milestone_management_preview.py manually for main, release branches, and unmanaged branches

Notes

  • milestone titles follow the X.Y.Z convention requested in issue ci: milestone management workflow #722
  • merged PRs to main pick the earliest open X.Y.Z milestone
  • merged PRs to release/test branches use the milestone inferred from the branch name
  • milestone creation is manual through workflow_dispatch; merged-PR assignment is automatic once milestones exist

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@github-actions github-actions Bot added the area/ci Workflows, build, release scripts label May 2, 2026
@hussain-s hussain-s marked this pull request as ready for review May 2, 2026 07:36
Comment on lines +25 to +27

import argparse
import re
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

burr supports py3.9 per pyproject.toml but str | None on line 42 needs 3.10+. import breaks on 3.9 and the test file blows up with it since it loads the module at top level.

Suggested change
import argparse
import re
from __future__ import annotations
import argparse
import re
import sys

Comment on lines +131 to +133
if (!milestone) {
throw new Error(
"No open X.Y.Z milestone found for main. Create one with the workflow_dispatch path first."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fails the workflow run on every merge until a milestone exists. a console.warn + return would skip quietly instead of spamming failed-run notifications.

Suggested change
if (!milestone) {
throw new Error(
"No open X.Y.Z milestone found for main. Create one with the workflow_dispatch path first."
console.warn(`#${pr.number}: no open X.Y.Z milestone for main, skipping assignment.`);
return;


def test_missing_release_branch_milestone_raises_error():
with pytest.raises(ValueError, match="Expected an open milestone named '0.43.1'"):
preview.choose_milestone("release-0.43.1", ["0.43.0"])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the JS in the workflow has the same logic but no tests. preview script mirrors it today, will drift later. worth testing the JS too, or at least a comment in both files saying they must stay in sync.


def test_missing_release_branch_milestone_raises_error():
with pytest.raises(ValueError, match="Expected an open milestone named '0.43.1'"):
preview.choose_milestone("release-0.43.1", ["0.43.0"])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing coverage for release/0.43.1 (slash variant), apache-burr-0.43.1-release, and the release-0.43 minor fallback. regex handles them but nothing exercises that path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Workflows, build, release scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants