Extract settings metadata from conaninfo.txt
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
What does this MR do and why?
This MR tries to extract data from Conaninfo.txt and add it to the metadata for the conan package that is being uploaded.
August 2024
A package can contain more than 1 Conaninfo.txt file with different settings on each file. We need to verify that the Conaninfo.txt being read corresponds to the right package, via conan_package_reference, which is the hash that identifies the package and links the package to its files.
Second step on issue #33892 (closed) First Step being Add column in database to support new conan metadata
It follows the idea laid out here
Taken in consideration the suggestions from @10io
This is a copy of !160075 (closed)
This is an 'open conversation' about this feature.
relates also to issue #8248 (closed)
I am open to suggestions and guidances throughout this MR.
The MR description will change
How to set up and validate locally
-
Make sure you have a private project in a private group to use it as the package registry.
-
Modify
app/services/packages/conan/create_package_file_service.rb
# Comment line 36 # add the following: ::Packages::Conan::MetadataExtractionService.new(package_file)
-
Restart your local server
-
Prepare a conan package for upload
-
Open rails console to verify the metadata:
# Grab the last Package created and assign it to a variable (it should be the last package uploaded)
package=Packages::Package.last
# Grab the last package file from that package and assign it to a variable
package_file=package.package_files.last
# this variable contains the information about the package file
# Display the metadata extracted from conaninfo.txt and added to the package file
package_file.package.conan_metadatum
You should see metadata for: os, architecture, build_type, compiler, compiler_version, and compiler_libcxx.
- Revert changes in
app/services/packages/conan/create_package_file_service.rb
- Uncomment line 36.
- Delete the line you added in step 2.
Note: This modification bypasses the asynchronous service worker for testing purposes.
Related to #33892 (closed)
(cc @oceane_scania)