Repository navigation
fix(compare): fall back to a line diff when semantic rows fail to build - #61
Merged
Merged
Conversation
When the semantic diff succeeded but its rows did not build a valid document, diff_one returned Error::Build. diff_files collects every file into one Result, so a single bad file failed the whole request, and the Node binding rejected every file with it. That file now gets a line diff like any other semantic failure, with a warning logged and fallback kind semantic, reason invalid. The new reason is added to FORMAT.md and the TypeScript types; adding an enum value is not a breaking change under the format's versioning rules.
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.
One file whose semantic rows failed to build made the whole compare request fail, and the Node binding rejected every file, because that error went up through
diff_filesinstead of falling back. That file now gets a line diff with a logged warning and fallbacksemantic/invalid, a new reason value added to FORMAT.md and the TypeScript types without a format version bump (adding an enum value isn't listed as breaking).