Skip to content
This repository was archived by the owner on Jul 15, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

## [Unreleased]

### Added

- `--json` flag to output parsed comments for scripting
- `--list` flag to print the UI list without launching fzf
- `GH_REVIEW_PR_JSON` env var to inject GraphQL JSON (path or raw) for offline workflows
- Filters: `-f/--file`, `--since`, `--until` for file/date-focused workflows

### Changed

- Dynamic dependency checks: only require `gh`/`fzf` when needed
- UI list is file-first (path • author • date)

## [0.1.0] - 2025-09-01

### Added
Expand All @@ -15,3 +29,18 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- Filters: --author, --all-comments, --include-outdated
- Debug summary via --debug
- Version flag (-v/--version)

## [0.1.1] - 2025-09-01

### Changed

- Safer temp dir via `mktemp -d` and consistent cleanup
- Stricter arg parsing: unknown flags now error out
- Author normalization now strips leading `@`; `copilot` maps to GitHub reviewer bot
- New `-R/--repo` to target a specific repository
- PATH includes `$HOME/.local/bin` and `$HOME/bin` for Linux setups
- More helpful message when no unresolved comments are found

### Removed

- Unused `chmod` and `bat` dependencies
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@ gh extension install kud/gh-review-pull-request
```
gh review-pull-request # infer repo and current PR
gh review-pull-request <number> # browse specific PR number
gh review-pull-request -R owner/repo # target a specific repository
```

Options:

- -a, --author Filter by author (can be repeated)
- -f, --file <path/regex> Filter by file path (repeatable)
- --since <YYYY-MM-DD> Filter comments created on/after date
- --until <YYYY-MM-DD> Filter comments created on/before date
- --all, --all-comments Show all comments in threads (not just latest)
- --include-outdated Include outdated comment threads
- --json Print parsed comments as JSON and exit
- --list Print UI list output and exit
- --debug Write a small debug summary file
- -R, --repo <owner/repo> Target a specific repository
- -h, --help Show help
- -v, --version Show version

Expand All @@ -44,10 +51,34 @@ Keybindings inside fzf:
- gh, jq, fzf
- awk, sed, base64, wc, tr, nl, cat, cut, rev
- Optional: glow or mdcat for nicer markdown rendering
- Clipboard: pbcopy (macOS) or xclip/xsel (Linux) for copy action

## 🧪 Testing locally

You can bypass live GitHub calls by providing a GraphQL result via the `GH_REVIEW_PR_JSON` env variable. This can be either a path to a file or the JSON string itself.

Example with your own GraphQL response file:

```
GH_REVIEW_PR_JSON=/path/to/your_graphql.json \
./gh-review-pull-request 123 -R owner/repo --json
```

The above prints the parsed comments as JSON (use `--list` to print the UI list instead).

## 🔎 Filtering tips

- File-first list: the UI list now starts with the file path for quick scanning.
- Filter by file: `-f src/app.py` can be repeated. Values are treated as regex by jq’s `test(...)`, so you can use patterns like `-f '^src/.*\.py$'`.
- Filter by date: `--since 2024-01-01`, `--until 2024-01-31` (inclusive, UTC based on `createdAt`).
- Combine filters: `-f src -a @alice --since 2024-01-01 --include-outdated`.

## 📝 Notes

- By default, only the latest non-outdated comment of each unresolved thread is shown. Use `--all` to see every comment, and `--include-outdated` to include outdated threads.
- `--author` accepts either `user` or `@user`. `copilot` is normalized to `copilot-pull-request-reviewer`.
- If no unresolved comments are found, try `--all` or `--include-outdated`.
- On Linux, ensure `$HOME/.local/bin` is in your `PATH` so `fzf`/`jq` can be found.

## 🏷️ Versioning & Releases

Expand Down
Loading