Config keys are hand-wired in five places with no completeness test
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with internal/config/config.go and the hand-picked tests in internal/config/config_test.go; trace how Config fields are merged and classified by untrust. Add reflection coverage that exercises every leaf field and a table that states each field’s treatment for working-directory config. Run make test-short (or .\make.ps1 test-short on Windows) and check make lint; done when both completeness tests fail for omissions and existing config tests pass.
索引モデルが issue の本文から書いたものです。
説明
Summary
A setting has to be added to the struct, the defaults, merge, untrust, Validate and often the flag loader. Nothing ties these together, and two of the possible omissions fail silently.
Where
internal/config/config.go:424(untrust)internal/config/config.go:544(merge)internal/config/config.go:703(Validate)internal/cli/flags.go:133(globalFlags.load)internal/config/config_test.go:51,:134(tests with hand-picked keys)
Details
merge only copies the fields it names (119 lines, one if per field), so a new struct field that TOML decodes, and that therefore passes the unknown-key check, is accepted and silently ignored unless it is also added to merge. untrust is a per-key list of what a spackle.toml found in the working directory may not set, so a new key gets no decision unless someone remembers to make one. The two tests that cover this set a hand-picked list of keys; neither walks the struct. No key was found to be wrong today; this is about the next one.
Impact
internal/config/config.go and docs/config.md are among the most frequently changed files, so keys are added often. Each addition is a five-place edit where an omission in merge or untrust produces no error and no failing test.
Suggested fix
Incremental, each step leaves behavior unchanged. (1) Add a test that walks Config with reflection, builds the dotted path of every leaf field, writes a file that sets each to a non-default value, loads it and asserts every leaf differs from the default; this pins merge. (2) Add a table that classifies every leaf path as kept, dropped or capped for a working-directory file, fail when a leaf is missing from the table, and assert untrust matches it. (3) Optionally replace the per-field chain in merge with a reflection overlay plus the few explicit exceptions, only after 1 and 2 are green.
Acceptance criteria
- A reflection test fails when a struct field is not merged
- A table test fails when a field has no stated treatment for a working-directory config file
- Existing config tests still pass unchanged
Related: #112
Getting started
- Relevant files: internal/cli/flags.go, internal/config/config.go, internal/config/config_test.go
- How to run tests:
make test-short(Unix) or.\make.ps1 test-short(Windows PowerShell);make lintbefore you call it done - Related docs: docs/config.md, CONTRIBUTING.md
Filed by repo-audit/full-audit at 50e92ec. Severity: medium. Effort: M. audit-key: tech-debt|internal/config/config.go|merge-completeness
- 主要言語
- Go
- スター
- 0
- フォーク
- 1
- 平均マージ
- 8時間 14分
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TMHSDigital/Spackle のほかの issue
-
ci good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
TMHSDigital/Spackle#206 ·
メンテナーはふだん 1 日以内に返信
-
ci severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/Spackle#205 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/Spackle#199 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
TMHSDigital/Spackle#195 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue severity: medium
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
TMHSDigital/Spackle#188 ·
メンテナーはふだん 1 日以内に返信
TMHSDigital/Spackle の issue をすべて見る
似ている issue
-
bug effort:s impact:med raised-by:worker risk:low to:worker
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
medici-finance/assay#8120 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory:subtask
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
agent-substrate/substrate#4308 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
celestiaorg/celestia-app#8877 ·
メンテナーはふだん 1 日以内に返信
-
sweep
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
bketelsen/truenas-mcp#112 ·
メンテナーはふだん 1 日以内に返信