fix(config): ignore unknown ini sections instead of panicking - #74
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
chess-seventh
force-pushed
the
feat/tolerant-config
branch
from
July 29, 2026 22:48
e73935a to
ec73f5d
Compare
One ini file is shared by every checkout on the machine, so a section written for a newer release reached binaries that predate it: adding [exclude] made every checkout older than 4.17.0 panic on the section count and stop journalling its commits. Strict section validation turns any future config addition into the same outage. - keep [obsidian] and [templates] required; missing either is still fatal - ignore any other section instead of panicking - report the ignored section on stderr as well as through log::warn, because the git hook runs without RUST_LOG and env_logger would swallow the warning; an [excludes] typo must not silently journal the repos you excluded - cover that report with integration tests that run the binary: removing the stderr line fails them, which the unit tests alone did not - hold the known-section list in one const, so a section added to the dispatch cannot be applied and reported as unrecognised at the same time - correct the set_obsidian_vars rustdoc and its call-site comment, which both still promised that an unknown section was rejected - tests: flip the three-sections case, add a section from a future release and the [obsidian]-without-[templates] mirror, and rename three tests whose names encoded the pre-4.17 contract - state the forward-compatibility contract in the README config section Co-Authored-By: Vulcan <chess7th@pm.me>
The panic on a missing root_path_dir blamed commit_path, sending anyone debugging a broken config at the wrong line of their ini. - report root_path_dir in its own expect message Co-Authored-By: Vulcan <chess7th@pm.me>
chess-seventh
force-pushed
the
feat/tolerant-config
branch
from
July 29, 2026 23:13
ec73f5d to
420dc7b
Compare
The review found the new guards passed for weak reasons: the stderr test could have passed vacuously, and the corrected panic message was asserted only by its prefix, so reverting it went unnoticed. - pin the root_path_dir expect message in should_panic, not just "Could not get"; reverting the message now fails the test - assert the run reaches past config loading before asserting the silent case, so a config that never loads cannot pass it - keep the test vault inside the temp dir instead of a shared /tmp path - drop two stale wordings: an assert message about a section count that is no longer validated, and a comment naming 4.14.x where any pre-4.17.0 binary is affected Co-Authored-By: Vulcan <chess7th@pm.me>
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 ini file is shared by every checkout, so a section written for a newer release reached binaries that predate it: adding
[exclude]made every 4.14.x pin panic on the section count, and those repos silently stopped journalling commits.[obsidian]and[templates]stay required; missing either is still fatalRefs: L66