Repository navigation
fix(ci): stop ci scopes panicking on a non-ASCII base or head ref - #1882
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
🟡 Changes recommended
Consecutive backticks can still break out of the generated code span.
Review effort: Balanced
Findings: 1
What changed in this PR
Fixes Unicode ref truncation and hardens CI summary rendering.
Changes:
- Truncates refs by characters instead of bytes.
- Escapes ref ranges in Markdown.
- Adds regression tests.
| File | Description |
|---|---|
crates/mergify-ci/src/scopes_detect/outputs.rs |
Updates summary rendering and tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The step summary truncated each ref to 7 bytes, not 7 chars. A branch name whose 7th byte falls inside a multi-byte char (`releasé-2026`) panicked with "byte index 7 is not a char boundary" and exit 101. It runs on every GitHub Actions run (`$GITHUB_STEP_SUMMARY`) and on Buildkite, with the base taken from `--base`, the event's default branch, or BUILDKITE_PULL_REQUEST_BASE_BRANCH. Truncate by chars. While here, escape the ref range like scope names already are: a ref with a backtick or a newline could close the code span and write its own heading into the summary. A ref that is not valid UTF-8 never reaches this code: clap rejects it for `--base`, env reads treat it as unset, and the event JSON is UTF-8. Fixes MRGFY-8855 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Change-Id: I6106bdddb1d2bb288d4bebd4e23d8b8ad6279f63
Member
Author
Revision history
|
sileht
force-pushed
the
devs/sileht/mrgfy-8855-scopes-ref-panic/stop-ci-scopes-panicking-non-ascii-base-head-ref--6106bddd
branch
from
October 5, 2026 14:28
0745cf4 to
e143557
Compare
sileht
marked this pull request as ready for review
October 5, 2026 14:53
JulianMaurin
approved these changes
Oct 5, 2026
remyduthu
approved these changes
Oct 5, 2026
Contributor
Merge Queue Status
This pull request spent 40 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
mergify
Bot
deleted the
devs/sileht/mrgfy-8855-scopes-ref-panic/stop-ci-scopes-panicking-non-ascii-base-head-ref--6106bddd
branch
October 5, 2026 15:01
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.

The step summary truncated each ref to 7 bytes, not 7 chars. A branch
name whose 7th byte falls inside a multi-byte char (
releasé-2026)panicked with "byte index 7 is not a char boundary" and exit 101.
It runs on every GitHub Actions run (
$GITHUB_STEP_SUMMARY) and onBuildkite, with the base taken from
--base, the event's defaultbranch, or BUILDKITE_PULL_REQUEST_BASE_BRANCH.
Truncate by chars. While here, escape the ref range like scope names
already are: a ref with a backtick or a newline could close the code
span and write its own heading into the summary.
A ref that is not valid UTF-8 never reaches this code: clap rejects
it for
--base, env reads treat it as unset, and the event JSON isUTF-8.
Fixes MRGFY-8855
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com