Get recipe files with revision
-
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. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
This MR adds the conan V2 endpoint to get the recipe files from a package that is also used by V1 with revisions.
References
How to set up and validate locally
-
Switch the
conan_package_revisions_supportfeature flag on.For GDK, open rails console (docs):
gdk rails consoleEnable the feature flag:
# Enable Feature.enable(:conan_package_revisions_support) # Verify Feature.enabled?(:conan_package_revisions_support) -
Get Conan Authentication Token
First, generate a base64-encoded Basic Auth token:
# Replace with your username and PAT echo -n "USERNAME:glpat-YOUR-TOKEN"|base64Then use the output to get a Conan JWT token:
curl --request GET \ --url 'http://localhost:3000/api/v4/projects/<project_id>/packages/conan/v1/users/authenticate' \ --header 'Authorization: Basic <YOUR-BASE64-TOKEN>' -
Make sure there are two recipe files uploaded.
You will have to check out the
333033-put-endpoint-revision-recipe-filebranch to be able to upload recipe files as a prerequisite for manual testing. Follow the instructions here to manually upload 2 recipe files (conanfile.pyandconanmanifest.txt). -
Call the get recipe files endpoint
Make sure you are back on this branch
333033-get-recipe-files-with-revisionand run:curl --request GET \ 'http://localhost:3000/api/v4/projects/<project_id>/packages/conan/v2/conans/upload-v2-package/1.0.0/user/stable/revisions/123456789012345678901234567890ab/files' \ --header 'Authorization: Bearer <YOUR-CONAN-JWT-TOKEN>'that should return status
200 OKand body:{"files":{"conanfile.py":{},"conanmanifest.txt":{}}}
/cc @oceane_scania
Related to #333033 (closed)