Commit 01e68a3
feat(cli): add comprehensive GitHub PR workflow commands (#305)
* feat(cli): add comprehensive GitHub PR workflow commands
Add `codeframe pr` command group for GitHub Pull Request management:
- `pr create`: Create PRs with auto-generated descriptions from commits
- `pr list`: List PRs with status filtering and JSON output
- `pr get`: Get detailed PR information
- `pr merge`: Merge PRs with squash/merge/rebase strategies
- `pr close`: Close PRs without merging
- `pr status`: Show PR status for current branch
Implementation follows v2 CLI patterns (headless, no server required):
- Uses existing GitHubIntegration async client
- Wraps async calls with asyncio.run() for CLI context
- Full test coverage (23 tests) using TDD approach
- Environment-based configuration (GITHUB_TOKEN, GITHUB_REPO)
Commands registered in both v1 CLI (__init__.py) and v2 CLI (app.py).
Documentation updated in CLI_WIREFRAME.md with examples.
* fix(cli): don't show success message when PR already closed
Address code review feedback: return None instead of True when PR
is already closed to skip the success message, consistent with
merge_pr handling of already-merged PRs.
* ci(workflow): improve opencode-review stability and context passing
Improvements from ralph-claude-code workflow:
- Add git credentials clearing step to prevent auth conflicts
- Pass PR context (title, body, number, repo) as environment variables
- Include PR title directly in prompt to avoid gh pr view calls
- Add pyproject.toml to paths-ignore to skip config-only changes
- Remove gh pr view/diff instructions (info now passed directly)
Kept existing:
- Concurrency block to prevent duplicate reviews for same PR
- 10-minute timeout
- Substantial changes threshold (5+ files OR 20+ lines)
* test(cli): add PR commands to v2 CLI integration tests
Add TestPRCommands class with 9 tests covering:
- pr help
- pr list (table and JSON formats)
- pr get
- pr create
- pr merge
- pr close
- pr status
- Missing token error handling
Tests use monkeypatch to mock GitHubIntegration, following the
existing pattern for AI integration tests with MockProvider.
All tests are marked v2 via the module-level pytestmark.
---------
Co-authored-by: Test User <test@example.com>1 parent c0a3261 commit 01e68a3
7 files changed
Lines changed: 1456 additions & 32 deletions
File tree
- .github/workflows
- codeframe/cli
- docs
- tests/cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
47 | 73 | | |
48 | 74 | | |
49 | 75 | | |
| |||
53 | 79 | | |
54 | 80 | | |
55 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
56 | 87 | | |
57 | 88 | | |
58 | 89 | | |
59 | 90 | | |
60 | 91 | | |
61 | 92 | | |
62 | | - | |
63 | | - | |
| 93 | + | |
64 | 94 | | |
65 | 95 | | |
66 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| |||
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
| 336 | + | |
335 | 337 | | |
336 | 338 | | |
337 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
4160 | 4161 | | |
4161 | 4162 | | |
4162 | 4163 | | |
| 4164 | + | |
4163 | 4165 | | |
4164 | 4166 | | |
4165 | 4167 | | |
| |||
0 commit comments