Skip to content

merge queue: checking main (5331a01) and #12142 together#12155

Closed
mergify[bot] wants to merge 2 commits into
mainfrom
mergify/merge-queue/3d9fb0f836
Closed

merge queue: checking main (5331a01) and #12142 together#12155
mergify[bot] wants to merge 2 commits into
mainfrom
mergify/merge-queue/3d9fb0f836

Conversation

@mergify

@mergify mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request has been checked successfully and will be merged soon. 🎉

Branch main (5331a01) and #12142 are queued together for merge.

This pull request has been created by Mergify to check the mergeability of #12142.
You don't need to do anything. Mergify will close this pull request automatically when it is complete.

Required conditions of queue rule default for merge:

Required conditions to stay in the queue:

---
checking_base_sha: 5331a01e5d030c8c5b1eec3bd24ca59a9856b491
previous_check_retries: []
previous_failed_batches: []
pull_requests:
  - number: 12142
    scopes: []
scopes: []
...

jd and others added 2 commits July 17, 2026 17:59
Docs config snippets are the most-copied content on the site, but nothing
stopped them from drifting out of sync with the real Mergify config schema.
A wrong example erodes trust instantly. This adds CI that extracts every
Mergify config example from the MDX and validates it, so a broken snippet
fails CI instead of silently misleading users.

This started as a spike ("not sure it's possible"). It is possible, cleanly.
The three feasibility risks resolved as follows:

1. Schema source. The repo already vendors the exact schema at
   `public/mergify-configuration-schema.json` (draft 2020-12), and it is kept
   fresh by the automated "chore: sync Mergify JSON Schema files" commits. We
   validate against that in-repo copy — offline, no auth, no network. The
   `mergify config validate` CLI was evaluated and rejected for CI: it fetches
   the schema over the network from docs.mergify.com (the served copy even lags
   the just-synced repo file), which is both flaky and circular — validating the
   docs against a schema served by the docs. It does the same structural
   JSON-Schema check we do, so we lose nothing. It remains the right tool for
   deep, single-config semantic validation locally.

2. Extraction / partial-vs-complete. A block is validated only when it has an
   unindented top-level Mergify key (`queue_rules`, `pull_request_rules`,
   `scopes`, `merge_protections_settings`, ...). Fragments, `...` placeholders,
   GitHub Actions YAML, and `# partial`-marked blocks are skipped automatically.
   For a complete-looking block that must not be validated (deprecated syntax in
   a migration guide), a reader-invisible MDX comment
   `{/* validate-config-examples: skip — why */}` before the fence excludes it.

3. CI shape. A new `config-examples` job in the existing GitHub Actions
   workflow runs `pnpm check:config-examples`, mirroring the other jobs.

Running the validator over the current docs surfaced 111 complete config
examples; 2 were genuinely broken and are fixed here:
- `comment.mdx`: `message: @{{author}} ...` is invalid YAML (leading `@`), now
  quoted.
- `backport.mdx`: `bot_account: {{ author }}` is invalid YAML (flow mapping),
  now quoted.
The 2 deprecated `partition_rules` examples in the partitions→scopes migration
guide are marked skipped.

- Validation is structural only. Mergify's custom string formats
  (`duration`, `template`, ...) are intentionally not enforced — a generic
  JSON-Schema `duration` validator reads it as ISO-8601 and would wrongly reject
  valid values like `checks_timeout: 5 min`.
- Consolidated on a single Node implementation (`scripts/validate-config-examples.mjs`,
  repo-native, with unit + integration tests) and retired the earlier standalone
  Python extractor; the `validate-config-examples` skill now drives the same script.

- `pnpm check:config-examples` — green (111 checked, 2 skipped, 0 invalid)
- `pnpm test` — 73 passing, incl. a negative test proving the validator rejects
  an unknown key (not a no-op)
- `pnpm check` — clean (astro check + eslint + biome)
- actionlint — clean on the updated workflow

Change-Id: Iec4826a97e941255bcfcf0133a654edaf1f07585
@mergify
mergify Bot deployed to Mergify Merge Protections July 20, 2026 07:46 Active
@mergify mergify Bot closed this Jul 20, 2026
@mergify
mergify Bot deleted the mergify/merge-queue/3d9fb0f836 branch July 20, 2026 07:49
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.

1 participant