Open
Conversation
Mirrors the style of `poly review delete` — supports direct deletion via branch name argument or interactive checkbox selection for bulk deletion. Includes JSON output mode and full error handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
`get_branches()` returns `{name: id}` — the existence check was against
`.values()` (IDs) instead of keys (names), so deletion always raised
"does not exist".
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Downgrade `logger.error` to `logger.debug` in `delete_branch` so the full API error body (HTML) is only shown with `--verbose`, matching the pattern from 8e54b2d. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- SDK: use `str(e)` (e.g. "404 Client Error: Not Found for url: ...") instead of `e.response.text` (raw HTML) when response isn't JSON - sync_client: re-raise SourcererAPIError so the CLI can display it - project: simplify delete_branch now that errors propagate via exception Output now matches `poly review` style: Error: API request failed: 404 Client Error: Not Found for url: ... Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Add argcomplete completer for `poly branch delete <TAB>` that lists deletable branch names from the project - Add `questionary.confirm` step before deleting in both direct and interactive modes (skipped in --json mode) - Update tests to mock the new confirmation prompt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
argcomplete calls completers with (prefix, action, parser, parsed_args) but our completer only accepted (prefix, parsed_args) — the mismatch caused a silent crash that fell back to file completion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Fix delete_branch to fetch sequence from branch projection endpoint instead of the /sequence endpoint which 404s on the ADK API - Fix tab completer to use read_project_config (supports parent dir traversal) instead of the raw dataclass constructor which always failed - Fix `poly completion zsh` crash caused by missing verbose attribute on the completion subparser - Suppress option flags from polluting branch name completions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Coverage Report
Changed file coverage
|
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
poly branch delete— an interactive command for deleting branches, following the same UX pattern aspoly review delete.Motivation
Branch deletion was already implemented in the backend (
project.delete_branch()) but not exposed through the CLI.Changes
deletesubcommand topoly branchwith optionalbranch_nameargument--json)mainbranch (cannot be deleted)Test strategy
poly <command>)Checklist
ruff check .andruff format --check .passpytestpasses (431 tests)polyCLI interface (or migration path documented)🤖 Generated with Claude Code