hooks: Thread optional post-commit VCS metadata into agent traces#43
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdd an optional ChangesVCS Type Post-Commit Hook Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
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 `@cli/src/services/parse/command_runtime.rs`:
- Around line 407-419: parse_optional_hook_vcs_type currently swallows unknown
--vcs values by returning None; change it to return a
Result<Option<services::agent_trace::AgentTraceVcsType>, String> (or a suitable
error type) so that when vcs is None you return Ok(None), when normalized
matches "git"/"jj"/"hg"/"svn" you return Ok(Some(...)), and when it does not
match you return Err with a clear validation message about the unsupported --vcs
value; update any callers to propagate or surface that Result so providing an
unsupported --vcs yields a visible validation error instead of silently dropping
metadata.
🪄 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: 37f6d2c7-e1db-4e34-99cc-91d2a0dee1f7
⛔ Files ignored due to path filters (5)
context/context-map.mdis excluded by!context/**/*.mdcontext/glossary.mdis excluded by!context/**/*.mdcontext/sce/agent-trace-hooks-command-routing.mdis excluded by!context/**/*.mdcontext/sce/agent-trace-minimal-generator.mdis excluded by!context/**/*.mdcontext/sce/setup-githooks-hook-asset-packaging.mdis excluded by!context/**/*.md
📒 Files selected for processing (6)
cli/assets/hooks/post-commitcli/src/cli_schema.rscli/src/services/agent_trace.rscli/src/services/agent_trace/tests.rscli/src/services/hooks/mod.rscli/src/services/parse/command_runtime.rs
- Add optional to post-commit hook processed intersection: commit=615ca0bc70e0fafb659875e5e0d18bfa698ed2dc, intersection_files=91 and parse known values () into . - Pass parsed VCS type through hook runtime into . - Make top-level optional and emit it only when VCS type is provided. - Update the packaged hook template to invoke . - Refresh SCE context docs to reflect optional VCS emission and updated post-commit command surface. Co-authored-by: SCE <sce@crocoder.dev>
Return a validation error when an unsupported --vcs value is provided for hooks post-commit instead of silently treating it as unset. This updates optional VCS parsing to return Result<Option<...>, String> and wires the post-commit command conversion through ClassifiedError::validation. Co-authored-by: SCE <sce@crocoder.dev>
3251418 to
1f595c9
Compare
This PR adds optional VCS metadata support to the
sce hooks post-commitflow and threads it through to Agent Trace generation.It expands the hook command surface to accept
--vcs, maps supported values to a typed enum, and updates trace serialization so top-levelvcsis emitted only when VCS type is provided.--vcsargument tosce hooks post-commit.gitjjhgsvnAgentTrace.vcsis now optional (Option<AgentTraceVcs>).typeis enum-backed (schema-aligned) instead of hardcoded string.sce hooks post-commit --vcs gitvcsemission behaviorpost-commitcommand surfaceSummary by CodeRabbit
New Features
Improvements