jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
519 stars 224 forks source link

Release Bundle Create command (jf rbc) has an issue with the --project flag when using a spec file that is not "builds" but "pattern" or "aql" #2535

Closed derekscp closed 1 month ago

derekscp commented 2 months ago

Describe the bug

When utilizing the 'jf release-bundle-create' command it results in an error when using 'aql' or 'pattern' in the spec file while there is a --project flag. Using 'builds' does not produce the error. Error: [🚨Error] release bundles creation source only supports the 'exclusions', 'props', 'excludeProps' and 'recursive' fields

Current behavior

We get this error because of the project key. If it does not have the project key it works as expected.

$ jf release-bundle-create --server-id=cloud --project= --signing-key="gpgkey1" --sync=true --spec=specfile.json Release-Bundle-Test 1.0.0 16:38:03 [Debug] JFrog CLI version: 2.56.0 16:38:03 [Debug] OS/Arch: darwin/amd64 16:38:03 [Debug] Sending HTTP GET request to: /artifactory/api/system/version 16:38:03 [Debug] Usage Report: Sending info... 16:38:03 [Debug] Sending HTTP GET request to: /artifactory/api/system/version 16:38:03 [Debug] Artifactory response: 200 16:38:03 [Debug] Artifactory response: 200 16:38:03 [Debug] JFrog Artifactory version is: 7.84.3 16:38:03 [Debug] Sending HTTP POST request to: /artifactory/api/system/usage 16:38:03 [🚨Error] release bundles creation source only supports the 'exclusions', 'props', 'excludeProps' and 'recursive' fields

Reproduction steps

  1. Create a specfile, specfile.json
    {
    "files": [
    {
      "pattern": "<REPO_NAME>/<PATH_TO_FOLDER>/*"
    }
    ]
    }
  2. Run the jfrog cli command to create the release bundle under a project
    $ jf release-bundle-create --server-id=cloud --project=<PROJECT_KEY> --signing-key="gpgkey1" --sync=true --spec=specfile.json Release-Bundle-Test 1.0.0

Expected behavior

I would expect that it should work the same as when the spec file contains a build as the parameter instead of a pattern or aql.

JFrog CLI version

jf version 2.56.0

Operating system type and version

OS/Arch: darwin/amd64

JFrog Artifactory version

7.84.3

JFrog Xray version

n/a

yahavi commented 1 month ago

@derekscp JFrog CLI version 2.56.1 is now, addressing this problem. Keep us posted on whether it fixes the issue for you!

derekscp commented 1 month ago

@yahavi Thank you. This fixes the issue for me.