Fixed config library _default: breaking configs when _definitions: appear below it - fixes #521#1032
Open
philayres wants to merge 1 commit intoconsected:developfrom
Open
Fixed config library _default: breaking configs when _definitions: appear below it - fixes #521#1032philayres wants to merge 1 commit intoconsected:developfrom
philayres wants to merge 1 commit intoconsected:developfrom
Conversation
…pear below it - fixes consected#521
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.
Summary
Fixes #521 — Adding
_default:to a config library breaks configurations if other config library_definitions...:appear below it.Root Cause
When
include_librariesinjected library content into a definition's YAML, it renamed_definitions:to_definitions__category_name:to avoid key collisions, but did not rename_default:. This left_default:as a top-level YAML key that absorbed subsequent indented content (such as anchor definitions under_definitions:) as its children, corrupting the YAML structure.Additionally, when this corruption caused a parse failure, the
FphsExceptionwas silently caught byoption_configsrather than being propagated toall_option_configs_notices, so the admin panel showed no error — making the issue hard to diagnose.Changes
LibraryKeyRenamePatternsconstant listing top-level YAML keys (_definitions,_default) that must be renamed in library content. Updatedinclude_librariesto rename all listed keys, not just_definitions:.FphsExceptionto theraise_bad_configslist inall_option_configs_notices, so config parse failures are reported as notices in the admin panel._default:to a config library breaks configurations if other config library_definitions...:appear below it #521 scenario, and graceful error handling.Testing
spec/models/option_configs/(0 failures)