8000 Github URL Locator mishandles certain refs · Issue #2697 · kurtosis-tech/kurtosis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Github URL Locator mishandles certain refs #2697
Open
@edobry

Description

@edobry

What's your CLI version?

1.6.0

Description & steps to reproduce

I'm using plan.upload_files to pull in a bash script for execution with plan.run_sh and ran into an issue wherein Kurtosis was unable to pull from a specific git tag due to a bug in the logic that parses the git URL.

The locator I passed to upload_files: github.com/ethereum-optimism/infra/op-signer/gen-local-creds.sh@op-signer/v1.5.0

Note that the version is a tag called op-signer/v1.5.0, which is a valid ref name.

I received this error:

There was an error interpreting Starlark code
Evaluation error: Tried using the passed version 'op-signer' as commit as we couldn't find a tag/branch for it in the repo 'https://github.com/ethereum-optimism/infra.git' but failed

Upon digging thru Kurtosis code to find the error's origin, I encountered the ParseOutTagBranchOrCommit method.

Note this comment block describing the two accepted git URL formats:

	// 1- github.com/kurtosis-tech/sample-dependency-package/main.star@branch-or-version (when is called from cli run command)
	// 2- github.com/kurtosis-tech/sample-dependency-package@branch-or-version/main.star (when is declared in the replace section of the kurtosis.yml file)

I believe this issue occurs due to a faulty assumption in the parsing logic which interprets a . character following a / character in the URL's version segment (everything after the @ character) as being indicative of the post-/ segment referencing a file path, which is incorrect in the case of the tag I'm using op-signer/v1.5.0.

IMO the underlying issue here is that URL format 2 (see above) is fundamentally incompatible with this form of git ref, and should probably be removed. I searched thru the Kurtosis codebase and didn't find any direct references to this form, including not in an of the kurtosis.yml replace directive test cases. I'd submit a PR making this change but I'm not fully confident in this.

Desired behavior

Kurtosis should handle everything following a @ character in a git URL as a version, rather than trying to partially parse it as a file path.

What is the severity of this bug?

Papercut; this bug is frustrating, but I have a workaround.

What area of the product does this pertain to?

CLI: the Command Line Interface

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliFor bugs relating to the CLIpapercut

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0