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 inget_organization_workspaces_cluster_agents_query.vue
. Note: we currently query for theUNMAPPED
filter. This is temporary since theALL
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
andblocked = unmapped
. - Implement pagination.
References
Screenshots or screen recordings
How to set up and validate locally
Prerequisites:
- Go to
/rails/features/
in the GDK and enable theworkspaces_agents_availability_admin
feature flag. - 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
- Go to
/admin/application_settings/general
. - Expand the
Workspaces Agent Availability
setting - Note the following queries are executed on component mount:
mappingStatus
andorganizationWorkspacesClusterAgents
. UnlikeorganizationWorkspacesClusterAgents
,mappingStatus
is only executed once and does not refetch during pagination events. - 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