Repository navigation
fix(ci): pin non-UTF-8 scope paths to the name GitHub reports - #1879
Merged
Conversation
Contributor
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
The documented behavior and regression coverage consistently preserve engine-compatible path handling.
Review effort: Balanced
Findings: None
What changed in this PR
Clarifies intentional lossy decoding of non-UTF-8 Git paths to match GitHub’s files API behavior.
Changes:
- Documents non-ASCII glob parity limitations.
- Adds isolated Git helpers and regression coverage for Latin-1 and Shift-JIS paths.
- Removes stale Python-port references.
| File | Description |
|---|---|
crates/mergify-ci/src/scopes_detect/matching.rs |
Documents non-ASCII glob differences. |
crates/mergify-ci/src/scopes_detect/changed_files.rs |
Explains lossy decoding and adds regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`mergify ci scopes` decodes `git diff` output lossily, so a Latin-1
`critical/caf\xe9.txt` reaches the scope globs as
`critical/caf\u{FFFD}.txt`. The ticket read that as corruption and
leaned toward hard-erroring like `mergify_stack`'s `run_git_capture`.
It is not corruption. The engine scopes a pull request from GitHub's
files API, and that API reports the same path with the same U+FFFD
replacement (checked on a sandbox repository holding a Latin-1 and a
Shift-JIS name). The lossy decode is therefore the name the engine
matches. An error would fail CI on a pull request the engine scopes
fine, and no pattern in the UTF-8 YAML config can spell the raw bytes.
Keep the decode, say why in the doc comment that used to describe it
as a known defect, and pin both probed names in a test so a later
switch to strict decoding fails loudly. The test helpers now also drop
GIT_INDEX_FILE and friends, since the new one writes the index
directly.
What still differs on such paths, and on any non-ASCII path, is glob
semantics: globset's `?` and `[...]` match bytes, the engine's match
characters, so `caf?.txt` misses `caf\u{FFFD}.txt` here and hits it
there. That is MRGFY-10066; matching.rs no longer claims exact parity.
Fixes MRGFY-8289
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I37852b3d50345f42b6dfe8cca6e1b36c8858a3fb
sileht
force-pushed
the
devs/sileht/mrgfy-8289-scopes-non-utf8-paths/pin-non-utf-8-scope-paths-name-github-reports--37852b3d
branch
from
October 5, 2026 12:53
ce020e1 to
5183302
Compare
Member
Author
Revision history
|
JulianMaurin
approved these changes
Oct 5, 2026
remyduthu
approved these changes
Oct 5, 2026
Contributor
Merge Queue Status
This pull request spent 9 minutes 41 seconds in the queue, including 8 minutes 57 seconds running CI. Required conditions to merge
|
This was referenced Oct 5, 2026
mergify
Bot
deleted the
devs/sileht/mrgfy-8289-scopes-non-utf8-paths/pin-non-utf-8-scope-paths-name-github-reports--37852b3d
branch
October 5, 2026 15:10
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mergify ci scopesdecodesgit diffoutput lossily, so a Latin-1critical/caf\xe9.txtreaches the scope globs ascritical/caf\u{FFFD}.txt. The ticket read that as corruption andleaned toward hard-erroring like
mergify_stack'srun_git_capture.It is not corruption. The engine scopes a pull request from GitHub's
files API, and that API reports the same path with the same U+FFFD
replacement (checked on a sandbox repository holding a Latin-1 and a
Shift-JIS name). The lossy decode is therefore the name the engine
matches. An error would fail CI on a pull request the engine scopes
fine, and no pattern in the UTF-8 YAML config can spell the raw bytes.
Keep the decode, say why in the doc comment that used to describe it
as a known defect, and pin both probed names in a test so a later
switch to strict decoding fails loudly. The test helpers now also drop
GIT_INDEX_FILE and friends, since the new one writes the index
directly.
What still differs on such paths, and on any non-ASCII path, is glob
semantics: globset's
?and[...]match bytes, the engine's matchcharacters, so
caf?.txtmissescaf\u{FFFD}.txthere and hits itthere. That is MRGFY-10066; matching.rs no longer claims exact parity.
Fixes MRGFY-8289
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com