[repo-assist] Add regression test confirming square brackets are escaped in nupkg entries (#3906) - #4420
Open
github-actions[bot] wants to merge 1 commit into
Conversation
…nupkg entries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsyme
marked this pull request as ready for review
September 1, 2026 15:48
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.
🤖 This is an automated contribution from Repo Assist, an automated AI assistant.
Relates to #3906 ("paket pack doesn't escape square brackets").
Investigation
I traced the packing pipeline in
NupkgWriter.fs(ensureValidName, used byaddEntryFromFile) and tested it directly against a file namedfile[0].txt. In the current codebase, this path already produces a correctly escaped zip entry name (file%5B0%5D.txt), not the unescapedfile[0].txtreported in the issue. I could not find any git history since the issue was filed indicating a targeted fix, so this may have been resolved indirectly (e.g. via theUri-based round-trip inensureValidName), or the original repro used a different, older Paket version.Since I can't rule out a repro path I haven't hit, I'm not claiming the issue is fully resolved — but I've added a regression test to lock in and document the current (correct) behavior, so any regression here would be caught immediately.
Change
tests/Paket.Tests/Packaging/NupkgWriterSpecs.fs: packs a folder containingfile[0].txtviaNupkgWriter.Writeand asserts the resulting nupkg's zip entry islib/net461/file%5B0%5D.txt(escaped), not the raw bracketed name.Paket.Tests.fsproj.No production code changes — this is a pure test addition intended to give maintainers confidence and a safety net while they decide on the final disposition of #3906.
Test Status
dotnet test tests/Paket.Tests/Paket.Tests.fsproj --filter "FullyQualifiedName~NupkgWriter": Passed onnet10.0(1/1).net461target aborted in this sandbox only becausemonois not installed here (infrastructure limitation, unrelated to the change) — worth re-running in CI where mono is available.I'll also leave a comment on #3906 summarizing this finding so maintainers can confirm whether the issue is fully closed or if there's another repro path to track down.
Add this agentic workflow to your repo
To install this agentic workflow, run