[codex] Structure reference repo sync failures - #3281
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Refactors error handling in internal sync scripts by replacing a generic error class with multiple structured error types. Changes are limited to error formatting and structure with comprehensive test coverage - no behavioral changes to the sync logic itself. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate a24f12b
Summary
Validation
vp test scripts/sync-reference-repos.test.ts(10 tests)vp checkvp run typecheckNote
Low Risk
Changes are confined to the reference-repo sync script and its tests; no production auth or data paths, though callers matching on the old error shape would need updating.
Overview
Replaces the single message-bag
ReferenceRepoSyncErrorinsync-reference-repos.tswith four schema-tagged failure types and aReferenceRepoSyncErrorunion plusisReferenceRepoSyncError.Selection failures expose
repoIdandexpectedRepoIds. Version source failures distinguishreadvsparse, carrysourcePathand a realcause, and keep human messages from leaking underlying error text. Version resolution failures reportpackageVersionPathwith no fabricated cause. Git subtree failures recordoperation(spawn/communicate/exit), repo/ref/action context, optionalcausefor process errors, and on non-zero exit only stdout/stderr lengths—not raw stderr (so secrets in git output do not land in messages).Tests gain configurable mock child processes and new cases that assert structured fields and absence of stderr/cause where intended.
Reviewed by Cursor Bugbot for commit a24f12b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure reference repo sync failures into typed error classes
ReferenceRepoSelectionError,ReferenceRepoVersionSourceError,ReferenceRepoVersionResolutionError, andReferenceRepoGitSubtreeError, plus aReferenceRepoSyncErrorunion type andisReferenceRepoSyncErrorguard.Macroscope summarized a24f12b.