-
Notifications
You must be signed in to change notification settings - Fork 11
fix: ensure we don't allow extra in scopes config #885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure we don't allow extra in scopes config #885
Conversation
Currently has the root object has "ignore" to allow root keys from the engine, we can't change the default validator Change-Id: I304fd6ef4f6202252842c965f9a59d4376531405
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
🧪 CI InsightsHere's what we observed from your CI run for 04c0124. 🟢 All jobs passed!But CI Insights is watching 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances configuration validation by adding strict field validation to Pydantic models in the scopes configuration. The change prevents users from accidentally providing invalid field names (like includes instead of include) by setting extra="forbid" on all scope-related models.
Key Changes
- Added
extra="forbid"to four Pydantic models:FileFilters,SourceFiles,SourceManual, andScopes - Updated existing test to expect 4 validation errors instead of 3 to reflect stricter validation
- Added new test case to specifically validate the extra field rejection behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| mergify_cli/ci/scopes/config/scopes.py | Adds model_config = pydantic.ConfigDict(extra="forbid") to all scope-related Pydantic models to prevent extra fields in configuration |
| mergify_cli/tests/ci/scopes/test_cli.py | Updates error count expectation from 3 to 4 in existing test and adds new test case test_match_scopes_invalid to verify extra fields are properly rejected |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge Queue Status✅ The pull request has been merged at 04c0124 This pull request spent 40 minutes 39 seconds in the queue, with no time running CI. Required conditions to merge
|
Currently has the root object has "ignore" to allow root keys from the
engine, we can't change the default validator