Skip to content

Use a GraphQL API to fetch environments data

Objective

Discuss possible adoption of GraphQL for Environments & Pods

Problem to solve

In %12.6 the APM team will improve the way we list environments by:

These improvements will result in integration efforts between backend and frontend. We could find a better way evolve the APIs related to our environments.

Intended users

APM frontend team and GitLab community at large.

Further details

Currently, the environments endpoints returns are lot of data that is discarded, as in the case of the "Environments" page:

Or too little, in the "search.json" endpoint:

Proposal

Add GraphQL to fetch and search environments information.

Motivation

  • Depending the view, we require more or less detail of a given environment. Sometimes it links to other pages providing that have more detailed information. Each of this views requires different backend APIs to be created.
  • An "environment" is a nested object which is composed of "pods", this can be represented by the edges to other objects.
  • Search and pagination is already build-in.
  • We extend and dogfood the public GitLab API, as the GraphQL is used in the frontend and a public API.

Permissions and Security

TODO

Challenges

  • Some data of the environments doesn't exist in the database and most be sync'd from the kubernetes cluster.

Documentation

MVC

A possible MVC, could be done by having the list of environments searchable by name for #34021 (closed) with some of the environment properties that are already in the database.

Edited by Miguel Rincon