Pr recovery
pr_recovery
Shared recovery for an already-existing GitHub pull request.
When gh pr create fails because a PR already exists for the branch,
both :class:~axm_git.tools.pr.GitPRTool and
:class:~axm_git.hooks.create_pr.CreatePRHook recover the existing PR via
gh pr view. This module factors that recovery into a single helper that
returns a result-agnostic structure; each caller adapts it to its own
result type (ToolResult / HookResult).
PRRecovery
dataclass
Normalized result of recovering an existing pull request.
On success error is None and url/number are populated.
On failure error carries the reason and url/number are empty.
Source code in packages/axm-git/src/axm_git/core/pr_recovery.py
ok
property
Whether recovery succeeded.
is_already_exists(stderr)
Return True when stderr signals an existing PR (case-insensitive).
recover_existing_pr(working_dir)
Resolve the existing PR via gh pr view after an 'already exists' error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
working_dir
|
Path
|
Repository working directory. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
PRRecovery
|
class: |
PRRecovery
|
success, or with |