Add entry in packages_conan_package_reference when uploaded a new conan package file
What does this MR do and why?
Linked to global task #480355, next step after !167888 (merged)
We are in the process of converting the package_reference as string in conan package file to a reference to another table that contains the reference and some other metadata.
This MR, add an entry in packages_conan_package_reference when a new conan package file is uploaded, if the reference does not exist, and link it to the file.
Note: Reading the data is still done by the old field conan_package_reference, as data still need to be migrated for old package files. This will be done in a future MR.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Supposing you have a conan remote called "gitlab-local" pointing to your local gitlab project. If not you set it up following the documentations: https://docs.gitlab.com/ee/user/packages/conan_repository/#add-a-remote-for-your-project
Create a new conan package
mkdir packageReferenceTestpkg && cd packageReferenceTestpkg
conan new packageReferenceTest/1.2.3@gitlab-org+conan/stable --template=cmake_lib
conan create . gitlab-org+conan/stable
Upload the package
conan upload packageReferenceTest/1.2.3@gitlab-org+conan/stable -r gitlab-local --all
Check that you have no errors and the package is correctly uploaded in your project ( Deploy:Package Registry)
Download the package
First you need to delete the cache:
rm -r ~/.conan/data/packageReferenceTest/
conan install packageReferenceTest/1.2.3@gitlab-org+conan/stable -r gitlab-local
Check that it is downloaded without any issue