Skip to content

Expand reusable GitHub Bash helpers #119

Description

@codeforester

Problem

Base still owns generic GitHub/Git helper behavior in cli/bash/commands/basectl/subcommands/gh.sh and cli/bash/commands/basectl/subcommands/repo.sh that is reusable outside Base:

  • GitHub repository inference from origin remotes.
  • Default branch discovery.
  • Basic gh api/command diagnostics and bounded retry behavior for transient API pressure.
  • Worktree/branch parsing primitives that are not tied to Base issue categories or Project policy.

base-bash-libs already has lib/bash/gh/lib_gh.sh, but it currently covers only thin gh availability, auth diagnostics, failure reporting, and command execution.

Scope

  • Extend base-bash-libs gh/lib_gh.sh with small generic primitives proven by the remaining Base call sites.
  • Keep Base-specific concepts out of the shared library: issue categories, Project metadata, branch naming policy, repo baselines, generated PR bodies, and worktree naming conventions.
  • Add BATS coverage with fake git/gh commands where useful.
  • Document the expanded reusable surface in lib/bash/gh/README.md.

Acceptance Criteria

  • New helper names and contracts are documented.
  • Tests cover success and failure cases for the extracted helpers.
  • The shared library remains dependency-free apart from the stdlib guard.
  • A follow-up Base issue can consume the helpers without changing Base workflow semantics.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions