Skip to content

[CI] Add automated monthly PyPI release plan with hotfix support#1554

Open
stmatengss wants to merge 2 commits into
mainfrom
add-hf-to-mooncake-script
Open

[CI] Add automated monthly PyPI release plan with hotfix support#1554
stmatengss wants to merge 2 commits into
mainfrom
add-hf-to-mooncake-script

Conversation

@stmatengss
Copy link
Copy Markdown
Collaborator

Implements a comprehensive release automation system for Mooncake wheel packages:

  • Monthly automated releases (1st of each month, minor version bump)
  • Hotfix support via PEP 440 post versions (e.g., 0.4.0.post1)
  • Release manager CLI tool for version management
  • Complete documentation and quick reference guides

Features:

  • Automated version bumping and git tagging
  • Multi-variant builds (CUDA, Non-CUDA, Python 3.10-3.13)
  • GitHub Release creation with auto-generated notes
  • PyPI publishing for both standard and hotfix releases
  • Backward compatible with existing tag-based releases

Generated with Claude Code via Happy

Description

Type of Change

  • Types
    • Bug fix
    • New feature
      • Transfer Engine
      • Mooncake Store
      • Mooncake EP
      • Integration
      • P2P Store
      • Python Wheel
    • Breaking change
    • CI/CD
    • Documentation update
    • Other

How Has This Been Tested?

Checklist

  • I have performed a self-review of my own code.
  • I have formatted my own code using ./scripts/code_format.sh before submitting.
  • I have updated the documentation.
  • I have added tests to prove my changes are effective.

Implements a comprehensive release automation system for Mooncake wheel packages:

- Monthly automated releases (1st of each month, minor version bump)
- Hotfix support via PEP 440 post versions (e.g., 0.4.0.post1)
- Release manager CLI tool for version management
- Complete documentation and quick reference guides

Features:
- Automated version bumping and git tagging
- Multi-variant builds (CUDA, Non-CUDA, Python 3.10-3.13)
- GitHub Release creation with auto-generated notes
- PyPI publishing for both standard and hotfix releases
- Backward compatible with existing tag-based releases

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @stmatengss, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a robust and automated release system for Mooncake PyPI packages. It introduces scheduled monthly releases with minor version increments and a mechanism for rapid hotfix deployment using PEP 440 post versions. The changes aim to streamline the release process, reduce manual overhead, and ensure consistent, compliant package distribution, complemented by comprehensive tooling and documentation for managing releases effectively.

Highlights

  • Automated Monthly Releases: Introduced a new GitHub Actions workflow (monthly-release.yaml) that automatically runs on the 1st of every month to perform minor version bumps, build multi-variant wheels (CUDA/Non-CUDA, Python 3.10-3.13), create GitHub Releases, and publish to PyPI. It also supports manual triggers with version type selection.
  • Hotfix Release Support: Implemented a dedicated GitHub Actions workflow (hotfix-release.yaml) for manual hotfix releases. This workflow uses PEP 440 post versions (e.g., 0.4.0.post1), creates a hotfix branch, builds all wheel variants, and publishes to PyPI for critical bug fixes between monthly releases.
  • Release Manager CLI Tool: Added a Python utility script (scripts/release_manager.py) for local release management. This tool provides commands for showing the current version, bumping versions (major/minor/patch) with dry-run support, creating post versions, generating changelogs from git commits, and verifying package existence on PyPI.
  • Comprehensive Documentation: Provided extensive documentation including a detailed docs/RELEASE_PLAN.md outlining the release strategy, versioning, PyPI package structure, and checklists, along with a RELEASE_QUICKSTART.md for quick reference on release types and procedures. CLAUDE.md was also updated to reference the new documentation.
  • PEP 440 Compliance and Multi-Variant Builds: Ensured all versioning adheres to PEP 440 standards, including seamless handling of post releases by pip. The system supports building multiple wheel variants for different CUDA versions (default, non-CUDA, CUDA 13) and Python versions (3.10-3.13).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • RELEASE_IMPLEMENTATION_SUMMARY.md
    • Added a new file detailing the implementation of the automated PyPI release plan, including workflows, scripts, and documentation.
  • RELEASE_QUICKSTART.md
    • Added a new file providing a quick reference guide for the monthly and hotfix release processes.
  • docs/RELEASE_PLAN.md
    • Added a new file containing comprehensive documentation for the automated PyPI release strategy, versioning, and procedures.
  • scripts/release_manager.py
    • Added a new Python script that serves as a command-line utility for managing release-related tasks such as version bumping, changelog generation, and PyPI verification.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/hotfix-release.yaml
    • .github/workflows/monthly-release.yaml
Activity
  • The pull request was opened by stmatengss to introduce a new CI/CD pipeline for PyPI releases.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

import sys
from pathlib import Path
from typing import Tuple, Optional
from datetime import datetime
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive automated release system for PyPI packages, including monthly scheduled releases and manual hotfix capabilities. The changes include a Python-based release manager script and extensive documentation covering the new release plan, workflows, and usage instructions.

My review focuses on the robustness of the release script and the soundness of the documented release process. I've identified a couple of areas for improvement in the release_manager.py script to enhance its reliability and remove external dependencies. More importantly, I've raised a concern about the proposed hotfix process in the documentation, which could unintentionally include unrelated changes from the main branch into a hotfix release. Addressing this is crucial for release stability.

Overall, this is a great step towards automating releases, and with a few adjustments to the script and the hotfix strategy, it will be a very solid system.

Comment thread docs/RELEASE_PLAN.md

### Hotfix Release (Manual)
1. Identify critical bug requiring immediate fix
2. Merge fix to main branch
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The hotfix process described here seems to imply that hotfixes are built from the main branch after a fix is merged. This is risky because it would include not just the critical fix, but also any other new features or changes that have been merged to main since the last release. A hotfix should ideally contain only the minimal necessary changes on top of the version being patched.

A safer process would be:

  1. Create a hotfix branch from the tag of the version that needs patching (e.g., git checkout -b hotfix/0.4.0 v0.4.0).
  2. Apply (or cherry-pick) the fix to this hotfix branch.
  3. Run the hotfix release workflow on this branch to create and publish the .post release.
  4. Ensure the fix is also merged into main to be included in the next regular release.

The current documentation could lead to confusion and accidental release of unfinished features in a hotfix. Please clarify the process and ensure the workflow implements the safer approach.

Comment on lines +173 to +182
def verify_pypi_package(self, package_name: str, version: str) -> bool:
"""Verify if a package version exists on PyPI."""
try:
import requests
url = f"https://pypi.org/pypi/{package_name}/{version}/json"
response = requests.get(url, timeout=10)
return response.status_code == 200
except Exception as e:
print(f"Warning: Could not verify PyPI package: {e}")
return False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This function uses the requests library, which is a third-party dependency. To keep this script self-contained and avoid requiring users to install extra packages, it's better to use the standard library's urllib module for this simple HTTP GET request. This change removes the need for requests.

    def verify_pypi_package(self, package_name: str, version: str) -> bool:
        """Verify if a package version exists on PyPI."""
        import urllib.request
        import urllib.error
        try:
            url = f"https://pypi.org/pypi/{package_name}/{version}/json"
            with urllib.request.urlopen(url, timeout=10) as response:
                return response.status == 200
        except urllib.error.HTTPError as e:
            if e.code == 404:
                return False
            print(f"Warning: Could not verify PyPI package: {e}")
            return False
        except Exception as e:
            print(f"Warning: Could not verify PyPI package: {e}")
            return False

Comment on lines +33 to +37
content = self.pyproject_path.read_text()
match = re.search(r'version = "([^"]+)"', content)
if not match:
raise ValueError("Could not find version in pyproject.toml")
return match.group(1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using regular expressions to parse pyproject.toml is brittle and can fail if the formatting changes (e.g., extra spaces, comments). A more robust approach is to use a TOML parsing library. Since this project supports Python < 3.11, you could add tomli as a development dependency to read the file. For writing, to preserve formatting and comments, a library like tomlkit is recommended. This would make both get_current_version and update_version_file more reliable.

Comment thread RELEASE_IMPLEMENTATION_SUMMARY.md Outdated
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.

These files are likely auto-generated by Claude. Check whether it is necessary to include.

@stmatengss
Copy link
Copy Markdown
Collaborator Author

@copilot delete RELEASE_IMPLEMENTATION_SUMMARY.md

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

@stmatengss I've opened a new pull request, #1588, to work on those changes. Once the pull request is ready, I'll request review from you.

Comment on lines +1 to +18
name: Monthly Release

on:
schedule:
# Run on the 1st of every month at 00:00 UTC
- cron: '0 0 1 * *'
workflow_dispatch:
inputs:
version_type:
description: 'Version type (major, minor, patch)'
required: true
default: 'minor'
type: choice
options:
- major
- minor
- patch

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.

Do we really need this automation release workflow? I think most of the open-source projects make a release when something important is integrated or when the main branch is stable, which is OK to cut a new release. So I think maybe we can have a hotfix release workflow, but the monthly release should be discussed and triggered manually.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

How about adding a document to formalize the monthly release workflow? We can refer to the sglang release plan.

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.

SGLang has a plan for a monthly release, but not fully automated. When the time is near, it makes a release if all CI (including the nightly CI) have passed.

* Initial plan

* Remove RELEASE_IMPLEMENTATION_SUMMARY.md

Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>
@stmatengss stmatengss requested a review from luketong777 as a code owner March 1, 2026 15:41
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment on lines +5 to +6
# Run on the 1st of every month at 00:00 UTC
- cron: '0 0 1 * *'
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.

So I think this release automation should not be enabled until our CI has covered all the features, such as mooncake-ep test, vllm test

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.

Agree

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants