Use Conan recipe as package name in API response
What does this MR do?
Conan packages are a bit different from the other package types dealt with in the GitLab package registry (NPM, Maven, etc). A Conan package has a name
, but in working with Conan, developers deal with the recipe
rather than just the name. This MR updates the package API response to return the recipe
in the name
field so that the conan recipe will be used in place of the name throughout the UI. It also adds an additional attribute conan_package_recipe
so users and the frontend can still access the conan package name as a singular value.
Screenshots
Before:
$ curl -H "Private-Token: <token>" http://localhost:3001/api/v4/projects/17/packages
[
{
"id": 25,
"name": "Hello",
"version": "0.1",
"package_type": "conan",
"_links": {
"web_path": "/root/npm_n2/-/packages/25",
"delete_api_path": "http://127.0.0.1:3001/api/v4/projects/17/packages/25"
},
"created_at": "2020-09-16T20:33:34.316Z",
"tags": []
}
]
After:
$ curl -H "Private-Token: <token>" http://localhost:3001/api/v4/projects/17/packages
[
{
"id": 25,
"name": "Hello/0.1@root+my-conan-proj/stable",
"conan_package_name": "Hello",
"version": "0.1",
"package_type": "conan",
"_links": {
"web_path": "/root/npm_n2/-/packages/25",
"delete_api_path": "http://127.0.0.1:3001/api/v4/projects/17/packages/25"
},
"created_at": "2020-09-16T20:33:34.316Z",
"tags": []
}
]
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Related #239130 (closed)