[ConfigManager] Register Node Sections 4/4 - #3995
Conversation
Fourteen keys sit at the top of that file with no table of their own. They are declared against a schema rather than the node's top-level type, because that type carries the nine tables as well and declaring against it would declare every table's keys a second time. The schema squashes the same base group that type squashes, so those spellings still come from the node's own tags, and it restates the two fields held beside that group. A test holds those two to the type they came from by name, tag and type, and holds the count, so a third one appearing there fails rather than going undeclared. Two paths are left out. The home directory is where this file is found, so a value inside it would be the file naming its own location, and the command line already carries it. The node mode is the fact the file states at the top under its own name, and a second spelling would let the two disagree, with the resolution answering for one and the node reading the other. A test also checks that no root key is another section's name. Nothing refuses that collision, and the two settings it produces cannot both be written because no file holds a value for a name and a table under it. This is the first change to declare root keys beside another package's, so the check lives here until it has somewhere better to be. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## plt-775-node-sections-3 #3995 +/- ##
========================================================
Coverage 57.56% 57.56%
========================================================
Files 2225 2225
Lines 186513 186521 +8
========================================================
+ Hits 107370 107378 +8
Misses 69337 69337
Partials 9806 9806
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
# Conflicts: # config/tendermintbase/tendermintbase_test.go
PR SummaryLow Risk Overview
Adds tests that keep the schema aligned with Reviewed by Cursor Bugbot for commit 6a27859. Bugbot is set up for automated code reviews on this repo. Configure here. |
Declares the fourteen keys at the top of the node's configuration file, with no table of
their own. That completes the file: nine tables and its root. Nothing consumes them.
Why a schema rather than the node's own type
That type carries the root keys and the nine tables, so declaring against it would declare
every table's keys a second time. The schema squashes the same base group, so fourteen
spellings still come from the node's own tags, and restates only the two fields held beside
that group.
Those two restatements are the one place a spelling is written twice, so a test holds them to
the type by name, tag and type, and holds the count of non-table fields. A third one
appearing there fails rather than going undeclared.
Two paths left out
homeis where this file is found, so a value inside it would be the file naming its ownlocation, and the command line already carries it.
modeis the fact the file states at the top under its own name. Declaring a second spellingwould let the two disagree, with the resolution answering for one and the node reading the
other.
That leaves the step which makes these keys take effect something to do. Nothing will
carry the file's own mode into the node's
mode, so whatever installs a written value has tomap it.
The test names both paths as literals rather than reading the list the registration uses. A
test comparing that list against itself agrees however it changes, so a path dropped from it
would leave the test passing while the key became declared. Verified by removing
modeandconfirming the test objects.
A collision nothing refuses
A key at the top of the file that is also a section's name cannot be written: no file holds
both a value for a name and a table under it. The registry does not catch it, and this is the
first change to declare root keys beside another package's, so a test here checks the whole
registered set.
gofmt,goimports,go vet,golangci-lintclean;config/...andcmd/seid/...pass.With this the registry declares 12 sections and 187 keys.