Skip to content

Added package reference and revisions view for conan packages

What does this MR do and why?

This MR allows to see files in conan packages, by recipe revision, package reference and package revision. Allowing to understand what is inside the package.

This MR is part 1 to resolve the issue #540686. Another MR will add support for metadata for package references.

The exact UI is still under discussion in #540686, but I think it is good to start the review process as this MR is my first Front end contribution and my code probably needs improvement to follow the Gitlab standard.

References

Screenshots or screen recordings

Basic package with revision:

Before After
old-ui new-ui2

Basic package without revision:

Before After
no-revision-before no-revision-new2

Complex package with multiple recipe revision and package references:

Before After
multiple-revison-before new-ui-multiple-revision2

Group selection:

This is an example of what happens when you click the package reference checkbox. image

How to set up and validate locally

Go to you Conan packages, by going to your project, then Deploy, Package registry and selecting you Conan package

How to setup a conan package if you do not have one

Install conan v2

To test this MR you need to have conan v2

Verify installation:

conan --version

Should show version 2.x.x

If you have conan v1, you need to uninstall it and install v2:

pip uninstall conan
pip install conan

Switch the conan_package_revisions_support feature flag on.

For GDK, open rails console (docs):

gdk rails console

Enable the feature flag:

# Enable
Feature.enable(:conan_package_revisions_support)

# Verify
Feature.enabled?(:conan_package_revisions_support)

Set up Conan client:

conan remote add gitlab-local http://localhost:3000/api/v4/projects/<PROJECT_ID>/packages/conan
conan remote login gitlab-local
# Enter username and password (glpat)

Create and upload package:

mkdir v2rev && cd v2rev
# name all lowercase

conan new cmake_lib -d name=v2rev -d version=1.2.3

conan create .   --channel=stable --user=gitlab-org+conan

conan upload v2rev/1.2.3@gitlab-org+conan/stable -r gitlab-local

Then you will have a basic package with one recipe revison, package reference and package revision.

If you want to have a more advance setup:

How to create a new recipe revision

Create a new recipe revision by editing the top level conanfile.py. Modify the description for example.

vi conanfile.py

Upload this new recipe revision:

conan create .   --channel=stable --user=gitlab-org+conan

conan upload v2rev/1.2.3@gitlab-org+conan/stable -r gitlab-local

How to create a a new package reference

Create a new package reference for this recipe revision, by setting options:

conan create .   --channel=stable --user=gitlab-org+conan -o shared=True

conan upload v2rev/1.2.3@gitlab-org+conan/stable -r gitlab-local

How to create a new package revision

This is a lot more complex, as this require to have different build result from the same source code, this can happens in some situation. If you really want to have different package revisions, then you can see on this MR in the how to test section how to do so: !191910 (merged)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #519741 (closed)

Edited by Océane Legrand

Merge request reports

Loading