Skip to content

fix: warn about unknown and misplaced config keys - #560

Open
alfawal wants to merge 1 commit into
johnste:mainfrom
alfawal:fix/warn-unknown-config-keys
Open

alfawal wants to merge 1 commit into
johnste:mainfrom
alfawal:fix/warn-unknown-config-keys

Conversation

@alfawal

@alfawal alfawal commented Oct 17, 2026 •

Copy link
Copy Markdown

Zod strips keys it doesn't know, so an option set at the top level of the config (like hideIcon in #544) or a misspelled key was silently ignored. Log a warning for those when the config loads, and point misplaced options to options.

Summary by CodeRabbit

  • New Features
    • Configuration loading now displays warnings when options are placed at the top level, or when unrecognized properties or options are provided.
    • Valid configurations continue to load without warnings, and these warnings do not change the returned configuration.

Zod strips keys it doesn't know, so an option set at the top level of the
config (like `hideIcon` in johnste#544) or a misspelled key was silently ignored.
Log a warning for those when the config loads, and point misplaced options
to `options`.
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 334ec196-ff73-41d7-9eb5-dd43990424f0
📥 Commits

Reviewing files that changed from the base of the PR and between 4a38875 and 32d940f.

📒 Files selected for processing: 3
  • packages/config-api/src/config.test.ts
  • packages/config-api/src/configSchema.ts
  • packages/config-api/src/index.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📝 Walkthrough

getConfiguration now warns about recognized option keys placed at the top level and about unrecognized configuration or option keys. The returned configuration is unchanged. Tests cover these warnings and a valid configuration.

Changes: Configuration key warnings

Layer / File(s) Summary
Configuration key inspection and warnings
packages/config-api/src/configSchema.ts, packages/config-api/src/index.ts, packages/config-api/src/config.test.ts
ConfigOptionsSchema is exported for key inspection. getConfiguration warns about misplaced option keys and unrecognized keys in the selected configuration. Tests check warning cases and a valid configuration.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: johnste

Merge Risk: ⚪ Minimal · up to 32d94

This change adds warnings for misplaced or unknown configuration keys without altering the loaded configuration. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: warning about unknown and misplaced configuration keys.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant