[codex] Structure catalog dependency resolution failures#3298
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 This PR replaces a generic Error with a structured, typed error class for catalog dependency resolution failures. The runtime behavior is unchanged - errors are thrown in the same scenarios with the same message, just with additional typed fields for better debugging. You can customize Macroscope's approvability policy. Learn more. |
Summary
CatalogDependencyResolutionErrorValidation
vp test run scripts/lib/resolve-catalog.test.ts scripts/build-desktop-artifact.test.ts(20 tests)vp checkvp run typecheckNote
Low Risk
Localized change to build-script error typing and messaging; behavior on failure stays the same aside from error class and structured fields.
Overview
Catalog resolution failures in
resolveCatalogDependenciesnow throwCatalogDependencyResolutionError(EffectSchema.TaggedErrorClass) instead of a plainError, with fields for workspace package, dependency name, catalog spec, and catalog lookup key. The third argument is renamed fromlabeltoworkspacePackage; the human-readablemessagematches the previous string.Adds
resolve-catalog.test.tsto assert the error type, structured fields, and message when acatalog:spec cannot be resolved.Reviewed by Cursor Bugbot for commit 4a661d2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Replace generic
Errorwith structuredCatalogDependencyResolutionErrorin catalog resolutionIntroduces
CatalogDependencyResolutionError, a tagged error class (viaeffect/Schema) with structured fields:workspacePackage,dependencyName,catalogSpec, andcatalogKey. WhenresolveCatalogDependenciesfails to find a catalog key, it now throws this typed error instead of a plainError, making failures easier to catch and inspect programmatically.Macroscope summarized 4a661d2.