Skip to content

Implement Workspaces Agent Availability query and pagination

Issue: Workspaces Cluster Agents Admin Settings UI (#545241 - closed)

What does this MR do and why?

This MR encompasses step 3 of the work to deliver Workspaces Cluster Agents admin setting:

  • Implement organizationWorkspacesClusterAgents query. The query logic is abstracted from the main component and can be found in get_organization_workspaces_cluster_agents_query.vue. Note: we currently query for the UNMAPPED filter. This is temporary since the ALL filter, which we want to use, is currently still in progress: Add `ALL` filter to cluster agent query (!192329 - merged).
  • Query for mapped agents on mount to determine the availability status of the agents returned from the organizationWorkspacesClusterAgents query. For context, available = mapped and blocked = unmapped.
  • Implement pagination.

References

Screenshots or screen recordings

demo.mov

How to set up and validate locally

Prerequisites:

  1. Go to /rails/features/ in the GDK and enable the workspaces_agents_availability_admin feature flag.
  2. Create some agents:
    • In the GDK, navigate to a project
    • In the left sidebar, select Operate > Kubernetes clusters
    • Click on the Connect a cluster button
    • Enter name of new cluster

Steps

  1. Go to /admin/application_settings/general.
  2. Expand the Workspaces Agent Availability setting
  3. Note the following queries are executed on component mount: mappingStatus and organizationWorkspacesClusterAgents. Unlike organizationWorkspacesClusterAgents, mappingStatus is only executed once and does not refetch during pagination events.
  4. This MR only handles the query aspect– the availability toggle logic and mutation will be handled in a separate MR.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Cindy Halim

Merge request reports

Loading