Get recipe files with revision

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

  1. 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)
  2. Get Conan Authentication Token

    First, generate a base64-encoded Basic Auth token:

    # Replace with your username and PAT
    echo -n "USERNAME:glpat-YOUR-TOKEN"|base64

    Then 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>'
  3. Make sure there are two recipe files uploaded.

    You will have to check out the 333033-put-endpoint-revision-recipe-file branch to be able to upload recipe files as a prerequisite for manual testing. Follow the instructions here to manually upload 2 recipe files (conanfile.py and conanmanifest.txt).

  4. Call the get recipe files endpoint

    Make sure you are back on this branch 333033-get-recipe-files-with-revision and 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 OK and body:

    {"files":{"conanfile.py":{},"conanmanifest.txt":{}}}

/cc @oceane_scania

Related to #333033 (closed)

Edited by Mariana Bocoi

Merge request reports

Loading