Skip to content

Reject unknown TOML config keys - #139

Open
lukashes wants to merge 1 commit into
mainfrom
bugfix/reject-unknown-config-keys
Open

Reject unknown TOML config keys#139
lukashes wants to merge 1 commit into
mainfrom
bugfix/reject-unknown-config-keys

Conversation

@lukashes

@lukashes lukashes commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Problem

zig-toml maps only keys that match a struct field and drops the rest with no
signal. A typo silently changes behavior: [observabilty] disables metrics,
routing_kye falls back to the default routing key.

Solution

  • Parse the config a second time as a raw toml.Table and walk it against the
    Config field set, failing fast with UnknownConfigKey on the first key that
    maps to nothing.
  • Descend into nested tables and [[streams]] arrays; the logged path names the
    offending key (source.postgres.slot_naem).
  • The check runs before the typed parse in both loadFromTomlFile and
    loadFromTomlString.

Fixes #100.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Current run is the minimum over 3 passes, compared against the base branch (main @ 15023f9), built on the same runner.

Benchmark Baseline Current Δ Time Allocs Status
Converter DELETE 127.29μs 127.24μs -0.0% 14 → 14 ➡️
Converter INSERT 127.42μs 126.72μs -0.6% 14 → 14 ➡️
Converter UPDATE 174.43μs 174.28μs -0.1% 23 → 23 ➡️
JsonSerializer 49.94μs 49.94μs -0.0% 3 → 3 ➡️
KafkaProducer produce 210.97μs 218.96μs +3.8% 1 → 1 ➡️
KafkaProducer send 252.06μs 244.95μs -2.8% 0 → 0 ➡️
PgOutputDecoder 86.86μs 96.66μs +11.3% 6 → 6 🔴 slower
getPartitionKeyValue boolean 15.90μs 15.88μs -0.1% 1 → 1 ➡️
getPartitionKeyValue integer 0.04μs 0.04μs -4.8% 0 → 0 ⚪ noise
getPartitionKeyValue not found 0.03μs 0.03μs +0.0% 0 → 0 ⚪ noise
getPartitionKeyValue string 17.63μs 17.68μs +0.3% 1 → 1 ➡️
matchStreams found 17.80μs 17.70μs -0.6% 1 → 1 ➡️
matchStreams not found 0.06μs 0.06μs +0.0% 0 → 0 ⚪ noise

Summary: ➡️ 9 neutral · 🔴 1 slower · ⚪ 3 ignored (sub-μs)

Thresholds: <1μs ignore · 1–20μs 15% · 20–50μs 10% · ≥50μs 5%. Measured on a shared CI runner — treat small deltas as noise. Informational only; this check never fails the build.

@lukashes lukashes added the marinating Deliberately paused to settle before deciding label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

marinating Deliberately paused to settle before deciding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown TOML keys are silently ignored

1 participant