Skip to content

feat(config): add mergify config validate command (#1010)#1016

Merged
mergify[bot] merged 1 commit intomainfrom
devs/jd/feat/config-validate/Ib7a8075cd92a62a2a7d761a4eab5e309c914dd21
Mar 10, 2026
Merged

feat(config): add mergify config validate command (#1010)#1016
mergify[bot] merged 1 commit intomainfrom
devs/jd/feat/config-validate/Ib7a8075cd92a62a2a7d761a4eab5e309c914dd21

Conversation

@jd
Copy link
Member

@jd jd commented Mar 10, 2026

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

Copilot AI review requested due to automatic review settings March 10, 2026 13:53
@mergify mergify bot had a problem deploying to Mergify Merge Protections March 10, 2026 13:53 Failure
@mergify
Copy link
Contributor

mergify bot commented Mar 10, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify mergify bot requested a review from a team March 10, 2026 13:55
@notion-workspace
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 validate command (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.

@mergify
Copy link
Contributor

mergify bot commented Mar 10, 2026

🧪 CI Insights

Here's what we observed from your CI run for be4ceb9.

🟢 All jobs passed!

But CI Insights is watching 👀

@jd
Copy link
Member Author

jd commented Mar 10, 2026

This pull request is part of a stack:

  1. feat(config): add mergify config validate command (add .mergify.yml "lint" option #1010) (#1016) 👈
  2. feat(config): add mergify config simulate command (#1019)

@jd jd marked this pull request as draft March 10, 2026 14:22
@jd jd force-pushed the devs/jd/feat/config-validate/Ib7a8075cd92a62a2a7d761a4eab5e309c914dd21 branch from 68e009f to 01b46c4 Compare March 10, 2026 14:26
@mergify mergify bot had a problem deploying to Mergify Merge Protections March 10, 2026 14:26 Failure
@jd jd force-pushed the devs/jd/feat/config-validate/Ib7a8075cd92a62a2a7d761a4eab5e309c914dd21 branch from 01b46c4 to a0412dc Compare March 10, 2026 14:31
@mergify mergify bot had a problem deploying to Mergify Merge Protections March 10, 2026 14:32 Failure
@jd jd marked this pull request as ready for review March 10, 2026 14:36
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
@jd jd force-pushed the devs/jd/feat/config-validate/Ib7a8075cd92a62a2a7d761a4eab5e309c914dd21 branch from a0412dc to be4ceb9 Compare March 10, 2026 14:39
@mergify mergify bot deployed to Mergify Merge Protections March 10, 2026 14:39 Active
@mergify mergify bot requested a review from a team March 10, 2026 14:53
@mergify
Copy link
Contributor

mergify bot commented Mar 10, 2026

Merge Queue Status

  • Entered queue2026-03-10 16:15 UTC · Rule: default
  • Checks passed · in-place
  • Merged2026-03-10 16:16 UTC · at be4ceb9f9b0c275acd0ff9924f231fd2a7653239

This pull request spent 14 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify bot added the queued label Mar 10, 2026
@mergify mergify bot merged commit bde5044 into main Mar 10, 2026
18 checks passed
@mergify mergify bot deleted the devs/jd/feat/config-validate/Ib7a8075cd92a62a2a7d761a4eab5e309c914dd21 branch March 10, 2026 16:16
@mergify mergify bot removed the queued label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

add .mergify.yml "lint" option

4 participants