XRAY-156157 - Add command line argument and parameter to get configur…#805
Open
VidrevichMichael wants to merge 3 commits into
Open
XRAY-156157 - Add command line argument and parameter to get configur…#805VidrevichMichael wants to merge 3 commits into
VidrevichMichael wants to merge 3 commits into
Conversation
VidrevichMichael
requested a deployment
to
frogbot
July 21, 2026 10:40 — with
GitHub Actions
Waiting
VidrevichMichael
requested a deployment
to
frogbot
July 22, 2026 07:44 — with
GitHub Actions
Waiting
VidrevichMichael
requested a deployment
to
frogbot
July 22, 2026 12:29 — with
GitHub Actions
Waiting
Jordanh1996
reviewed
Jul 23, 2026
| GitThreads = gitPrefix + Threads | ||
|
|
||
| UseConfigProfile = "use-config-profile" | ||
| Workspace = "workspace, ws" |
Contributor
There was a problem hiding this comment.
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.
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.
devbranch.go vet ./....go fmt ./....