fix: fail the lifecycle sync on malformed deprecation entries - #325
Merged
Conversation
The sync silently dropped entries that failed the deprecation schema, so schema drift on modeldeprecations.dev (e.g. a new status value) went unnoticed. Report each rejected entry with its zod reason and exit non-zero instead.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
src/sync/run.tscurrently swallows deprecation entries that fail themodeldeprecations.devschema:toLifecycleRecordreturnsundefinedon a failed parse, andindexDeprecationsskips it. If the source drifts (a newstatusvalue, a renamedshutdown_on), the daily sync becomes a silent no-op and this catalog's lifecycle fields go stale with no failure.Change
indexDeprecationsnow returns{ index, rejected }, where each rejection carries its zod reason.run.tslogs each rejected entry + reason and exits non-zero when any exist, so the scheduledsync-lifecycleworkflow fails loudly instead of opening a "no changes" run.tests/sync-status.test.tsfor the new return shape and added a status-drift rejection case.No behavior change when the source is well-formed (verified against the current payload: 393 entries, 0 rejected).