Skip to content

test: cover ipfs get paths containing closing bracket - #11359

Merged
lidel merged 6 commits into
ipfs:masterfrom
purusachdeva:fix-9369-get-closing-bracket-test
Jun 30, 2026
Merged

test: cover ipfs get paths containing closing bracket#11359
lidel merged 6 commits into
ipfs:masterfrom
purusachdeva:fix-9369-get-closing-bracket-test

Conversation

@purusachdeva

Copy link
Copy Markdown
Contributor

Adds regression coverage for #9369.

This verifies that ipfs get can retrieve a UnixFS path whose final path segment is ], both through the command path parser and the sharness ipfs get flow.

@purusachdeva
purusachdeva requested a review from a team as a code owner June 8, 2026 19:26
@lidel

lidel commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Triage note:

  • this PR should likely use a matrix to test more than just this one character
  • see if we have enough cross-platform test coverage for allowed characters on dag creation and on dag read
  • see if that could live in "notes for implementers" at https://specs.ipfs.tech/unixfs/

Comment thread core/commands/cmdutils/utils_test.go Outdated
})

t.Run("CID with closing bracket path segment is converted correctly", func(t *testing.T) {
cidWithPath := "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@purusachdeva this PR should likely use a matrix to test more than just this one character, could you add other ones that could cause problems across linux/windows/macos filesystems

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lidel Thanks! I updated this to use a matrix of punctuation path segments that are valid across Linux, Windows, and macOS filesystems. The sharness test now covers both DAG creation via ipfs add -r and DAG read via ipfs get "$CID/$name" for those segments.

@purusachdeva
purusachdeva force-pushed the fix-9369-get-closing-bracket-test branch from 40dcdc6 to 0497a0f Compare June 9, 2026 19:57
@gammazero
gammazero requested a review from lidel June 23, 2026 14:24
lidel added 2 commits June 30, 2026 01:22
ipfs get must retrieve UnixFS paths whose segments contain
punctuation that is valid on Linux, macOS, and Windows but is
sensitive to a POSIX shell (issue ipfs#9369, where a "]" segment
failed). AGENTS.md prefers test/cli for new integration tests,
and driving ipfs directly avoids the shell-quoting limits of the
sharness loop.

- add test/cli/get_test.go: add a directory with one file per
  segment, then get each "<cid>/<segment>" and compare bytes,
  exercised both offline and against a daemon
- cover the apostrophe segment, which the single-quoted sharness
  test body could not include
- drop the now-redundant punctuation block from t0090-get.sh
@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Jun 29, 2026
@lidel
lidel merged commit d8d0df6 into ipfs:master Jun 30, 2026
27 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does NOT require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants