docs: state that a renamed file counts at both of its paths - #12255
Conversation
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.
Pull request overview
Documents how Mergify treats renamed files when evaluating file-pattern scopes, barrier_files, and condition attributes like files / added-files / removed-files / modified-files, including the note that GitHub’s #files count differs from Mergify’s files list length on renames.
Changes:
- Add an “important behavior” note that renames are matched at both the source and destination paths for scopes and
barrier_files. - Add a conditions reference section explaining rename semantics across
files,added-files,removed-files,modified-files, and#files. - Reinforce barrier behavior in the scopes overview doc.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/content/docs/merge-queue/scopes/file-patterns.mdx | Adds a section explaining that renamed files are matched at both paths for scope detection and barrier_files. |
| src/content/docs/merge-queue/scopes.mdx | Adds a concise note that renames match both paths for barrier_files behavior. |
| src/content/docs/configuration/conditions.mdx | Adds a “Renamed Files” subsection documenting rename semantics for file-related condition attributes and #files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The rename semantics of file-pattern scopes, `barrier_files` and the `files` /
`added-files` / `removed-files` / `modified-files` condition attributes were
written down nowhere, so the only way to learn that a rename is treated as a
removal at the source plus an addition at the destination was to try it.
Document the rule where each surface is described, with the `git mv` example
spelled out attribute by attribute, and note that `#files` is GitHub's own
changed-file count and so does not equal the length of `files` on a pull
request containing a rename.
While verifying the rename example against the engine's actual glob matcher, two
things turned out to be wrong on this page and are fixed here too:
- the rename example used `git mv api/auth.py web/auth.py`, but `web/auth.py` matches
none of the `frontend` patterns (they are `.js`/`.jsx`/`.ts`/`.tsx`), so it reported
one scope, not both;
- the multi-language example declared `apps/web/**/*.{js,jsx,ts,tsx}`. Brace expansion
is not supported by the matcher, so that pattern matched nothing and the `frontend`
scope in that example could never fire. Expanded into one pattern per extension.
Related to MRGFY-8248
Change-Id: I6cda667056c5aef19df77caace5438d458b92c7a
224b54a to
4c0ef93
Compare
Revision history
|
Merge Queue Status
This pull request spent 2 minutes 49 seconds in the queue, including 2 minutes 15 seconds running CI. Required conditions to merge
|
The rename semantics of file-pattern scopes,
barrier_filesand thefiles/added-files/removed-files/modified-filescondition attributes werewritten down nowhere, so the only way to learn that a rename is treated as a
removal at the source plus an addition at the destination was to try it.
Document the rule where each surface is described, with the
git mvexamplespelled out attribute by attribute, and note that
#filesis GitHub's ownchanged-file count and so does not equal the length of
fileson a pullrequest containing a rename.
While verifying the rename example against the engine's actual glob matcher, two
things turned out to be wrong on this page and are fixed here too:
git mv api/auth.py web/auth.py, butweb/auth.pymatchesnone of the
frontendpatterns (they are.js/.jsx/.ts/.tsx), so it reportedone scope, not both;
apps/web/**/*.{js,jsx,ts,tsx}. Brace expansionis not supported by the matcher, so that pattern matched nothing and the
frontendscope in that example could never fire. Expanded into one pattern per extension.
Related to MRGFY-8248