Add CI check for invalid characters in file paths#9553
Add CI check for invalid characters in file paths#9553sseago merged 6 commits intovelero-io:mainfrom
Conversation
|
should fail until #9552 merges |
9a198b9 to
80f49a7
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub Actions workflow that validates file paths in pull requests to ensure they don't contain characters that are rejected by Go's module zip format. This preventive check addresses the issue encountered in PR #9552 where a changelog file contained an invisible U+200E LEFT-TO-RIGHT MARK character, causing build failures for downstream consumers.
Changes:
- Added new CI workflow
pr-filepath-check.ymlthat runs on all pull requests - Implements validation logic using Python to check for shell special characters, path separators, and non-letter Unicode characters
- Provides clear error messages with GitHub Actions annotations when invalid characters are detected
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| steps: | ||
|
|
||
| - name: Check out the code | ||
| uses: actions/checkout@v6 |
There was a problem hiding this comment.
The checkout action version should be consistent with other workflows in the repository. All other workflows use actions/checkout@v5, but this workflow uses @v6. For consistency, this should be changed to @v5 unless there's a specific requirement for v6.
| uses: actions/checkout@v6 | |
| uses: actions/checkout@v5 |
|
|
||
| # Characters explicitly rejected by Go's fileNameOK | ||
| # (path separators / and \ are inherent to paths so we check per-element) | ||
| bad_ascii = set('\"' + \"'\" + '*<>?\`|:') |
There was a problem hiding this comment.
The comment on line 20 mentions that backslash \ should be rejected, but the bad_ascii set on line 35 does not include it. According to Go's module zip specification, backslash is indeed a rejected character. Add \\ to the bad_ascii set to match the documented behavior.
| bad_ascii = set('\"' + \"'\" + '*<>?\`|:') | |
| bad_ascii = set('\"' + \"'\" + '*<>?\\`|:') |
Go's module zip rejects filenames containing certain characters (shell special chars like " ' * < > ? ` |, path separators : \, and non-letter Unicode such as control/format characters). This caused a build failure when a changelog file contained an invisible U+200E LEFT-TO-RIGHT MARK (see PR vmware-tanzu#9552). Add a GitHub Actions workflow that validates all tracked file paths on every PR to catch these issues before they reach downstream consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
80f49a7 to
6d18d9b
Compare
|
|
passes now |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9553 +/- ##
=======================================
Coverage 60.96% 60.96%
=======================================
Files 384 384
Lines 36595 36595
=======================================
Hits 22310 22310
Misses 12676 12676
Partials 1609 1609 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
guys, filename is malforming again.. @Lyndon-Li what's going on with your changelog :/ |
Remove LEFT-TO-RIGHT MARK unicode characters from changelog filenames that would cause Go module zip failures. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
* Add CI check for invalid characters in file paths Go's module zip rejects filenames containing certain characters (shell special chars like " ' * < > ? ` |, path separators : \, and non-letter Unicode such as control/format characters). This caused a build failure when a changelog file contained an invisible U+200E LEFT-TO-RIGHT MARK (see PR velero-io#9552). Add a GitHub Actions workflow that validates all tracked file paths on every PR to catch these issues before they reach downstream consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> * Fix changelog filenames containing invisible U+200E characters Remove LEFT-TO-RIGHT MARK unicode characters from changelog filenames that would cause Go module zip failures. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> --------- Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Happy <yesreply@happy.engineering> Signed-off-by: nolanemirot <nolan.emirot@broadcom.com>
Go's module zip rejects filenames containing certain characters (shell
special chars like " ' * < > ? ` |, path separators : , and non-letter
Unicode such as control/format characters). This caused a build failure
when a changelog file contained an invisible U+200E LEFT-TO-RIGHT MARK
(see PR #9552).
Add a GitHub Actions workflow that validates all tracked file paths on
every PR to catch these issues before they reach downstream consumers.
Also fixes 7 existing changelog filenames on main containing invisible U+200E characters.
Cherry-picks to release branches
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Responses generated with Claude