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

--exclude-props can't handle wildcard input

Open gangefors opened this issue 1 year ago • 2 comments

Describe the bug

Using wildcard like --exclude-props "myprop=somethi*" will create an invalid AQL returning an error like ... it looks like there is syntax error near the following sub-query: {"$match":"somethi*"}}}], ....

Current behavior

jf rt s "repo" --exclude-props "myprop=somethi*"
15:58:04 [Debug] JFrog CLI version: 2.53.1
15:58:04 [Debug] OS/Arch: linux/amd64
15:58:04 [Debug] Usage info is disabled.
15:58:04 [🔵Info] Searching artifacts...
15:58:04 [Debug] Sending HTTP GET request to: https://artifacts/artifactory/api/system/version
15:58:04 [Debug] Artifactory response: 200
15:58:04 [Debug] JFrog Artifactory version is: 7.55.14
15:58:04 [Debug] Searching Artifactory using AQL query:
 items.find({"$or":[{"@myprop":{"$ne":{"$match":"somethi*"}}}],"$or":[{"$and":[{"repo":"repo","path":{"$match":"*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","sha256","size","type","modified","created","property")
15:58:04 [Debug] Sending HTTP POST request to: https://artifacts.se.axis.com/artifactory/api/search/aql
15:58:04 [🚨Error] server response: 400
Failed to parse query: items.find({"$or":[{"@myprop":{"$ne":{"$match":"somethi*"}}}],"$or":[{"$and":[{"repo":"repo","path":{"$match":"*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","sha256","size","type","modified","created","property"), it looks like there is syntax error near the following sub-query: {"$match":"somethi*"}}}],"$or":[{"$and":[{"repo":"repo","path":{"$match":"*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","sha256","size","type","modified","created","property")
15:58:04 [🚨Error] server response: 400
Failed to parse query: items.find({"$or":[{"@myprop":{"$ne":{"$match":"somethi*"}}}],"$or":[{"$and":[{"repo":"repo","path":{"$match":"*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","sha256","size","type","modified","created","property"), it looks like there is syntax error near the following sub-query: {"$match":"somethi*"}}}],"$or":[{"$and":[{"repo":"repo","path":{"$match":"*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","sha256","size","type","modified","created","property")

Reproduction steps

jf rt s "repo" --exclude-props "myprop=somethi*"

Expected behavior

jf rt s "repo" --exclude-props "myprop=somethi*" should create an AQL using $nmatch and not $ne+$match.

Example: {"@myprop":{"$ne":{"$match":"somethi*"}}} should be {"@myprop":{"$nmatch":"somethi*"}}

JFrog CLI version

2.53.1

Operating system type and version

linux/amd64

JFrog Artifactory version

7.55.14

JFrog Xray version

No response

gangefors avatar Mar 01 '24 15:03 gangefors

This issue has been marked as stale due to 6 months of inactivity. As part of our effort to address every issue properly, please feel free to remove the stale label or keep this issue active by leaving a comment. Otherwise, it will be closed in 7 days

github-actions[bot] avatar Feb 28 '25 07:02 github-actions[bot]

If this is fixed, then link to the commit that solves it. Until then, this is still an issue.

gangefors avatar Feb 28 '25 12:02 gangefors

This issue has been marked as stale due to 6 months of inactivity. As part of our effort to address every issue properly, please feel free to remove the stale label or keep this issue active by leaving a comment. Otherwise, it will be closed in 7 days

github-actions[bot] avatar Sep 09 '25 00:09 github-actions[bot]

This issue was closed due to 7 days of inactivity after being marked as stale. Feel free to reopen it if it remains relevant.

github-actions[bot] avatar Sep 16 '25 00:09 github-actions[bot]