fix(ci): fix reelasekit-uv.yml force release pr creation#4710
Conversation
Summary of ChangesHello @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 Highlights
🧠 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
Ignored Files
Using Gemini Code AssistThe 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
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 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
|
3d8bcd3 to
6cca65e
Compare
There was a problem hiding this comment.
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)
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)
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).
6cca65e to
d1fbc81
Compare
d1fbc81 to
7431e78
Compare
|
/gemini review |
There was a problem hiding this comment.
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.
Summary
Fixes the CI failure in
releasekit-uv.ymlwhere thereleasekit preparecommand 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 -Bresets to HEAD). When the remote already has the branch from a previous run,git pushrejects it as non-fast-forward.Changes
Core Fix
prepare.py— Usevcs.push(force=True)when pushing the release branch, since it's always recreated from scratch.VCS Backend:
forceparameter forpush()vcs/__init__.py— Addedforce: bool = Falseto theVCSprotocol'spush()method.git.py— Implementsforceusing--force-with-lease(safer than--force; fails if remote has unexpected changes).mercurial.py— Addedforceparameter for protocol compatibility.Error Handling Improvements
cli.py—_cmd_preparenow catchesRuntimeErrorandExceptionfromprepare_release(), logging structuredprepare_errorevents 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— Simplifiedgrep | sedpipeline into a singlesedcommand 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)
force: bool = Falseto allFakeVCS.push()overrides in test files to match the updatedVCSprotocol:tests/_fakes/_vcs.pytests/rk_commitback_test.py(2 overrides)tests/rk_tags_test.pytests/rk_prepare_test.pyTesting
bin/lintpasses (exit code 0)ruff checkandruff format --checkpass on all modified filesty checkandpyrefly checkpass with zero errors