Skip to content

Package Registry GraphQL API

This issue is dedicated to collect all the necessary work to implement the Package Registry GraphQL API

There is a need for 3 different endpoints

📓 All the values are written in snake_case but they will need to be implemented in pascalCase

Work to be done

  • Project level endpoint returns all the needed data
  • Group level endpoint returns all the needed data
  • Search for list endpoint
  • [-] Sorting for list endpoint
    • Sorting for basic fields
    • Sorting by project name in group query
  • Composer details query
  • Conan details query
  • Maven details query
  • Nuget details query
  • NPM details query
  • PiPy details query
  • Generic Packages details query
  • Ruby Gems details query
  • Terraform details query
  • Debian details query
  • Delete Package
  • Delete package file

Project and Group level package list query

We already have a project level endpoint and a group level one

Both endpoint should support:

  • Search by name
  • Sort by
  • Pagination

Both endpoint should return:

  • id
  • created_at
  • name
  • packag_type
  • updated_at
  • version
  • tags
    • id
    • name
    • created_at
    • updated_at

We should also add a total_packages attribute to the project and group queries

Remaining work

  • add tags attribute to project and group Packages queries
  • add Search
  • add Sort
  • verify if we can use 'normal' pagination and not cursor based one
  • add total_packages attribute to project and group queries

Package details query

We should have a namespace agnostic endpoint that given an id of a package returns its details, we should return:

  • id
  • created_at
  • name
  • package_files
    • created_at
    • download_path
    • file_name
    • size
  • package_type
  • project_id
  • tags (this is npm specific, we should check if is worth to be moved to his own npm metadatum)
    • id
    • name
    • created_at
    • updated_at
  • updated_at
  • version
  • dependency_links
    • name
    • version_pattern
    • target_framework
  • versions (see rest api docs)
  • pipelines (a list of all the pipelines attached to the package)
    • created_at
    • id
    • sha
    • ref
    • git_commit_message
    • user
      • avatar_url
      • name
    • project
      • name
      • web_url
      • pipeline_url
      • commit_url

This is a 1:1 carbon copy of what our controllers are returning, but we should be able to recycle already existing graphqlTypes, for example for user and project for a complete overview please check the pakcage presenter folder: https://gitlab.com/gitlab-org/gitlab/-/tree/a1f81a8843521f501d528a489ca19ffcfdb89c0e/app/presenters/packages

Plus we should have the metadatum of each package type:

Composer

  • target_sha
  • composer_json
    • name
    • type
    • license
    • version

Conan

  • id
  • created_at
  • updated_at
  • package_username
  • package_channel
  • package_name (currently this is returned outside the metadatum, but it should be inside)

Maven

  • id
  • created_at
  • updated_at
  • app_group
  • app_name
  • app_version
  • path

Nuget

  • license_url
  • project_url
  • icon_url

Delete mutation

We also need a mutation that takes in input a package_id and deletes it, we should keep in mind that this action can be ran both from the list and the details page, we may want to consider if to return an updated 'page' for the list.

Edited by Nicolò Maria Mezzopera