jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
114 stars 186 forks source link

Artifactory Plugin does not support Conan 2.0 #808

Open jjardina opened 1 year ago

jjardina commented 1 year ago

Describe the bug We are switching our code to use Conan v. 2.0.4 or higher. When we call the following declarative statements, we get an error:

        stage('Artifactory Configuration') {
            steps {
                rtServer(
                    id: 'Artifactory-1',
                    url: 'https://******.jfrog.io/artifactory',   // obscured url for security reasons
                    credentialsId: 'devops_svc_user_pass_jfrog',
                    bypassProxy: true,
                    timeout: 300
                    )

                rtConanClient(
                    id: 'myConanClient',
                    userHome: '/opt/conan'
                    )

                rtConanRemote(
                    name: 'jfrog-repo',
                    serverId: 'Artifactory-1',
                    repo: env.JFROG_REPO,
                    clientId: 'myConanClient',
                    force: true,
                    verifySSL: false
                    )

                rtConanRun(
                    clientId: 'myConanClient',
                    command: 'config install nativetools/ConanConfiguration'
                    )
            }
        }

Error received in Jenkins build:

sh -c "conan config set log.trace_file=/opt/conan/conan_log.log "
13:01:27  usage: conan config [-h] [-v [V]] {home,install,list,show} ...
13:01:27  conan config: error: argument subcommand: invalid choice: 'set' (choose from 'home', 'install', 'list', 'show')
13:01:27  ERROR: Exiting with code: 2
13:01:27  ERROR: Couldn't execute Conan task. RuntimeException: Conan build failed with exit code 2

To Reproduce Use conan 2.0.4 or higher on the build agent and build a conan 2.0 project using jenkins artifactory plugin and declarative syntax.

Expected behavior Should work like it did with conan 1.x

Versions

Additional context Found the offending call in here: https://github.com/jfrog/jenkins-artifactory-plugin/blob/cb9bf0b26fbd91a9b9248e52b21b412dcebf09e2/src/main/java/org/jfrog/hudson/pipeline/common/executors/ConanExecutor.java#L24

Conan v. 2.0 and higher has changed the conan config parameters, https://docs.conan.io/2/reference/commands/config.html .

The conan config set parameter is no longer used with conan 2.0.
I am not sure this step to set the trace log location even needs to exist with the new version of conan?

jjardina commented 1 year ago

Another user opened a duplicate issue. https://github.com/jfrog/jenkins-artifactory-plugin/issues/820 Anyone working on this? Thanks!

gegles commented 1 year ago

Anyone working on this? Thanks!

eyalbe4 commented 1 year ago

The Jenkins Artifactory Plugin will most likely not receive new functionality, since following the introduction of the new next-gen Jenkins JFrog Plugin, it is the component that receives most of the attention when it comes to new functionality. That also includes enhancements to the Artifactory Plugin's DSL. The two plugins can be installed side by side and used together inside the same jobs.

jjardina commented 1 year ago

The Jenkins Artifactory Plugin will most likely not receive new functionality, since following the introduction of the new next-gen Jenkins JFrog Plugin, it is the component that receives most of the attention when it comes to new functionality. That also includes enhancements to the Artifactory Plugin's DSL. The two plugins can be installed side by side and used together inside the same jobs.

That is not a good solution, because the jfrog plugin doesn't support conan at all. I had to work around the artifactory plugin not working with conan 2.0 by using direct conan calls in my build pipeline and using the conan artifactory extension (conan:art commands) to upload build info to jfrog for XRAY analysis. https://github.com/conan-io/conan-extensions/tree/main/extensions/commands/art

Its more granular than the previous plugins but this solution works consistently and is dependable. I doubt I will ever use artifactory or the new jfrog plugin in the future, because of the lack of support from jfrog for conan.