Repository navigation
feat(cli): ripr annotations — binary-first GitHub Actions annotations (item 8b) - #1467
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
WalkthroughAdds a new ChangesAnnotations Subcommand
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as ripr CLI
participant Exec as execute/commands
participant Ann as run_annotations
participant FS as Filesystem
User->>CLI: ripr annotations [--comments] [--out] [--check]
CLI->>Exec: CliCommand::Annotations(args)
Exec->>Ann: run_annotations(args)
Ann->>Ann: parse_options(args)
Ann->>FS: read comments.json
alt file missing
FS-->>Ann: not found
Ann->>Ann: mark comments missing
else file present
FS-->>Ann: JSON content
Ann->>Ann: build ::warning lines per comment
end
alt --check
Ann->>FS: read existing annotations.txt
Ann->>Ann: compare with generated text
else
Ann->>FS: write annotations.txt
end
Ann-->>Exec: Result
Exec-->>User: exit status
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16ae71f62c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .unwrap(); | ||
| let bin = std::fs::canonicalize(env!("CARGO_BIN_EXE_ripr")) | ||
| .unwrap_or_else(|_| std::path::PathBuf::from(env!("CARGO_BIN_EXE_ripr"))); | ||
| let output = std::process::Command::new(&bin) |
There was a problem hiding this comment.
Update process policy for the new binary spawn
This new smoke test adds an eleventh Command::new occurrence in crates/ripr/tests/cli_smoke.rs, but policy/process_allowlist.txt still caps that file at 10. I ran cargo xtask check-process-policy, and it fails with crates/ripr/tests/cli_smoke.rs contains Command::new 11 time(s), allowed 10, so the required policy gate will reject this commit. Either route this through an existing helper that avoids a new spawn surface or update the process allowlist count/reason for the annotations smoke and validate with cargo xtask check-process-policy.
Useful? React with 👍 / 👎.
16ae71f to
a688270
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/ripr/src/app/annotations.rs`:
- Around line 154-174: The annotation message is being escaped with the same
helper used for workflow-command parameters, which over-escapes the data segment
and turns visible colons into %3A. Update annotation construction in
annotation_from_comment so the message passed after the final :: uses data-only
escaping, while file/title keep parameter escaping via escape_cmd. Refactor
escape_cmd or add a separate helper to distinguish parameter vs. data escaping,
and ensure the suggested_test intent text remains readable in GitHub Actions
output.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0f8de7ee-ca9c-45ad-b5fc-8078621d7931
📒 Files selected for processing (6)
crates/ripr/src/app.rscrates/ripr/src/app/annotations.rscrates/ripr/src/cli/command.rscrates/ripr/src/cli/commands.rscrates/ripr/src/cli/execute.rscrates/ripr/tests/cli_smoke.rs
| let reason = item | ||
| .get("reason") | ||
| .and_then(Value::as_str) | ||
| .unwrap_or("RIPR review guidance"); | ||
| let intent = item | ||
| .get("suggested_test") | ||
| .and_then(|test| test.get("intent")) | ||
| .and_then(Value::as_str); | ||
| let mut message = reason.to_string(); | ||
| if let Some(intent) = intent { | ||
| message.push_str(" Suggested test: "); | ||
| message.push_str(intent); | ||
| } | ||
| let title = format!("ripr {severity} {kind}"); | ||
| Ok(format!( | ||
| "::warning file={},line={},title={}::{}", | ||
| escape_cmd(&path), | ||
| line, | ||
| escape_cmd(&title), | ||
| escape_cmd(&message) | ||
| )) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
escape_cmd over-escapes the annotation message, corrupting visible output.
GitHub Actions workflow-command escaping differs for "data" (the text after the final ::) versus "parameter" values (file=, line=, title=): data only needs %, \r, \n escaped, while parameters additionally need : and , escaped. escape_cmd (Lines 228-235) escapes :/, unconditionally and is reused for message (the data segment) at Line 174. Since message is built with a literal colon at Line 164 (" Suggested test: "), every annotation with a suggested-test intent will render %3A instead of : in the GitHub Actions UI — this isn't a hypothetical edge case, it's the common path.
🐛 Proposed fix: separate data vs. property escaping
-fn escape_cmd(value: &str) -> String {
+fn escape_property(value: &str) -> String {
value
.replace('%', "%25")
.replace('\r', "%0D")
.replace('\n', "%0A")
.replace(',', "%2C")
.replace(':', "%3A")
}
+
+fn escape_data(value: &str) -> String {
+ value
+ .replace('%', "%25")
+ .replace('\r', "%0D")
+ .replace('\n', "%0A")
+} Ok(format!(
"::warning file={},line={},title={}::{}",
- escape_cmd(&path),
+ escape_property(&path),
line,
- escape_cmd(&title),
- escape_cmd(&message)
+ escape_property(&title),
+ escape_data(&message)
))Also worth a unit test on annotation_from_comment/escaping directly — the current 2 tests only cover option parsing and wouldn't have caught this.
Also applies to: 228-235
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@crates/ripr/src/app/annotations.rs` around lines 154 - 174, The annotation
message is being escaped with the same helper used for workflow-command
parameters, which over-escapes the data segment and turns visible colons into
%3A. Update annotation construction in annotation_from_comment so the message
passed after the final :: uses data-only escaping, while file/title keep
parameter escaping via escape_cmd. Refactor escape_cmd or add a separate helper
to distinguish parameter vs. data escaping, and ensure the suggested_test intent
text remains readable in GitHub Actions output.
… (item 8b) Ports `cargo xtask ripr-annotations` into `ripr annotations` so downstream consumers can generate GitHub Actions `::warning` annotations without compiling their own xtask. This is the second binary-first subcommand (after `ripr pr-summary`). The command reads `target/ripr/review/comments.json` and emits annotation-safe placement-mode warning lines to `target/ripr/review/annotations.txt`. Supports `--comments <path>`, `--out <path>`, `--check`, `--help`. Missing comments.json is an advisory no-op (writes empty annotations.txt, exits cleanly). Implementation: ports xtask/src/reports/annotations.rs into crates/ripr/src/app/annotations.rs, adapting repo_root() from CARGO_MANIFEST_DIR to current_dir() (binary shouldn't assume build-system location). CLI wiring: CliCommand::Annotations + parse arm + execute dispatch + handler. Tests: 3 cli_smoke tests (help, missing-comments writes empty, unknown-arg fails) + 2 lib parse tests. All green. Gates: compile, fmt, clippy, lib tests, smoke tests all green. Scope: one semantic slice (second binary-first subcommand). No other xtask commands ported, no downstream workflow switch.
a688270 to
c038900
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Ports `cargo xtask ripr-pr` into `ripr pr-evidence` so downstream consumers can generate PR evidence packets without compiling their own xtask. This is the third binary-first subcommand (after pr-summary #1460 and annotations #1467). The command: - Verifies git revisions (--base/--head) - Runs ripr check directly via check_workspace() (no cargo subprocess) - Composes the check output into a PR evidence packet with changed_files, summary, and findings count - Writes target/ripr/pr/repo-exposure.{json,md} - Supports --root, --base, --head, --check, --help - Error packets surface named issues (bad revisions, check failure) rather than silently producing misleading clean packets Implementation: ports xtask/src/reports/pr_evidence.rs into crates/ripr/src/app/pr_evidence.rs. Key difference from xtask: calls crate::check_workspace() directly instead of shelling out through cargo. CLI wiring: CliCommand::PrEvidence + parse + dispatch + handler. Tests: 3 cli_smoke tests (help, missing-artifact graceful, unknown-arg fails). Gates: compile, fmt, clippy, lib tests, smoke tests, no-panic, static-language, goldens (zero drift), process-policy all green. Scope: one semantic slice (third binary-first subcommand).
…d) (#1468) Ports `cargo xtask ripr-pr` into `ripr pr-evidence` so downstream consumers can generate PR evidence packets without compiling their own xtask. This is the third binary-first subcommand (after pr-summary #1460 and annotations #1467). The command: - Verifies git revisions (--base/--head) - Runs ripr check directly via check_workspace() (no cargo subprocess) - Composes the check output into a PR evidence packet with changed_files, summary, and findings count - Writes target/ripr/pr/repo-exposure.{json,md} - Supports --root, --base, --head, --check, --help - Error packets surface named issues (bad revisions, check failure) rather than silently producing misleading clean packets Implementation: ports xtask/src/reports/pr_evidence.rs into crates/ripr/src/app/pr_evidence.rs. Key difference from xtask: calls crate::check_workspace() directly instead of shelling out through cargo. CLI wiring: CliCommand::PrEvidence + parse + dispatch + handler. Tests: 3 cli_smoke tests (help, missing-artifact graceful, unknown-arg fails). Gates: compile, fmt, clippy, lib tests, smoke tests, no-panic, static-language, goldens (zero drift), process-policy all green. Scope: one semantic slice (third binary-first subcommand).
…headline entries (#3591) * docs(changelog): consolidate Unreleased headings and add the missing headline entries The Unreleased section carried duplicate Added/Fixed headings and omitted the release's headline features. Consolidate to one Added / Changed / Fixed sequence (0.10.0 convention) and add verified entries for: - ripr mcp --stdio server and startup routing (#3088, #3525, #3587) - ripr rerun changed-test targeted analysis (#1520) - the binary-first evidence/gate surface: ripr plus, pr-summary, pr-evidence, annotations, impacted-evidence (#1476/#1460/#1468/#1467/#1474) - --suppression-policy and --exception-policy policy flags (#1475/#1477) - the cache management surface: status, clear, atomic writes (#1822/#2865/#2738) - the LSP capability wave: pull diagnostics, listActionableItems, transport bounds (#1669/#3012/#2185) - analysis performance: per-file fact cache, rayon parallel parse, artifact reuse (#2039/#2322/#2250) Every cited PR verified MERGED via the GitHub API. Also corrects the stale 0.10.0 release-date line (crates.io publication 2026-06-15; GitHub release draft remains unfinalized). * docs(changelog): drop the superseded duplicate MCP entry (#3591 review) The pre-existing Added block already carried an MCP entry from the #3525 merge; keep the expanded consolidated entry (startup routing, verbose handling, review fixes) and remove the older shorter one.
What
Ports
cargo xtask ripr-annotationsintoripr annotations— the second binary-first subcommand (item 8b). Downstream consumers can now generate GitHub Actions annotations without compiling xtask.Changes (6 files)
app/annotations.rs(new): faithful port of xtaskannotations.rs(~250 lines). Reads comments.json, emits::warninglines, writes/checks annotations.txt.repo_root()usescurrent_dir().CliCommand::Annotations+ parse + dispatch + handler.Supports
--comments <path>(default:target/ripr/review/comments.json)--out <path>(default:target/ripr/review/annotations.txt)--check(verify freshness)--helpGates
compile, fmt, clippy, lib tests, smoke tests all green.
Scope
One semantic slice. No other xtask commands ported.