fix: normalizing file paths accidentally returning empty file path#453
Conversation
|
@iamogbz mind taking a look? 🙏 🙏 (our bundlewatch links are broken until this if merged, hoping to avoid needing to patch-package) |
|
Thank you for your fix @cheapsteak! I can also reproduce it here – Beraliv/beraliv.dev#440, would be glad to have it merged if it fixes the problem |
|
Sorry for pinging you, but I wanted to check if this PR can be merged to make normalizefilenames option working? Currently I see this in my blog repo CI {"message":"\"results.fullResults[0].filePath\" is not allowed to be empty","path":["results","fullResults",0,"filePath"],"type":"string.empty","context":{"label":"results.fullResults[0].filePath","value":"","key":"filePath"}} |
|
yup that looks like the same error I was getting this PR should fix that |
|
Hi @charpeni ! |
|
@jakebolam any chance you might have time to take a gander? 🙏 |
|
Any updates on this one? |
|
@charpeni @jakebolam Could you please have a look at it? |
|
For anyone else running into this, you can fix this locally yourself with patch-package and applying the changes in this PR yourself as a patch you should end up with a patch file that looks something like this |
Good suggestion, thank you for sharing it! 🧡 I totally forgot about this option! |
Pull Request Test Coverage Report for Build bb5bf160-a3f4-4baf-bdce-d591f7ef67d1Details
💛 - Coveralls |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@semantic-release/github](https://togithub.com/semantic-release/github) | [`10.1.0` -> `10.1.3`](https://renovatebot.com/diffs/npm/@semantic-release%2fgithub/10.1.0/10.1.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [bundlewatch](https://togithub.com/bundlewatch/bundlewatch) | [`0.3.3` -> `0.4.0`](https://renovatebot.com/diffs/npm/bundlewatch/0.3.3/0.4.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [postcss](https://postcss.org/) ([source](https://togithub.com/postcss/postcss)) | [`8.4.39` -> `8.4.40`](https://renovatebot.com/diffs/npm/postcss/8.4.39/8.4.40) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>semantic-release/github (@​semantic-release/github)</summary> ### [`v10.1.3`](https://togithub.com/semantic-release/github/releases/tag/v10.1.3) [Compare Source](https://togithub.com/semantic-release/github/compare/v10.1.2...v10.1.3) ##### Bug Fixes - Revert "fix: failing release due to renamed repository ([#​878](https://togithub.com/semantic-release/github/issues/878))" ([#​887](https://togithub.com/semantic-release/github/issues/887)) ([325952e](https://togithub.com/semantic-release/github/commit/325952e3a9fab8e728ba250890587f6af85cfa9e)) ### [`v10.1.2`](https://togithub.com/semantic-release/github/releases/tag/v10.1.2) [Compare Source](https://togithub.com/semantic-release/github/compare/v10.1.1...v10.1.2) ##### Bug Fixes - failing release due to renamed repository ([#​878](https://togithub.com/semantic-release/github/issues/878)) ([76fdaa3](https://togithub.com/semantic-release/github/commit/76fdaa31cd623a3df1c4e51ae1ed4434a24a2c3e)) ### [`v10.1.1`](https://togithub.com/semantic-release/github/releases/tag/v10.1.1) [Compare Source](https://togithub.com/semantic-release/github/compare/v10.1.0...v10.1.1) ##### Bug Fixes - invalid GraphQL query generated when no release commits are found ([#​876](https://togithub.com/semantic-release/github/issues/876)) ([8ee2744](https://togithub.com/semantic-release/github/commit/8ee2744905e73137b3e24b2f56b37ff4451c32f7)) </details> <details> <summary>bundlewatch/bundlewatch (bundlewatch)</summary> ### [`v0.4.0`](https://togithub.com/bundlewatch/bundlewatch/releases/tag/v0.4.0) [Compare Source](https://togithub.com/bundlewatch/bundlewatch/compare/v0.3.3...v0.4.0) #### What's Changed > \[!WARNING] > The minimum Node version supported is now **16**, but it may work fine with older versions. ##### Features - feat: support mjs and cjs extensions by [@​EdieLemoine](https://togithub.com/EdieLemoine) in [https://github.com/bundlewatch/bundlewatch/pull/460](https://togithub.com/bundlewatch/bundlewatch/pull/460) ##### Bug Fixes and Chores - chore: fix linter by [@​charpeni](https://togithub.com/charpeni) in [https://github.com/bundlewatch/bundlewatch/pull/467](https://togithub.com/bundlewatch/bundlewatch/pull/467) - chore: bump node to `20.15.1` (LTS) by [@​charpeni](https://togithub.com/charpeni) in [https://github.com/bundlewatch/bundlewatch/pull/468](https://togithub.com/bundlewatch/bundlewatch/pull/468) - fix: normalizing file paths accidentally returning empty file path by [@​cheapsteak](https://togithub.com/cheapsteak) in [https://github.com/bundlewatch/bundlewatch/pull/453](https://togithub.com/bundlewatch/bundlewatch/pull/453) - chore: bump `babel` by [@​charpeni](https://togithub.com/charpeni) in [https://github.com/bundlewatch/bundlewatch/pull/469](https://togithub.com/bundlewatch/bundlewatch/pull/469) - `s/messsage/message` by [@​charpeni](https://togithub.com/charpeni) in [https://github.com/bundlewatch/bundlewatch/pull/48](https://togithub.com/bundlewatch/bundlewatch/pull/48) ##### CVEs - build(deps): bump minimist from 1.2.5 to 1.2.8 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/461](https://togithub.com/bundlewatch/bundlewatch/pull/461) - build(deps): bump json5 from 1.0.1 to 1.0.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/459](https://togithub.com/bundlewatch/bundlewatch/pull/459) - build(deps): bump qs from 6.5.2 to 6.5.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/458](https://togithub.com/bundlewatch/bundlewatch/pull/458) - build(deps): bump axios from 0.24.0 to 0.28.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/472](https://togithub.com/bundlewatch/bundlewatch/pull/472) - build(deps): bump braces from 3.0.2 to 3.0.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/471](https://togithub.com/bundlewatch/bundlewatch/pull/471) - build(deps): bump semver from 5.7.1 to 5.7.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/473](https://togithub.com/bundlewatch/bundlewatch/pull/473) - build(deps): bump word-wrap from 1.2.3 to 1.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/474](https://togithub.com/bundlewatch/bundlewatch/pull/474) - build(deps): bump ws from 7.5.6 to 7.5.10 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/475](https://togithub.com/bundlewatch/bundlewatch/pull/475) - build(deps): bump [@​babel/traverse](https://togithub.com/babel/traverse) from 7.16.8 to 7.24.8 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/476](https://togithub.com/bundlewatch/bundlewatch/pull/476) - build(deps): bump minimatch from 3.0.4 to 3.1.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/477](https://togithub.com/bundlewatch/bundlewatch/pull/477) - build(deps): bump hosted-git-info from 2.7.1 to 2.8.9 in the npm_and_yarn group by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bundlewatch/bundlewatch/pull/478](https://togithub.com/bundlewatch/bundlewatch/pull/478) #### New Contributors - [@​EdieLemoine](https://togithub.com/EdieLemoine) made their first contribution in [https://github.com/bundlewatch/bundlewatch/pull/460](https://togithub.com/bundlewatch/bundlewatch/pull/460) 🎉 **Full Changelog**: bundlewatch/bundlewatch@v0.3.3...v0.4.0 </details> <details> <summary>postcss/postcss (postcss)</summary> ### [`v8.4.40`](https://togithub.com/postcss/postcss/blob/HEAD/CHANGELOG.md#8440) [Compare Source](https://togithub.com/postcss/postcss/compare/8.4.39...8.4.40) - Moved to getter/setter in nodes types to help Sass team (by [@​nex3](https://togithub.com/nex3)). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/kkrishguptaa/reseter.css). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
recommend reviewing with whitespace turned off
What kind of change does this PR introduce?
This fixes a bug for projects using a mix of content-hashing and stable filenames where files without a hash are replaced with an empty path
Did you add tests for your changes?
yes
Summary
follow up to #214 and #238
It's possible for a build to contain both filepaths with hashes and filepaths that are stable (without hashes)
If a pattern provided via
normalizeFilenamesdoesn't match the path (e.g. filepath does not contain a hash), currently the normalized path becomes an empty string 😱 additionally, reports fail with a message ofresults.fullResults[0].filePath\" is not allowed to be emptyDoes this PR introduce a breaking change?
no