microcks-cli icon indicating copy to clipboard operation
microcks-cli copied to clipboard

fix: parse import-url suffixes from right

Open cotishq opened this issue 6 months ago • 2 comments

Description

  • Fix import-url argument parsing so URLs containing : (scheme/ports/etc.) are preserved when using the optional :true|false[:secret] suffixes.
  • Add unit tests covering ports, paths, query strings, fragments, and secret suffix parsing.
  • Update import-url docs with the new parsing behavior and examples.
  • Make context_test create its testdata/ directory before writing the test config file (stabilizes test runs).

Before:

image

After the fix:

image

Related issue(s)

Fixes #260

cotishq avatar May 05 '26 13:05 cotishq

@Harsh4902 would love your opinion on this and what changes it still requires

cotishq avatar May 05 '26 13:05 cotishq

@Harsh4902 , hey can you please look into it, like what changes it still requires,

cotishq avatar May 12 '26 05:05 cotishq

@cotishq Please resolve conflicts and rebase it as overlapping with #465

Vaishnav88sk avatar Aug 15 '26 12:08 Vaishnav88sk

@Harsh4902 Can we add it to Next milestone?

Vaishnav88sk avatar Aug 15 '26 12:08 Vaishnav88sk

Thanks — you had the right idea! The parse-from-the-right fix landed via #465 (parseImportURLArg), so this is superseded. Note the same class of bug still exists for file paths in import (#352) if you want a follow-up target.

Caesarsage avatar Aug 18 '26 11:08 Caesarsage

@Vaishnav88sk @Caesarsage we're keeping this open and will address it in the next release after 1.0.3.

Harsh4902 avatar Aug 19 '26 05:08 Harsh4902

@Vaishnav88sk rebased it and resolved the merge conflicts too

cotishq avatar Aug 19 '26 15:08 cotishq

@cotishq You might have to make changes in you code as per the latest update in codebase and CI pipelines. I thinks that's why CI is failing.

Harsh4902 avatar Aug 19 '26 16:08 Harsh4902

Thanks @cotishq — I re-checked against master after the rebase. The import-url parsing is already fixed by #465 (which added parseImportURLArg doing the same right-side parse). So this PR's parseImportURLSpecifier + the importURL.go changes duplicate merged code — please drop that half (revert importURL.go, remove parseImportURLSpecifier and its tests, and the importURL.md suffix section).

The part that's still valuable and missing: parseImportFileSpecifier + the cmd/import.go change (the file-path : bug, #352). Keep that, and split the context_test.go MkdirAll tweak into its own PR. Once scoped down and CI green, this is good to merge.

Vaishnav88sk avatar Aug 19 '26 17:08 Vaishnav88sk

@Vaishnav88sk , @Harsh4902 Thanks for the review, i've scoped the PR down as requested:

  1. Dropped the parseImportURLSpecifier + importURL.go changes - reverted importURL.go to upstream (restoring parseImportURLArg), and removed parseImportURLSpecifier and its tests from artifact_specifier.go/test
  2. Kept parseImportFileSpecifier + the cmd/import.go refactor - the right-side parse fix for the file-path : bug (#352)
  3. Reverted the context_test.go MkdirAll tweak

One note: policy-guards is currently failing on master for all branches due to pkg/util/rand/rand_test.go (introduced in #494) missing the copyright header I've opened an issue (#506) for that seperately, please look into it.

cotishq avatar Aug 21 '26 17:08 cotishq