Skip to content

fix(ci): fix reelasekit-uv.yml force release pr creation#4710

Merged
yesudeep merged 1 commit intomainfrom
yesudeep/fix/past-oatmeal
Feb 17, 2026
Merged

fix(ci): fix reelasekit-uv.yml force release pr creation#4710
yesudeep merged 1 commit intomainfrom
yesudeep/fix/past-oatmeal

Conversation

@yesudeep
Copy link
Contributor

@yesudeep yesudeep commented Feb 17, 2026

Summary

Fixes the CI failure in releasekit-uv.yml where the releasekit prepare command fails with a non-fast-forward push error when the release branch already exists from a previous run.

Root Cause

prepare_release() recreates the release branch from scratch on each run (git checkout -B resets to HEAD). When the remote already has the branch from a previous run, git push rejects it as non-fast-forward.

Changes

Core Fix

  • prepare.py — Use vcs.push(force=True) when pushing the release branch, since it's always recreated from scratch.

VCS Backend: force parameter for push()

  • vcs/__init__.py — Added force: bool = False to the VCS protocol's push() method.
  • git.py — Implements force using --force-with-lease (safer than --force; fails if remote has unexpected changes).
  • mercurial.py — Added force parameter for protocol compatibility.

Error Handling Improvements

  • cli.py_cmd_prepare now catches RuntimeError and Exception from prepare_release(), logging structured prepare_error events instead of raw tracebacks.
  • action.yml — Prints last 50 lines of output on failure outside the ::group:: block for immediate visibility in GitHub Actions UI.

Setup Script Improvements

  • setup.sh — Simplified grep | sed pipeline into a single sed command for model name extraction. Replaced O(M×N) grep-in-loop with O(M+N) associative array for checking already-pulled Ollama models.

Test Fixes (type checker compliance)

  • Added force: bool = False to all FakeVCS.push() overrides in test files to match the updated VCS protocol:
    • tests/_fakes/_vcs.py
    • tests/rk_commitback_test.py (2 overrides)
    • tests/rk_tags_test.py
    • tests/rk_prepare_test.py

Testing

  • bin/lint passes (exit code 0)
  • ruff check and ruff format --check pass on all modified files
  • ty check and pyrefly check pass with zero errors

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yesudeep, 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 refines the CI/CD pipeline and local development environment by enhancing diagnostic output for releasekit failures in GitHub Actions and streamlining the setup process for Ollama conformance tests. It also introduces a safer force-push mechanism within the releasekit tool to manage release branches more effectively and adds robust error handling to the prepare command, contributing to more reliable and maintainable workflows.

Highlights

  • CI/CD Diagnostics: Enhanced GitHub Actions workflow to provide the last 50 lines of output for failed releasekit commands, significantly improving debugging capabilities.
  • Ollama Conformance Test Setup: Automated the setup for Ollama conformance tests by adding logic to ensure the Ollama service is running and to pull all necessary models defined in model-conformance.yaml.
  • Releasekit Force Push Capability: Introduced a force parameter to the vcs.push method in releasekit, implementing a safe force-push using --force-with-lease for Git, which is crucial for handling recreated release branches.
  • Releasekit Error Handling: Improved error handling for the releasekit prepare command, catching and logging RuntimeError and general Exception types for better failure reporting.

🧠 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
  • .github/actions/run-releasekit/action.yml
    • Added diagnostic output for failed releasekit commands.
  • py/tests/conform/setup.sh
    • Implemented functions to check Ollama service reachability.
    • Added logic to ensure the Ollama service is running, falling back to ollama serve if system services fail.
    • Included functionality to pull all Ollama models specified in model-conformance.yaml.
  • py/tools/releasekit/src/releasekit/backends/vcs/init.py
    • Added a force parameter to the push method signature.
  • py/tools/releasekit/src/releasekit/backends/vcs/git.py
    • Implemented the force push logic using --force-with-lease.
    • Updated logging for the push command to include the force parameter.
  • py/tools/releasekit/src/releasekit/backends/vcs/mercurial.py
    • Added a force parameter to the push method, noting its different semantics for Mercurial.
    • Updated logging for the push command to include the force parameter.
  • py/tools/releasekit/src/releasekit/cli.py
    • Wrapped the prepare_release call in a try-except block to catch and log RuntimeError and general exceptions.
  • py/tools/releasekit/src/releasekit/prepare.py
    • Modified the push call to explicitly use force=True when pushing release branches.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/releasekit-uv.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.

@yesudeep yesudeep force-pushed the yesudeep/fix/past-oatmeal branch from 3d8bcd3 to 6cca65e Compare February 17, 2026 09:34
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 several fixes and improvements. It enhances error logging in a GitHub Action for better diagnostics. It adds setup logic for Ollama in the conformance tests, including ensuring the service is running and pulling required models. It also adds support for force-pushing release branches in releasekit, which is necessary for the prepare workflow, and improves error handling in the releasekit CLI. My review focuses on the new shell script logic in py/tests/conform/setup.sh, where I've suggested a couple of improvements for conciseness and performance.

I am having trouble creating individual review comments. Click here to see my feedback.

py/tests/conform/setup.sh (444-446)

medium

This command chain using grep piped to sed can be simplified into a single, more efficient sed command. This avoids creating an extra process and pipe.

    models=$(sed -nE 's~^- model: ollama/([^[:space:]]+)[[:space:]]*$~\1~p' "$spec_file")

py/tests/conform/setup.sh (462)

medium

Executing grep inside a while loop can lead to poor performance if the number of models in model-conformance.yaml or the number of already pulled models grows. A more scalable approach would be to process the list of pulled models once before the loop. For example, you could load the pulled models into a bash associative array for O(1) lookups, or use grep -f with a pattern file. This would improve the check's time complexity from O(M*N) to roughly O(M+N).

@yesudeep yesudeep changed the title yesudeep/fix/past oatmeal fix(ci): fix reelasekit-uv.yml force release pr creation Feb 17, 2026
@yesudeep yesudeep force-pushed the yesudeep/fix/past-oatmeal branch from 6cca65e to d1fbc81 Compare February 17, 2026 09:40
@yesudeep yesudeep force-pushed the yesudeep/fix/past-oatmeal branch from d1fbc81 to 7431e78 Compare February 17, 2026 09:48
@yesudeep
Copy link
Contributor Author

/gemini review

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 several valuable enhancements to the CI/CD pipeline and local development environment. The addition of detailed diagnostic output for releasekit failures in GitHub Actions significantly improves debugging capabilities. The setup.sh script for Ollama conformance tests benefits from a more efficient model extraction and lookup mechanism, which is a good performance improvement. The introduction of a force parameter to the vcs.push method, specifically using --force-with-lease for Git, addresses a critical need for handling recreated release branches safely. Furthermore, the improved error handling in the releasekit prepare command enhances the reliability and maintainability of workflows by catching and logging various exception types.

@yesudeep yesudeep enabled auto-merge (squash) February 17, 2026 09:52
@yesudeep yesudeep merged commit 9df395a into main Feb 17, 2026
25 checks passed
@yesudeep yesudeep deleted the yesudeep/fix/past-oatmeal branch February 17, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants