Skip to content

XRAY-156157 - Add command line argument and parameter to get configur…#805

Open
VidrevichMichael wants to merge 3 commits into
devfrom
feature/XRAY-156157-workspaces
Open

XRAY-156157 - Add command line argument and parameter to get configur…#805
VidrevichMichael wants to merge 3 commits into
devfrom
feature/XRAY-156157-workspaces

Conversation

@VidrevichMichael

@VidrevichMichael VidrevichMichael commented Jul 21, 2026

Copy link
Copy Markdown
  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....
  • All static analysis checks passed.
  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • Updated the Contributing page / ReadMe page / CI Workflow files if needed.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

Comment thread cli/docs/flags.go
GitThreads = gitPrefix + Threads

UseConfigProfile = "use-config-profile"
Workspace = "workspace, ws"

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.

fable:

🔴 Critical — the flag value is silently dropped

cli/docs/flags.go declares:

Workspace = "workspace, ws"

The "name, alias" syntax is a urfave/cli v1 convention, but the jfrog-cli-core components framework doesn't support it. The conversion layer registers the flag with urfave (which splits it into --workspace and --ws, so parsing and help output look fine), but then reads the value back with the full compound string: fillFlagMaps calls baseContext.String(f.Name) → flagSet.Lookup("workspace, ws") → nil, and IsSet("workspace, ws") is also false (conversionlayer.go:452-459, getValueForStringFlag at conversionlayer.go:480). I confirmed empirically with urfave/cli v1.22.17:

go run . ga --workspace my-ws
→ String("workspace, ws")="" IsSet=false | String("workspace")="my-ws"

So c.GetStringFlagValue(flags.Workspace) in cli/gitcommands.go:62 always returns "" and the entire feature is a no-op from the command line. Notably, no other flag in flags.go uses alias syntax — there's no precedent because it doesn't work.

Fix: Workspace = "workspace". If a short alias is genuinely wanted, it needs framework support first; drop ws for now.

Why tests didn't catch it: the new test calls GetConfigProfileByUrl(...) directly, below the flag layer. A test exercising the components Context → SetWorkspaceName path would have caught this — worth adding alongside the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants