fix(releasekit): fix git push argument order for --set-upstream#4667
fix(releasekit): fix git push argument order for --set-upstream#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
dc799e9 to
a25560c
Compare
CI runners may have 'master' as the default branch. Explicitly set '-b main' in both bare and work repos to ensure consistent behavior.
a25560c to
d60e94a
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.Fix
Changed
git.py:push()from:to:
The branch name is resolved via
git branch --show-current.Testing
All 1301 releasekit tests pass (83% coverage).