fix(config): ignore unknown fields when parsing config.json#8
Open
YeonV wants to merge 1 commit into
Open
Conversation
Config parsing currently fails with error.UnknownField if config.json contains any key not in the Config struct. This causes a hard crash on startup whenever a newer tool (e.g. nullhub's integration API) has written additional fields — such as the 'tracker' key — that an older binary does not yet recognise. Fix: pass ignore_unknown_fields = true, consistent with the existing behaviour in ConcurrencyConfig parsing (line 316). This allows forward-compatible config files and prevents crashes on upgrade/downgrade paths between component versions.
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.
Problem
Config parsing uses
std.json.parseFromSlicewith default (strict) options, which returnserror.UnknownFieldfor any key not present in theConfigstruct. This causes a hard crash on startup wheneverconfig.jsoncontains a field that an older binary does not yet recognise.A concrete case: nullhub's integration API writes a
trackerkey intoconfig.jsonas part of wiring nullboiler to nulltickets. If the running nullboiler binary pre-dates thetrackerfield, the binary crashes immediately on startup and cannot be restarted without manually editing the config file.Fix
Pass
ignore_unknown_fields = true, consistent withConcurrencyConfigparsing already present in this file (line 316):Impact
Makes config parsing forward-compatible: binaries can safely load config files written by newer versions of the tooling without crashing.