Skip to content

Add full recipe search to Conan package repository

Summary

When searching for a conan package using conan search searching for a full package recipe results in a 404 Not Found error.

Steps to reproduce

  1. Create a conan package and upload it to the GitLab remote.
  2. Search for the package only using the package name, not the full recipe and verify it successfully returns the package name
  3. Search for the package by full recipe and a 404 error is received.

Example Project

https://gitlab.com/sabrams/my-package-registry/-/packages/59602

What is the current bug behavior?

A 404 error is returned when searching for a full recipe

What is the expected correct behavior?

A successful response should be returned.

Relevant logs and/or screenshots

conan search Hello/0.1@sabrams+my-package-registry/beta -r=gitlab
DEBUG :conan_api.py   [163]: INIT: Using config '.....conan.conf' [2020-02-27 10:52:40,050]
DEBUG :tracer.py      [155]: CONAN_API: search_packages(query=None,remote_name=gitlab,outdated=False) [2020-02-27 10:52:40,052]
DEBUG :rest_client_common.py[160]: REST: ping: https://gitlab.com/api/v4/packages/conan/v1/ping [2020-02-27 10:52:40,056]
DEBUG :rest_client.py [38]: REST: Cached capabilities for the remote: [] [2020-02-27 10:52:41,406]
DEBUG :rest_client_common.py[185]: REST: get: https://gitlab.com/api/v4/packages/conan/v1/conans/Hello/0.1/sabrams+my-package-registry/beta/search [2020-02-27 10:52:41,406]
DEBUG :rest_client_common.py[36]: REST ERROR: <class 'conans.errors.NotFoundException'> [2020-02-27 10:52:41,484]
ERROR: {"error":"404 Not Found"}. [Remote: gitlab]

Output of checks

This bug happens on GitLab.com

Possible fixes

The name only search hits this api endpoint:

GET https://gitlab.com/api/v4/packages/conan/v1/conans/search?q=Hello

The full recipe search hits a different endpoint:

GET https://gitlab.com/api/v4/packages/conan/v1/conans/Hello/0.1/sabrams+my-package-registry/beta/search

This endpoint is not implemented in the conan package code. To respond to these search requests, the endpoint will need to be added following the conan code

This also returns a different response format from the existing search so additional logic will be needed as well.

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by 🤖 GitLab Bot 🤖