Skip to content

docs: state that a renamed file counts at both of its paths - #12255

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/sileht/scopes-rename-previous-path/state-renamed-file-counts-paths--6cda6670
Jul 30, 2026
Merged

docs: state that a renamed file counts at both of its paths#12255
mergify[bot] merged 1 commit into
mainfrom
devs/sileht/scopes-rename-previous-path/state-renamed-file-counts-paths--6cda6670

Conversation

@sileht

@sileht sileht commented Jul 29, 2026

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings July 29, 2026 11:08
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections July 29, 2026 11:08 Failure
@sileht
sileht marked this pull request as ready for review July 29, 2026 11:09
@mergify

mergify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • author = mergify-ci-bot

🟢 Enforce conventional commit

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

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

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team July 29, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/content/docs/merge-queue/scopes/file-patterns.mdx Outdated
jd
jd previously approved these changes Jul 29, 2026
@mergify
mergify Bot requested a review from a team July 29, 2026 11:20
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
@sileht
sileht force-pushed the devs/sileht/scopes-rename-previous-path/state-renamed-file-counts-paths--6cda6670 branch from 224b54a to 4c0ef93 Compare July 30, 2026 09:24
@sileht

sileht commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial 224b54a 2026-07-30 09:24 UTC
2 content 224b54a → 4c0ef93 2026-07-30 09:24 UTC

@mergify
mergify Bot dismissed jd’s stale review July 30, 2026 09:25

Pull request has been modified.

@mergify
mergify Bot deployed to Mergify Merge Protections July 30, 2026 09:25 Active
@mergify
mergify Bot requested a review from a team July 30, 2026 09:44
@mergify

mergify Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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

@mergify mergify Bot added the queued label Jul 30, 2026
@mergify
mergify Bot merged commit ac6dc16 into main Jul 30, 2026
10 of 17 checks passed
@mergify
mergify Bot deleted the devs/sileht/scopes-rename-previous-path/state-renamed-file-counts-paths--6cda6670 branch July 30, 2026 09:48
@mergify mergify Bot removed the queued label Jul 30, 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.

5 participants