feat(config): find the configuration under the .yaml spelling - #1855
Conversation
Pretty much every other YAML configuration file accepts the `.yaml` extension; ours only ever looked for `.yml`, so a repository that spells it `.mergify.yaml` read as "no configuration file" — in `mergify config validate`, in `config simulate`, and in `mergify ci scopes`. The search list now carries both spellings at each of the three conventional locations. The order is the existing location order, with `.yml` ahead of `.yaml` at each location, and the first file found still wins — so nothing moves for a repository that has one file today. A repository carrying more than one now gets a warning on stderr naming the file in use and the ones ignored. That case was already reachable (`.mergify.yml` next to `.github/mergify.yml`) and silent; doubling the candidates makes it likely enough to be worth saying out loud. An explicit `--config-file` never warns: the file was named, nothing is being ignored. `ci scopes` and the `--config` / `--config-file` help text each kept their own copy of the list. They read the resolver's list now — the help strings are built from `DEFAULT_CONFIG_PATHS` — so the surfaces cannot drift apart again. The list's doc comment also stops pointing at `mergify_cli/ci/detector.py`, which the Rust port deleted. The engine learns the same order in MRGFY-9532. Merging this is safe at any time, but the next CLI *release* should wait until that deploy is live: until then `config validate` would approve a `.yaml` file that production still ignores. MRGFY-9533 Fixes #1849 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Change-Id: I23d279e08b3ff851fd4397cec253b4e450cb91db
Merge Protections🟢 All 6 merge protections satisfied — ready to merge. Show 6 satisfied protections🟢 🤖 Continuous Integration
🟢 👀 Review Requirements
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 Reviews
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Adds .yaml configuration discovery while preserving .yml precedence and warning about ignored files.
Changes:
- Centralizes six candidate paths and resolution warnings.
- Updates config commands,
ci scopes, help text, snapshots, and documentation. - Adds resolver tests for detection and precedence.
| File | Summary |
|---|---|
skills/mergify-config/SKILL.md |
Documents supported paths and precedence. |
crates/mergify-config/src/validate.rs |
Uses warning-aware resolution. |
crates/mergify-config/src/simulate.rs |
Uses warning-aware resolution. |
crates/mergify-config/src/paths.rs |
Implements shared resolution, warnings, and tests. |
crates/mergify-cli/src/snapshots/mergify__tests__cli_schema_golden.snap |
Updates CLI schema snapshots. |
crates/mergify-cli/src/main.rs |
Builds help text from the shared path list. |
crates/mergify-ci/src/scopes_detect/mod.rs |
Shares configuration discovery. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Not yet, no — that is MRGFY-9532, queued right behind this one. This PR only changes where the CLI looks on disk, so it can merge whenever. What has to wait is the release: until the engine deploy is live, If you would rather this did not sit on main until the engine side lands, say so and I will hold it. |
Merge Queue Status
This pull request spent 9 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Pretty much every other YAML configuration file accepts the
.yamlextension; ours only ever looked for
.yml, so a repository thatspells it
.mergify.yamlread as "no configuration file" — inmergify config validate, inconfig simulate, and inmergify ci scopes.The search list now carries both spellings at each of the three
conventional locations. The order is the existing location order,
with
.ymlahead of.yamlat each location, and the first filefound still wins — so nothing moves for a repository that has one
file today.
A repository carrying more than one now gets a warning on stderr
naming the file in use and the ones ignored. That case was already
reachable (
.mergify.ymlnext to.github/mergify.yml) andsilent; doubling the candidates makes it likely enough to be worth
saying out loud. An explicit
--config-filenever warns: the filewas named, nothing is being ignored.
ci scopesand the--config/--config-filehelp text eachkept their own copy of the list. They read the resolver's list now
— the help strings are built from
DEFAULT_CONFIG_PATHS— so thesurfaces cannot drift apart again. The list's doc comment also
stops pointing at
mergify_cli/ci/detector.py, which the Rust portdeleted.
The engine learns the same order in MRGFY-9532. Merging this is
safe at any time, but the next CLI release should wait until that
deploy is live: until then
config validatewould approve a.yamlfile that production still ignores.MRGFY-9533
Fixes #1849
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com