Skip to content

fix(language): add missing plugin validation - #2806

Open
sanny-io wants to merge 4 commits into
zenstackhq:devfrom
sanny-io:fix/plugin-validation
Open

fix(language): add missing plugin validation#2806
sanny-io wants to merge 4 commits into
zenstackhq:devfrom
sanny-io:fix/plugin-validation

Conversation

@sanny-io

@sanny-io sanny-io commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Now validates that all plugins have a provider.

Summary by CodeRabbit

  • New Features

    • Added validation for plugin definitions.
    • Plugins must include a non-empty string provider value.
    • Duplicate plugin fields are now detected and reported.
    • Plugin discovery now safely skips entries with missing or invalid provider values.
  • Tests

    • Added coverage for valid plugins and invalid provider configurations.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5da6c611-3b7b-49cf-92bd-2da7c7921116

📥 Commits

Reviewing files that changed from the base of the PR and between ef60755 and 50f0c31.

📒 Files selected for processing (3)
  • packages/language/src/utils.ts
  • packages/language/src/validators/plugin-validator.ts
  • packages/language/test/plugin.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/language/test/plugin.test.ts
  • packages/language/src/validators/plugin-validator.ts

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The language validator now supports plugin validation. It checks duplicate fields and requires a non-empty string-literal provider. Plugin document resolution skips missing or non-string providers. Tests cover valid and invalid provider values.

Changes

Plugin validation

Layer / File(s) Summary
Plugin validation rules
packages/language/src/validators/plugin-validator.ts, packages/language/test/plugin.test.ts
PluginValidator checks duplicate fields and validates the required provider field. Tests cover valid, missing, empty, array, boolean, and object provider values.
Validator registration and delegation
packages/language/src/validator.ts, packages/language/src/utils.ts
ZModelValidator registers Plugin nodes and delegates validation to PluginValidator. Plugin document resolution skips missing or non-string providers.

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

Merge Risk: ⚪ Minimal · up to 50f0c

This PR adds validation requiring plugins to have a provider; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding missing plugin validation in the language package.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/language/src/utils.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/language/src/validators/plugin-validator.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

packages/language/test/plugin.test.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


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.

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