Summary
- extend
try pr reviewwith--comments,--comments-file, and--commit-id - validate automation-friendly
{path, line, side, body}inline comment input before mutation - map
RIGHTandLEFTlines to the platform API's new/old review positions and submit comments atomically with the review event - extend
try pr review-commentswith nestedresolve COMMENT_IDandunresolve COMMENT_IDactions, without adding anothertry prsubcommand - preserve the existing no-action comment-listing behavior and allow
-Rand--jsonbefore or after nested actions - document both workflows and cover command help and outgoing API payloads
Platform API
No server change is required. The existing pull review endpoint already accepts comments and commit_id, and the existing review-comment resolution endpoint accepts a boolean resolved value. This PR exposes both contracts through first-class CLI commands.
Verification
- 256 Rust unit tests passed
- all 16
trylle_cli_commands_mocktests passed - all 4
root_help_clitests passed cargo fmt --all -- --check
The repository's broader suite still has existing version_update_cli expectations pinned to v1.1.0 while the checkout is v1.1.1; the focused CLI test coverage passes.
Activity
17Will add codex review to this repo
- readme cleanup
--commit-idrequired when inline comment expected
@trylle-bot can you fix Max's comment?
@stylessh re Max's review (#515):
2) --commit-id required when inline comments are submitted — already resolved. src/trylle/mod.rs returns TrylleCliError::InvalidArguments("--commit-id is required when submitting inline comments") whenever review_comments_body(...) yields Some and commit_id is None (added in 9c5dcdf1, "fix: require commit for inline reviews"), and the README already states --commit-id is required whenever inline comments are submitted. This directly addresses my earlier inline note on that branch. Nothing left to do here.
1) README cleanup — still open, and I can't apply it myself: this bot only has read/comment access to this PR (no push/write permissions), so I can't commit the change.
Max's specific ask (inline comment on README.md:82): the new ### Submit inline pull request reviews section (README.md, roughly lines 82–122 — the JSON comment schema, the try pr review --commit-id/--comments-file/--comments walkthrough, and the review-comments resolve/unresolve examples) is automation-facing reference material, not a short tool summary, so it doesn't belong in README.
Suggested concrete fix: move that whole block into the CLI's skill docs (e.g. a new references/inline-reviews.md alongside the existing skill reference files, linked from the main skill file since automations rely on this heavily), and replace it in README with a one- or two-line pointer — matching how --stacked mode is only summarized in README today.
@stylessh — could you make that move? Happy to take another pass once it's pushed.
60983cc into master3mo ago
What changed
try pr reviewgains three new flags —--commit-id,--comments, and--comments-file— to submit inline comments anchored to diff lines atomically with the review event. User-suppliedside: RIGHT/LEFTis normalized tonew_position/old_positionbefore the platform API call. New validation rejects unknown fields, non-positive line numbers, and invalid side values. Integration and unit tests are included.Risk areas
1. No guard when
--commentsis used without--commit-idThe code inserts
commentsinto the review body unconditionally when the flag is provided, regardless of whethercommit_idis also present. The platform will accept the request but may silently attach inline comments to the wrong (or default) commit. The--commit-idflag is documented as "recommended" in the README, but that wording understates the risk — omitting it when inline comments are present is almost certainly a user error.See inline comment for the specific location.
2. Pre-existing CI failure (
version_update_cli)The PR description acknowledges that
version_update_clitests are pinned to v1.1.0 while the checkout is v1.1.1. This is unrelated to the change but means CI has pre-existing red. Worth resolving before merge to keep CI signal clean and reviewable.Suggested follow-ups
if let Some(comments)branch (src/trylle/mod.rs): emit a warning or return a soft error whencommentsisSomeandcommit_idisNone.--body-file - --comments-file -) is validated but not exercised by the mock integration test — consider arun_failcase intrylle_cli_commands_mock.rs."RIGHT"/"LEFT", but the implementation accepts any casing viato_ascii_uppercase(). Minor doc alignment opportunity.