Repository navigation
test(gh skill install): skip control character filename test on Windows - #15172
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3ef5a317-d6f3-4f5e-a03e-dffef5fdf9bd
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified with the Windows-only skip for the control-character filename test.
No open issues 🎉
What changed in this PR
This PR prevents a Windows-only setup failure in the skill-install filename-escaping test without changing production behavior.
Changes:
- Adds a Windows-only skip before creating filenames containing ESC characters.
- Documents the filesystem restriction while preserving the test on other platforms.
| File | Description |
|---|---|
pkg/cmd/skills/install/install_test.go |
Imports runtime and adds a documented Windows skip to the control-character filename test. |
Review effort: Balanced
niik
approved these changes
Nov 26, 2026
4 tasks
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.
Description
TestPrintFileTreeEscapesFileNameControlCharactersfails on the Windows CI runners before it reaches the code under test. The test checks thatprintFileTreeescapes terminal control sequences in file and directory names. To do that, it creates a directory nameda\x1b[31mdirand a file namedb\x1b[31mfileon disk. Windows does not allow characters with values 1 through 31 in file or directory names (naming conventions). ESC (\x1b, value 27) is one of them, soos.MkdirAllfails during setup:This PR skips the test on Windows and adds a comment explaining why.
How did you test this change?
Not tested on Windows. I cross-compiled the package's tests for Windows to confirm they build, but I did not run them on a Windows machine. On Linux, the test still runs and passes.
Key points
This does not hide a failure. The skip only applies where the test's scenario cannot exist. A Windows filesystem cannot hold a name containing control characters, so
printFileTreecan never read one there, and the escaping it checks cannot be exercised on Windows. On Linux and macOS, such names are valid and a malicious skill could contain them, so the test still runs there with the same coverage.Notes for reviewers
The whole change is in
pkg/cmd/skills/install/install_test.go. I also searched the other tests for fixtures that create files or directories with control characters in their names and found none. Elsewhere, control characters appear only in file contents, mocked API data, or names that are sanitized before being written.Authorship and follow-up
Who wrote this:
Who answers review comments: