Skip to content

Add CI check for invalid characters in file paths#9553

Merged
sseago merged 6 commits intovelero-io:mainfrom
kaovilai:pr-filepath-check
Apr 13, 2026
Merged

Add CI check for invalid characters in file paths#9553
sseago merged 6 commits intovelero-io:mainfrom
kaovilai:pr-filepath-check

Conversation

@kaovilai
Copy link
Copy Markdown
Collaborator

@kaovilai kaovilai commented Feb 19, 2026

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

Copilot AI review requested due to automatic review settings February 19, 2026 19:16
@kaovilai kaovilai added the kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes label Feb 19, 2026
@kaovilai
Copy link
Copy Markdown
Collaborator Author

should fail until #9552 merges

@kaovilai kaovilai force-pushed the pr-filepath-check branch 2 times, most recently from 9a198b9 to 80f49a7 Compare February 19, 2026 19:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml that 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
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
uses: actions/checkout@v6
uses: actions/checkout@v5

Copilot uses AI. Check for mistakes.

# Characters explicitly rejected by Go's fileNameOK
# (path separators / and \ are inherent to paths so we check per-element)
bad_ascii = set('\"' + \"'\" + '*<>?\`|:')
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
bad_ascii = set('\"' + \"'\" + '*<>?\`|:')
bad_ascii = set('\"' + \"'\" + '*<>?\\`|:')

Copilot uses AI. Check for mistakes.
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>
@kaovilai
Copy link
Copy Markdown
Collaborator Author

The following files have characters that are invalid in Go module zip archives:

  changelogs/unreleased/9532-Lyndon-Li‎  — U+200E (LEFT-TO-RIGHT MARK)

To fix, rename the files to remove the problematic characters:

  mv "changelogs/unreleased/9532-Lyndon-Li‎" "changelogs/unreleased/9532-Lyndon-Li" && git add "changelogs/unreleased/9532-Lyndon-Li"
  # or: git mv "changelogs/unreleased/9532-Lyndon-Li‎" "changelogs/unreleased/9532-Lyndon-Li"

@kaovilai
Copy link
Copy Markdown
Collaborator Author

passes now

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.96%. Comparing base (eaef4ea) to head (cfc5826).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@reasonerjt reasonerjt requested a review from Lyndon-Li February 25, 2026 08:23
@kaovilai
Copy link
Copy Markdown
Collaborator Author

kaovilai commented Apr 8, 2026

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>
@sseago sseago merged commit cf605c9 into velero-io:main Apr 13, 2026
57 of 58 checks passed
emirot pushed a commit to emirot/velero that referenced this pull request Apr 14, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has-changelog kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants