Skip to content

Commit eb60934

Browse files
committed
docs: enhance testing, documentation, and cleanup for v0.2.0 release
Completes issue #10 (Testing & Documentation) and closes epic #3 (Command Structure Expansion). Comprehensive enhancements to test coverage and user documentation. Testing Enhancements: - Enhanced GraphQL library tests: 11 → 33 tests (GraphQL functions, parameter validation, async verification) - Enhanced trigger tests: 6 → 11 tests (trigger function validation) - Added PR review-reply command tests: 5 new tests - Total tests: 87 → 116 (100% pass rate, 180+ assertions) - All GraphQL operations fully tested with signature validation - All trigger types validated with parameter checks Documentation Updates: - README.md: Added 160+ lines documenting 14+ commands * AI Commands: triage, investigate, fix, review, apply * Issue Management: sub-issue, dependency groups * PR Management: review-reply, resolve threads * Backward compatibility guide for deprecated commands * 20+ usage examples for all command groups - Added JSDoc comments to 9 command factory functions - Complete command reference with arguments and options Code Cleanup: - Removed old duplicate file: src/commands/review-reply.ts - Updated all command imports to pr group structure - All tests passing with enhanced parameter validation - TypeScript strict mode compliant Closes: #3, #6, #7, #8, #9, #10
1 parent 59520d6 commit eb60934

14 files changed

Lines changed: 362 additions & 58 deletions

‎README.md‎

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,165 @@ EOF
239239
)"
240240
```
241241

242+
### AI Commands
243+
244+
Trigger PleaseAI automation workflows for code review and issue management.
245+
246+
#### `gh please ai triage <issue-number>`
247+
248+
Trigger PleaseAI to automatically triage an issue (categorize, add labels, etc.).
249+
250+
```bash
251+
gh please ai triage 123
252+
```
253+
254+
#### `gh please ai investigate <issue-number>`
255+
256+
Trigger PleaseAI to investigate a bug or issue in detail.
257+
258+
```bash
259+
gh please ai investigate 123
260+
```
261+
262+
#### `gh please ai fix <issue-number>`
263+
264+
Trigger PleaseAI to attempt an automated fix for an issue.
265+
266+
```bash
267+
gh please ai fix 123
268+
```
269+
270+
#### `gh please ai review <pr-number>`
271+
272+
Trigger PleaseAI to perform code review on a pull request.
273+
274+
```bash
275+
gh please ai review 456
276+
```
277+
278+
#### `gh please ai apply <pr-number>`
279+
280+
Trigger PleaseAI to apply its suggestions to a pull request.
281+
282+
```bash
283+
gh please ai apply 456
284+
```
285+
286+
### Issue Management Commands
287+
288+
Manage GitHub issues with sub-issues and dependencies.
289+
290+
#### `gh please issue sub-issue <subcommand> [options]`
291+
292+
Manage issue sub-issues (hierarchical issue relationships).
293+
294+
**Subcommands:**
295+
296+
- `create <parent-issue> --title "..."` - Create a new sub-issue linked to parent
297+
- `add <parent-issue> <child-issue>` - Link existing issue as sub-issue
298+
- `remove <parent-issue> <child-issue>` - Unlink sub-issue from parent
299+
- `list <parent-issue>` - List all sub-issues of a parent issue
300+
301+
**Examples:**
302+
303+
```bash
304+
# Create a new sub-issue
305+
gh please issue sub-issue create 100 --title "Fix validation logic" --body "Add validation for user input"
306+
307+
# Link existing issues
308+
gh please issue sub-issue add 100 101
309+
gh please issue sub-issue add 100 102
310+
311+
# List all sub-issues
312+
gh please issue sub-issue list 100
313+
314+
# Remove a sub-issue link
315+
gh please issue sub-issue remove 100 101
316+
```
317+
318+
#### `gh please issue dependency <subcommand> [options]`
319+
320+
Manage issue dependencies using "blocked by" relationships.
321+
322+
**Subcommands:**
323+
324+
- `add <issue> --blocked-by <blocker>` - Mark an issue as blocked by another
325+
- `remove <issue> <blocker>` - Remove a blocking dependency
326+
- `list <issue>` - List all issues blocking a given issue
327+
328+
**Examples:**
329+
330+
```bash
331+
# Mark issue as blocked
332+
gh please issue dependency add 200 --blocked-by 199
333+
334+
# View blocking issues
335+
gh please issue dependency list 200
336+
337+
# Remove blocking relationship
338+
gh please issue dependency remove 200 199
339+
```
340+
341+
### PR Management Commands
342+
343+
Manage pull request reviews and threads.
344+
345+
#### `gh please pr review-reply <comment-id> --body "..."`
346+
347+
Create a reply to a PR review comment. Replaces deprecated `gh please review-reply`.
348+
349+
**Arguments:**
350+
- `<comment-id>` - ID of the review comment (found in comment URL)
351+
352+
**Options:**
353+
- `-b, --body <text>` - Reply text (required if not piping)
354+
355+
**Examples:**
356+
357+
```bash
358+
# Direct reply
359+
gh please pr review-reply 1234567890 --body "Fixed in latest commit!"
360+
361+
# Pipe from file
362+
cat reply.txt | gh please pr review-reply 1234567890
363+
364+
# Multiline reply
365+
gh please pr review-reply 1234567890 --body "$(cat <<'EOF'
366+
Looks good, but:
367+
368+
1. Please add error handling
369+
2. Add unit tests for edge cases
370+
371+
Thanks for the fix!
372+
EOF
373+
)"
374+
```
375+
376+
#### `gh please pr resolve <pr-number> [--thread <id> | --all]`
377+
378+
Resolve review threads on a pull request.
379+
380+
**Arguments:**
381+
- `<pr-number>` - Pull request number
382+
383+
**Options:**
384+
- `--thread <id>` - Resolve specific thread
385+
- `--all` - Resolve all unresolved threads
386+
387+
**Examples:**
388+
389+
```bash
390+
# Resolve all threads
391+
gh please pr resolve 456 --all
392+
393+
# Resolve specific thread
394+
gh please pr resolve 456 --thread MDEyOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFk...
395+
```
396+
397+
### Backward Compatibility
398+
399+
The old `gh please review-reply` command still works but shows a deprecation warning. Please migrate to `gh please pr review-reply`.
400+
242401
## API Limitations
243402

244403
### Top-level Comments Only

‎src/commands/ai/apply.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Command } from "commander";
22
import { getRepoInfo } from "../../lib/github-api";
33
import { triggerPleaseAIPr } from "../../lib/please-trigger";
44

5+
/**
6+
* Creates a command to trigger PleaseAI to apply suggestions on a pull request
7+
* @returns Command object configured for applying suggestions
8+
*/
59
export function createApplyCommand(): Command {
610
const command = new Command("apply");
711

‎src/commands/ai/fix.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Command } from "commander";
22
import { getRepoInfo } from "../../lib/github-api";
33
import { triggerPleaseAIIssue } from "../../lib/please-trigger";
44

5+
/**
6+
* Creates a command to trigger PleaseAI fix workflow for an issue
7+
* @returns Command object configured for fix operations
8+
*/
59
export function createFixCommand(): Command {
610
const command = new Command("fix");
711

‎src/commands/ai/investigate.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Command } from "commander";
22
import { getRepoInfo } from "../../lib/github-api";
33
import { triggerPleaseAIIssue } from "../../lib/please-trigger";
44

5+
/**
6+
* Creates a command to trigger PleaseAI investigation for an issue
7+
* @returns Command object configured for investigation operations
8+
*/
59
export function createInvestigateCommand(): Command {
610
const command = new Command("investigate");
711

‎src/commands/ai/review.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Command } from "commander";
22
import { getRepoInfo } from "../../lib/github-api";
33
import { triggerPleaseAIPr } from "../../lib/please-trigger";
44

5+
/**
6+
* Creates a command to trigger PleaseAI code review for a pull request
7+
* @returns Command object configured for code review operations
8+
*/
59
export function createReviewCommand(): Command {
610
const command = new Command("review");
711

‎src/commands/ai/triage.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Command } from "commander";
22
import { getRepoInfo } from "../../lib/github-api";
33
import { triggerPleaseAIIssue } from "../../lib/please-trigger";
44

5+
/**
6+
* Creates a command to trigger PleaseAI triage for an issue
7+
* @returns Command object configured for triage operations
8+
*/
59
export function createTriageCommand(): Command {
610
const command = new Command("triage");
711

‎src/commands/issue/dependency.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import {
77
listBlockedBy,
88
} from "../../lib/github-graphql";
99

10+
/**
11+
* Creates a command to manage issue dependencies (blocked_by relationships)
12+
* @returns Command object with sub-commands (add, remove, list)
13+
*/
1014
export function createDependencyCommand(): Command {
1115
const command = new Command("dependency");
1216

‎src/commands/issue/sub-issue.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import {
77
listSubIssues,
88
} from "../../lib/github-graphql";
99

10+
/**
11+
* Creates a command to manage issue sub-issue relationships
12+
* @returns Command object with sub-commands (create, add, remove, list)
13+
*/
1014
export function createSubIssueCommand(): Command {
1115
const command = new Command("sub-issue");
1216

‎src/commands/pr/resolve.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Command } from "commander";
22
import { getRepoInfo } from "../../lib/github-api";
33
import { getPrNodeId, listReviewThreads, resolveReviewThread } from "../../lib/github-graphql";
44

5+
/**
6+
* Creates a command to resolve review threads on pull requests
7+
* @returns Command object configured for resolving threads
8+
*/
59
export function createResolveCommand(): Command {
610
const command = new Command("resolve");
711

‎src/commands/pr/review-reply.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { Command } from "commander";
22
import { getCurrentPrInfo, createReviewReply } from "../../lib/github-api";
33
import { validateCommentId, validateReplyBody } from "../../lib/validation";
44

5+
/**
6+
* Creates a command to reply to PR review comments
7+
* @returns Command object configured for creating review replies
8+
*/
59
export function createReviewReplyCommand(): Command {
610
const command = new Command("review-reply");
711

0 commit comments

Comments
 (0)