Skip to content

Comments

Add bot-bump-kernel-version-to-sglang workflow#12794

Merged
Kangyan-Zhou merged 4 commits intomainfrom
bot/add-kernel-version-to-sglang-workflow
Nov 6, 2025
Merged

Add bot-bump-kernel-version-to-sglang workflow#12794
Kangyan-Zhou merged 4 commits intomainfrom
bot/add-kernel-version-to-sglang-workflow

Conversation

@alisonshao
Copy link
Collaborator

@alisonshao alisonshao commented Nov 6, 2025

This workflow automatically syncs sgl-kernel version from sgl-kernel/pyproject.toml to SGLang files:

  • python/pyproject.toml
  • python/sglang/srt/entrypoints/engine.py
  • docker/Dockerfile

The workflow runs daily and can be manually triggered. It detects version mismatches and creates PRs to sync them.

Summary

This PR adds a new automated workflow bot-bump-kernel-version-to-sglang that syncs the sgl-kernel version from sgl-kernel/pyproject.toml to SGLang files.

Changes

  • New workflow: .github/workflows/bot-bump-kernel-version-to-sglang.yml
  • Scripts:
    • check_kernel_version_to_sglang.py - Checks version consistency
    • bump_kernel_version_to_sglang.py - Updates version in SGLang files
    • commit_and_pr_kernel_to_sglang.sh - Creates PR with changes

Workflow Behavior

The workflow:

  1. Reads kernel version from sgl-kernel/pyproject.toml (line 11)
  2. Checks if it matches versions in:
    • python/pyproject.toml (dependency)
    • python/sglang/srt/entrypoints/engine.py (version check)
    • docker/Dockerfile (build arg)
  3. If mismatched, creates a PR to sync all files

Triggers

  • Manual: Can be triggered via GitHub Actions UI

Test Plan

  • Verify workflow runs successfully
  • Test version detection logic
  • Confirm PR creation works correctly

This workflow automatically syncs sgl-kernel version from sgl-kernel/pyproject.toml
to SGLang files:
- python/pyproject.toml
- python/sglang/srt/entrypoints/engine.py
- docker/Dockerfile

The workflow runs daily and can be manually triggered. It detects version
mismatches and creates PRs to sync them.
@github-actions github-actions bot added documentation Improvements or additions to documentation and removed run-ci labels Nov 6, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @alisonshao, 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 implements a new automated workflow designed to maintain strict version consistency for the sgl-kernel component across the SGLang project. By automatically detecting discrepancies and generating pull requests to synchronize versions in key files, this change significantly reduces the risk of version-related issues and streamlines the release process, ensuring all components reference the correct kernel version.

Highlights

  • Automated Version Synchronization Workflow: Introduces a new GitHub Actions workflow (bot-bump-kernel-version-to-sglang) designed to automatically synchronize the sgl-kernel version across various SGLang project files.
  • Version Source and Targets: The workflow reads the canonical sgl-kernel version from sgl-kernel/pyproject.toml and ensures it is consistently applied to python/pyproject.toml (dependency), python/sglang/srt/entrypoints/engine.py (version check), and docker/Dockerfile (build argument).
  • Trigger Mechanisms: The synchronization workflow is configured to run daily on a scheduled basis and can also be manually triggered via the GitHub Actions UI for immediate execution.
  • Automated Pull Request Creation: If a version mismatch is detected, the workflow automatically creates a new branch, applies the necessary version updates to the affected files, and opens a pull request to integrate these changes.
  • New Helper Scripts: Adds three new Python and Bash scripts: check_kernel_version_to_sglang.py for identifying version inconsistencies, bump_kernel_version_to_sglang.py for performing the actual version updates, and commit_and_pr_kernel_to_sglang.sh for committing changes and creating pull requests.
  • Comprehensive Documentation: Includes a new README_KERNEL_TO_SGLANG.md file that provides detailed documentation on the workflow's purpose, triggers, operational steps, and associated scripts.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/bot-bump-kernel-version-to-sglang.yml
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.

Copy link
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 new GitHub workflow to automatically synchronize the sgl-kernel version across various files in the repository. The changes include new Python scripts for checking and bumping the version, a shell script for automating commits and pull requests, and documentation for the new workflow. The implementation is solid, and my feedback focuses on improving the robustness and maintainability of the new scripts.


### What it does

1. Reads the kernel version from `sgl-kernel/pyproject.toml` (line 11)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The hardcoded line number (line 11) is brittle and may become outdated if sgl-kernel/pyproject.toml is modified. It's better to describe the location of the version more generally to avoid future confusion. For example, you could refer to the project.version field under the [project] table.

Suggested change
1. Reads the kernel version from `sgl-kernel/pyproject.toml` (line 11)
1. Reads the kernel version from the `project.version` field in `sgl-kernel/pyproject.toml`

Comment on lines +20 to +36
def get_kernel_version_from_source() -> str:
"""Extract version from sgl-kernel/pyproject.toml"""
pyproject_path = Path("sgl-kernel/pyproject.toml")

if not pyproject_path.exists():
print(f"Error: {pyproject_path} not found")
sys.exit(1)

with open(pyproject_path, "rb") as f:
data = tomllib.load(f)

version = data.get("project", {}).get("version")
if not version:
print("Error: Could not find version in sgl-kernel/pyproject.toml")
sys.exit(1)

return version
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This function get_kernel_version_from_source is identical to the one in scripts/release/check_kernel_version_to_sglang.py. There's also other duplicated logic between these two files, such as hardcoded file paths and the file reading/error handling pattern. To improve maintainability and reduce redundancy, consider refactoring the shared logic into a common utility module (e.g., version_utils.py). This would centralize the logic and make future updates easier.

@@ -0,0 +1,81 @@
#!/bin/bash
set -e
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better script robustness, it's a good practice to use set -euo pipefail.

  • e: exits immediately if a command exits with a non-zero status. (Already present)
  • u: treats unset variables as an error and exits immediately.
  • o pipefail: causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero status.

This helps catch common errors and makes the script more reliable.

Suggested change
set -e
set -euo pipefail

- Change workflow to manual trigger only (remove daily schedule)
- Remove README_KERNEL_TO_SGLANG.md
@Kangyan-Zhou
Copy link
Collaborator

@Kangyan-Zhou Kangyan-Zhou merged commit fb314d7 into main Nov 6, 2025
24 of 26 checks passed
@Kangyan-Zhou Kangyan-Zhou deleted the bot/add-kernel-version-to-sglang-workflow branch November 6, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants