feat(config): add mergify config validate command (#1010)#1016
Conversation
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.
|
There was a problem hiding this comment.
Pull request overview
Adds a new top-level mergify config command group with a validate subcommand to locally validate .mergify.yml files against Mergify’s published JSON schema, including auto-detection of config location and an explicit --config path.
Changes:
- Introduce
mergify config validatecommand (new Click command group + subcommand). - Implement YAML loading, remote schema fetching, and JSON Schema validation logic.
- Add test coverage for valid/invalid configs, YAML errors, auto-detection, and schema fetch failures; add
jsonschema(+ typing stubs) dependency.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Adds jsonschema and types-jsonschema dependencies to support validation + typing. |
uv.lock |
Locks new dependency tree for jsonschema and related packages. |
mergify_cli/config/validate.py |
Implements YAML loading, schema fetching, and config validation helpers. |
mergify_cli/config/cli.py |
Adds the config command group and validate subcommand wiring + output formatting. |
mergify_cli/cli.py |
Registers the new config command group in the root CLI. |
mergify_cli/tests/config/test_validate.py |
Adds CLI-level tests covering common success/failure scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🧪 CI InsightsHere's what we observed from your CI run for be4ceb9. 🟢 All jobs passed!But CI Insights is watching 👀 |
|
This pull request is part of a stack:
|
68e009f to
01b46c4
Compare
01b46c4 to
a0412dc
Compare
Add a new `config validate` subcommand that validates Mergify configuration files against the official JSON schema. Supports auto-detection of config file location and explicit path via --config. Closes #1010 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Change-Id: Ib7a8075cd92a62a2a7d761a4eab5e309c914dd21 Claude-Session-Id: 35f710ae-3790-4349-b55b-82247979f4a8
a0412dc to
be4ceb9
Compare
Merge Queue Status
This pull request spent 14 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Add a new
config validatesubcommand that validates Mergifyconfiguration files against the official JSON schema. Supports
auto-detection of config file location and explicit path via --config.
Closes #1010
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com