conan icon indicating copy to clipboard operation
conan copied to clipboard

[question] [buildinfo] How to get CI Server url in buildinfo.json

Open EstebanDugueperoux2 opened this issue 3 years ago • 1 comments
trafficstars

Hi conan community,

I'm in context of Gitlab CI Docker using conan official images to build and upload my conan packages to a corporate Artifactory. I have read https://docs.conan.io/en/latest/howtos/generic_ci_artifactory.html#generating-build-info-from-lockfiles-information and this is my CI:


conan_build_info --v2 start $CI_JOB_NAME $CI_JOB_ID
conan lock create conanfile.py --user=unite --channel=testing --lockfile-out=conan.lock
conan create . myPackage/0.0.1@unite/testing --lockfile=conan.lock --lockfile-out=conan.lock
conan upload myPackage/0.0.1@unite/testing --confirm --parallel --all -r $ARTIFACTORY_REPOSITORY
conan_build_info --v2 create buildinfo.json --lockfile conan.lock --user $CONAN_LOGIN_USERNAME --password $CONAN_PASSWORD
conan_build_info --v2 publish buildinfo.json --url http://artifactory.mycorporate.com/artifactory --user $CONAN_LOGIN_USERNAME --password $CONAN_PASSWORD
conan_build_info --v2 stop

But the generated buildinfo.json doesn't contain CI Server url as documented in https://github.com/jfrog/build-info-go/blob/main/buildinfo-schema.json#L73 and consequently no CI Server url is set in Artifactory build page UI.

Does conan_build_info supports all fields of buildinfo.json schema? Does conan_build_info yet maintained? Do you have a better use to have metadata uploaded to Artifactory/XRay for SCA analysis?

Regards.

EstebanDugueperoux2 avatar Sep 21 '22 09:09 EstebanDugueperoux2

Hi @EstebanDugueperoux2,

Thanks for the questions.

The current Conan build_info does not support all the fields from the buildinfo.json schema. We are not updating the Conan 1.X build_info any more because we are focused on Conan 2.0 and we plan to provide a better integration with build_info for Conan 2.X. Probably something not integrated in the Conan client but as the form of a layer of custom commands for CI or something similar. Of course, for this implementation we will try to provide an easy way of setting all of those fields in the schema. If you need to provide some of those fields, I would recommend to add them to the json file generated by Conan.

Currently that's the only way of providing metadata directly from Conan. Maybe you can try to do something custom using the Artifactory API or the JFrog CLI.

Marking this issue for milestone 2.X as it's something we will consider after 2.0 GA.

Hope this helps.

czoido avatar Sep 21 '22 13:09 czoido