Whitespace at end of filename causes pipeline to fail
Summary
First reported by @jramsay in gitlab-com/www-gitlab-com!48201 (comment 335676486).
In that merge request, a filename had a trailing space, which was causing the build to fail (https://gitlab.com/gitlab-com/www-gitlab-com/-/jobs/536539091#L86):
bad URI(is not URI?): "/releases/posts/2020-05-22-gitlab-13-0-released.html.md "
In his own words:
this was tricky to spot because the merge request diff doesn't show the whitespace at the end of the filename. Without putting quotes around the filename or using
formatting like this
, it's difficult to highlight the problem. […] These are the kind of details that can really help people when they get stuck.
Steps to reproduce
- Set up a CI job that fails if there are trailing whitespaces in filenames.
- Push a filename with a trailing whitespace.
💥
Example Project
- Commit that removes trailing space: gitlab-com/www-gitlab-com!48201 (5d4571f4)
- Failing build: https://gitlab.com/gitlab-com/www-gitlab-com/-/jobs/536539091#L86
What is the current bug behavior?
It's difficult to see if a filename has trailing spaces, which can lead to builds failing. Users may be completely blocked because of this, having to reach out to someone else for assistance. In a better case scenario, they solve it, but finding the problem in the first place delays them significantly.
What is the expected correct behavior?
Trailing spaces should be visible or highlighted in some way that allows users to quickly diagnose the problem and fix it by themselves. In the repository, blob view, diffs, and merge requests.
Output of checks
This bug happens on GitLab.com