Skip to content

Environments dropdown only shows 20 environments

Summary

The Environments dropdown on the metrics dashboard (Operations > Metrics) only shows 20 environments.

Technical implementation

This feature has been implemented behind the searchable_environments_dropdown feature flag

Part Description
Part 1/5 (!23017 (merged)) Added a searchable input to the environments dropdown to do client-side filtering.
Part 2/5 (!23632 (merged)) Use GraphQL endpoint to fetch environments
Part 3/5 (!23659 (merged)) Cleanup of environments REST API occurences
Part 4/5 (!23834 (merged)) Introduce a loading state and server-side filtering
Part 5/5 (!23942 (merged)) Remove the feature flag.

Steps to reproduce

  1. Create more than 20 environments in a project. To do this, go to Operations > Environments > New environment
  2. You will need to setup a cluster and install the Prometheus app on it in order to enable the Environments dropdown on the metrics dashboard.
  3. Go to the metrics dashboard (Operations > Metrics).
  4. Check if the environments dropdown contains all the available environments.

What is the current bug behavior?

The environments dropdown shows only the first 20 environments.

What is the expected correct behavior?

The environments dropdown should show all available environments.

Relevant logs and/or screenshots

In the following video, you can see that the env21 environment is missing in the dropdown. env_dropdown

This is a screenshot of the env21 environment: env_21

Proposal

Introduce a searchable dropdown for environments. For environments, that could look like this:

Screen_Shot_2019-11-13_at_8.45.48_PM

There is an existing measure spec for searchable dropdowns. Though, it's possible we will need to implement gitlab-ui#416 (closed) as a pre-requisite for completing this issue.

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

The environments.json API paginates the list of environments, with 20 environments per page by default. I guess we need to make additional requests for each additional page.

Edited by Dhiraj Bodicherla