Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace is stripped out of build name in file spec #74

Closed
darwish opened this issue Jul 28, 2017 · 3 comments
Closed

Whitespace is stripped out of build name in file spec #74

darwish opened this issue Jul 28, 2017 · 3 comments

Comments

@darwish
Copy link

darwish commented Jul 28, 2017

I have a file spec that looks like this:

{
    "files": [
        {
            "aql": {
                "items.find": {
                    "@build.name": "myproject :: mybranch"
                }
            }
        }
    ]
}

This naming convention for builds comes from the Artifactory Plugin for Jenkins

If I use the cli to do a search, the whitespace seems to get removed from my query:

$ JFROG_CLI_LOG_LEVEL=DEBUG jfrog rt s --spec filespec.json
[Info] Searching artifacts...
[Debug] Searching Artifactory using AQL query:  items.find({"@build.name":"myproject::mybranch"}).include("name","repo","path","actual_md5","actual_sha1","size","property","type")

which obviously doesn't find what I'm looking for.

The issue seems to be at https://github.com/JFrogDev/jfrog-cli-go/blob/c1b328e6667df562f4d774bdbd2b1826dc485a66/artifactory/utils/specutils.go#L52. I can confirm that replacing aql.ItemsFind = cliutils.StripChars(str[first:last], "\n\t ") with aql.ItemsFind = str[first:last] fixes the issue, although it loses all minification entirely:

$ JFROG_CLI_LOG_LEVEL=DEBUG ./jfrog rt s --spec ~/code/testengine/tts/filespec.json
[Info] Searching artifacts...
[Debug] Searching Artifactory using AQL query:  items.find( {
                    "@build.name": "myproject :: mybranch"
                }
            ).include("name","repo","path","actual_md5","actual_sha1","size","property","type")
@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 2, 2017

Thanks for reporting this @darwish.
We'll work on fixing this and keep you posted.

@yahavi
Copy link
Member

yahavi commented Aug 3, 2017

Thanks, @darwish.
We fixed this issue.
Here is the link to the commit: 3cbce8c

@darwish darwish closed this as completed Aug 3, 2017
@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 18, 2017

@darwish,
Version 1.10.2 is released and includes this 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

No branches or pull requests

3 participants