fix(releasekit): fix git push argument order, boost test coverage to 92%, fix lint errors#4667
fix(releasekit): fix git push argument order, boost test coverage to 92%, fix lint errors#4667
Conversation
The command was 'git push origin --set-upstream' which is invalid. Correct syntax: 'git push --set-upstream origin <branch>'. The --set-upstream flag must come before the remote, and the branch name must be explicitly specified as a refspec.
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 addresses a critical issue in the 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
Activity
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
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a bug in the git push command where the arguments for --set-upstream were in the wrong order. The change correctly reorders the arguments and adds the required branch name. The fix is effective and addresses the problem described. I have one minor suggestion to improve the code's readability by restructuring how the command arguments are assembled.
1. git.py: restructure push() per review feedback; skip --set-upstream for tag-only pushes (--set-upstream + --tags conflict) 2. github.py: add url to list_prs --json fields; use --body-file for create_pr to avoid shell argument size limits 3. github_api.py: add url to list_prs results; extract html_url from create_pr response instead of returning raw JSON 4. prepare.py: fall back to bootstrap_sha when per-package tag doesn't exist (bootstrapping issue on first release) 5. tags.py: make tag push failure fatal (raise RuntimeError) 6. commitback.py: make push failure fatal (raise RuntimeError) All 1301 tests pass (83% coverage).
R1: github.py update_pr — use --body-file to avoid shell arg size limits R2: git.py commit — fix git add -A logic (don't run add -A in dry_run) R3: git.py delete_tag — return remote push failure instead of swallowing R4: gitlab.py create_pr — use temp file for large MR descriptions R5: bitbucket.py list_prs — add missing url field R6: gitlab.py list_prs — add missing url field R7: pnpm.py lock — don't discard check_only when upgrade_package is set All 1301 tests pass (83% coverage).
Replace Path.unlink() with os.unlink() in async functions to avoid blocking pathlib calls flagged by the ASYNC240 linter rule.
20 tests against real git repos (with bare remote): - push --set-upstream on new branch - push --tags (verifies no --set-upstream conflict) - push set_upstream=False - checkout_branch create/switch - current_branch - tag, tag_exists, list_tags, list_tags with pattern - delete_tag local and remote (verifies remote failure propagation) - log with since_tag, paths, max_commits - diff_files since_tag - commit with paths (partial stage), without paths (git add -A), dry_run - is_shallow, default_branch All 1321 tests pass (83% coverage).
45 integration tests exercising real CLI commands on temp repos: - git (20): push, tags, branches, commit, log, diff, delete_tag - uv (7): build, lock, lock --check, version_bump + dry-run variants - pnpm (7): pack, lock, frozen-lockfile, npm version + dry-run variants - gh (11): release create, pr create/update/merge, labels (dry-run) Each test file uses shutil.which() skipif markers so tests warn and skip locally when a tool is missing, but run in CI where all tools are installed. CI workflow (python.yml) updated to install pnpm, node, and gh CLI in the tool-tests job.
ca06542 to
7d61f8c
Compare
09a9c1c to
963069f
Compare
6ab220b to
d29cc74
Compare
83b0b6b to
b80b330
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This is an extensive and high-quality pull request that significantly enhances the releasekit tool. The fix for the git push argument order is crucial, and the boost in test coverage to 92% is impressive. The addition of new backends for Go, Dart, Java/Gradle, and Rust greatly expands the tool's utility. I particularly appreciate the robust error handling improvements, such as using atomic file operations for locking and providing more informative error hints. The new guidelines in GEMINI.md on configurability, fixer scripts, and error reporting are excellent additions that will improve code quality and maintainability. The refactoring to centralize utilities and the careful handling of large command-line arguments using temporary files demonstrate thoughtful engineering. I have a couple of minor suggestions for improving the robustness of the new workspace parsing logic, but overall, this is an outstanding contribution.
50876d2 to
688084a
Compare
6b75c65 to
1e1f7df
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This is a substantial and high-quality pull request that addresses several key areas. The fix for the git push argument order is correct and critical. The significant increase in test coverage to 92% is a fantastic achievement that will improve the long-term stability of the codebase. The introduction of an AST-based fixer script for linting is a great example of automating developer workflows effectively. Furthermore, the extensive additions to documentation and support for multiple new ecosystems are impressive and will greatly benefit the project.
My review has identified a couple of minor regressions. One is related to error handling in the commit-back feature, where a graceful failure has been replaced with one that could crash the process. The other is a change in the dry-run behavior for git add commands, which reduces visibility. I've provided detailed comments and suggestions for these points. Overall, this is an excellent contribution.
1e1f7df to
a77fc9c
Compare
CI runners may have 'master' as the default branch. Explicitly set '-b main' in both bare and work repos to ensure consistent behavior.
a77fc9c to
b204361
Compare
Problem
Run #22008381084 failed with:
The
git push origin --set-upstreamcommand has invalid argument order. Git requires--set-upstreambefore the remote, and the branch name must be explicitly specified as a refspec.Additionally, test coverage was at 83% (below the 90% CI threshold) and several new test files had lint errors (D102, E501, ANN202).
Fixes
1. Git push argument order (
git.py)Changed
git.py:push()from:to:
The branch name is resolved via
git branch --show-current.2. Test coverage: 83% → 92%
Added 200 new tests across 10 modules covering package managers, registries, VCS, and workspace backends:
rk_pm_cargo_test.pyCargoBackendrk_pm_maven_test.pyMavenBackendrk_pm_dart_test.pyDartBackendrk_pm_go_test.pyGoBackendrk_registry_pubdev_test.pyPubDevRegistryrk_registry_maven_central_test.pyMavenCentralRegistryrk_registry_goproxy_test.pyGoProxyCheckrk_registry_crates_io_test.pyCratesIoRegistryrk_vcs_mercurial_test.pyMercurialCLIBackendrk_workspace_maven_test.pyMavenWorkspaceAll 2200 tests pass with 92% coverage.
3. Lint fixes (D102, E501, ANN202)
py/bin/fix_missing_test_docstrings.pyto add 191 missing docstrings (D102) across all new test filesANN001/ANN003/ANN202type annotations in_fake_run_commandruff formaton all new test files (E501 resolved)ruff check --previewreports 0 errors on all new test files4. GEMINI.md guideline: "Fixer Scripts Over Shell Eval"
Added a new guideline to all 3 Python
GEMINI.mdfiles (py/,py/tools/releasekit/,py/samples/web-endpoints-hello/) requiring:astmodule orlibcstruff check --fixbefore writing custom fixersTesting
ruff check --previewreports 0 errors on all new/modified files