Skip to content

feat: add gcb issue shorthand - #47

Merged
JounQin merged 5 commits into
mainfrom
feat/issue-shorthand
Oct 30, 2026
Merged

JounQin merged 5 commits into
mainfrom
feat/issue-shorthand

Conversation

@JounQin

@JounQin JounQin commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Adds gcb issue … to the built-in client dispatch, matching the existing gcb pr … and gcb run … catalog shorthands. gcb issue create now reaches issue:create instead of being an unknown command.

corepack yarn check: 347 pass.

Summary by CodeRabbit

  • New Features
    • Added gcb issue <subcommand> as a shorthand for catalogued issue actions when there is a single matching action.
  • Documentation
    • Updated command guidance and examples to include the issue shorthand, including gcb issue create.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: acaf32f0-36f8-4649-8ebf-11b69b1e360c
Commits

Reviewing files that changed from the base of the PR and between 84981bc and 1068251.

Files selected for processing: 2
  • README.md
  • test/unit/gh-command.test.ts
Walkthrough

The client now accepts gcb issue <subcommand> as a shorthand and routes its arguments through runGh with the issue domain. The command list, help text, tests, README, roadmap, and changeset include the shorthand.

Changes: Issue shorthand

Layer / File(s) Summary
Register and route issue shorthand
packages/core/src/index.ts, packages/client/src/index.ts, packages/client/src/commands/gh.ts, test/unit/gh-command.test.ts, README.md, ROADMAP.md, .changeset/issue-shorthand.md
The client command list now includes issue. The client routes its remaining arguments through runGh with the issue domain. Help text, tests, documentation, and patch changeset metadata include the shorthand.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Merge Risk: Minimal · previous review 84981

Issue creation requires title and body flags. No material merge risk is established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: add gcb issue shorthand" matches the main change. The PR adds gcb issue <subcommand> as a shorthand, routes it through the client backend using CLIENT_COMMANDS from gcb-core, an…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat: add gcb issue shorthand" matches the main change. The PR adds gcb issue &lt;subcommand&gt; as a shorthand, routes it through the client backend using CLIENT_COMMANDS from gcb-core, and adds tests and docs for issue create. The title is short, specific, and states the primary change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@i1stG i1stG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocker: gcb issue does not dispatch — the help advertises a command the client refuses

packages/client/src/index.ts:90 still lists the old six commands:

commands: ['setup', 'probe', 'logs', 'pr', 'run', 'gh'],

CLIENT_COMMANDS (packages/core/src/index.ts:23) now has issue, and run() has a case for it, but runCli gates dispatch on backend.commands (packages/core/src/index.ts:102), so the installed client never reaches that case. On 524f2cf, after corepack yarn build:

$ node packages/client/bin/gcb.js issue create --help
gcb: unknown command `issue`.

gcb-client — container-side git credential helper and broker client.
...
  issue      Run an issue action: create
exit=1

$ node packages/client/bin/gcb.js help issue
gcb: unknown command `issue`.        (exit 1)

One run prints both the new help line and the refusal, so the client now advertises a command it rejects — worse than before this PR, where the help at least did not mention it. The host side is consistent: gcb issue from gcb-host correctly says `issue` is a client command; install gcb-client on the client.

This is the same drift #44 fixed on the other side of the boundary: packages/host/src/index.ts:61 uses HOST_COMMANDS. The client literal should be commands: CLIENT_COMMANDS too, so the two lists cannot disagree again.

Requested: cover the shorthand with the test that already exists for the other two

test/unit/gh-command.test.ts — "routes pr subcommands and run through the gh action" (~line 232) — dispatches pr view, pr close and run list through the real client bin and asserts the actions the broker saw. It needs one more case:

const issue = await runClient([
  'issue', 'create', '--repo', 'acme/widget', '--title', 't', '--body', 'b', '--socket', socketPath,
]);
assert.equal(issue.status, 0);
// ...
assert.deepEqual(actions, ['pr:view', 'pr:close', 'run:list', 'issue:create']);

That fails on this head with unknown command, which is the point: the 347 green tests said nothing about the new command because nothing ever ran it.

Also

  • Changeset — a user-visible client command with no .changeset/issue-shorthand.md. The feature it builds on carried one (config-check.md from #44); without it this lands with no release note.
  • The wired shorthands are enumerated in two more places that would go stale: README.md:131 ("gcb pr <subcommand> and gcb run <subcommand> are shorthands…") and the gh help it mirrors, packages/client/src/commands/gh.ts:51. Suggest naming gcb issue <subcommand> there and adding gcb issue create to the example list nearby. ROADMAP.md:208 lists the same set and is worth the same touch while you are in there.

What is already right

The catalog stays the one source: cataloguedSubcommands('issue') renders create, and the dispatch adds no second list. The new case matches run exactly, and runGh(['issue', ...]) needs no extra option — unlike pr, issue has no flag-only lifecycle path, so no unreachableExitCode. CLIENT_COMMANDS is updated, which is what makes the host-side "install gcb-client" message correct. Fix the dispatch list, add the one test line, and this is good to go.

CI is green on all four jobs (Linux, macOS, Windows refusal, WSL) and corepack yarn check is 347/347 here — the gap is coverage, not a flake.

Reference CLIENT_COMMANDS instead of a second literal, cover issue create in the shorthand test, and document/changeset the command.
@JounQin

JounQin commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

@i1stG Fixed in e1c618a: clientBackend.commands now references CLIENT_COMMANDS, the shorthand test covers issue create and asserts issue:create, and the README/gh help/ROADMAP/changeset are updated. gcb issue create --help now reaches the catalog; corepack yarn check: 347 pass.

@i1stG i1stG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on e1c618a

The blocker is fixed the right way. packages/client/src/index.ts:90 is now commands: CLIENT_COMMANDS, so the client list and the dispatch list cannot disagree — matching what packages/host/src/index.ts:61 already does with HOST_COMMANDS. From a build of this head:

$ gcb issue --help                      → exit 0, gh help incl. `issue create`
$ gcb help issue                        → exit 0
$ gcb issue create --repo a/b …         → reaches the socket ("cannot reach the broker … ENOENT")
$ gcb issue bogus                       → exit 1, `unknown gh action "issue:bogus"`  (same as `run bogus`)
$ gcb gh issue bogus                    → exit 1, identical message

The test has teeth. I reverted just the commands: line to the old literal and ran test/unit/gh-command.test.ts: "routes pr subcommands and run through the gh action" fails (21 pass / 1 fail), with the fix restored 347/347. That is the check that was missing, and it now covers the shorthand for all three domains.

Also confirmed: .changeset/issue-shorthand.md uses gcb-client: patch, consistent with gcb-host: patch from #44 for a new command; the three places that enumerate the wired shorthands — README.md:131, GH_USAGE in packages/client/src/commands/gh.ts:51, ROADMAP.md:208 — all name issue now; required-flag validation for issue create behaves exactly as the other actions do (broker-side, unchanged).

corepack yarn check 347/347 locally, CI green on Linux, macOS, Windows refusal and WSL.

One non-blocking nit

ROADMAP.md:208 is now 123 characters where the rest of that list stays under 100 — wrapping it like the neighbouring lines would keep the diff-readable, but it is not worth another round.

Approving. Nothing else from the first review is outstanding.

@i1stG i1stG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving 84981bc.

git diff e1c618a 84981bc is ROADMAP.md only (4+/3-) — the code, test, changeset and README are byte-identical to the head I approved, so nothing new needs re-derivation:

  • packages/client/src/index.ts:90 is still commands: CLIENT_COMMANDS; gcb issue --help and gcb help issue both exit 0 from a build of this head.
  • corepack yarn check 347/347 here, CI green on Linux, macOS, Windows refusal and WSL.

The wrap now sits at 94/92/100 characters, inside the range the rest of that list already uses. That was the only outstanding nit, and it is done.

Nothing left from either review round.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1
README.md-133-133: 1

133-133: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Complete the gcb issue create example.

issue:create requires both --title and --body. As written, copying gcb issue create fails validation. Show a complete example, such as gcb issue create --repo owner/name --title "A title" --body "A body". (raw.githubusercontent.com)


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53c1f955-f5f5-4a68-a785-4e533fc9ae2d
Commits

Reviewing files that changed from the base of the PR and between c67103a and 84981bc.

Files selected for processing: 7
  • .changeset/issue-shorthand.md
  • README.md
  • ROADMAP.md
  • packages/client/src/commands/gh.ts
  • packages/client/src/index.ts
  • packages/core/src/index.ts
  • test/unit/gh-command.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@i1stG i1stG left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving 1068251.

git diff 84981bc 1068251 is two cosmetic lines: the README example now spells out the flags (gcb issue create --repo owner/name --title "A title" --body "A body", 97 chars, in line with the surrounding prose) and the dispatch test's title names all three domains it actually covers. Behaviour, dispatch list, changeset and the rest of the docs are unchanged from the head I approved.

Checked at this head:

  • corepack yarn check 347/347, including routes pr, run and issue subcommands through the gh action (its body still asserts issue:create as the fourth action the broker sees).
  • CI green on Linux, macOS, Windows refusal and WSL.
  • README lines 131–135 are 97/94/99/97/83 characters — no long-line outlier introduced.

Nothing outstanding.

@JounQin
JounQin added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 3ecc3d6 Oct 30, 2026
7 checks passed
@JounQin
JounQin deleted the feat/issue-shorthand branch October 30, 2026 13:25
@github-actions github-actions Bot mentioned this pull request Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants