Skip to content

Display warning when agent is already blocked or allowed

Issue: FE: Display a warning message when a cluster ag... (#464272 - closed)

What does this MR do and why?

NOTICE This feature is behind the remote_development_namespace_agent_authorization feature flag.

In the Agent Authorization UI, a user can block or allow a cluster agent for creating Workspaces. If the user attempts to change a cluster agent's status to blocked or allowed, but the status was already changed elsewhere, the UI displays a warning message indicating this.

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Description Screenshot
This error appears when the call to the GraphQL API to load agents fail load_agents_error.png
This warning appears when the agent is already allowed or blocked and the user attempts to apply the same status apply mutation warning alert.png

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable the remote_development_namespace_agent_authorization feature flag: rails c && Feature.enable(:remote_development_namespace_agent_authorization)

  2. Follow these instructions to register two cluster agents in the gitlab-org group:

    1. Create a project in the group gitlab-org named workspaces-agents-config.
    2. Create two directories in the project's repository:
      1. .gitlab/agents/remote-dev
      2. .gitlab/agents/remote-dev-two
  3. In each directory, create a file named config.yaml with the following content

    remote_development:
      enabled: true
      dns_zone: workspaces.localdev.me
      # below configuration is optional
      # they override the default values
      network_policy:
        enabled: true
        # if your GDK is configured on a public IP, you don't need to set the `egress` key in this section.
        egress:
        - allow: '0.0.0.0/0'
          except:
          - '10.0.0.0/8'
          - '172.16.0.0/12'
          - '192.168.0.0/16'
        # if your GDK is configured on a different private IP, use that in the line below.
        - allow: '172.16.123.1/32'
    # for debugging locally to increase log verbosity
    observability:
      logging:
        level: debug
        grpc_level: warn
  4. To connect the cluster agents:

    1. In the workspaces-agent-config project, navigate to Operate -> Kubernetes Clusters.
    2. Click the button "Connect to cluster" and select the "remote-dev" agent. Connect the cluster and close the modal dialog. It doesn't matter if the cluster is not connected.
    3. Repeat step 2 for the "remote-dev-two" agent.
  5. Open the URL http://gdk.test:3000/groups/gitlab-org/-/settings/workspaces in two tabs.

  6. In the first tab, allow one of the agents.

  7. In the second tab, allow the same agent. You should see a warning message indicating that the agent has already been allowed.

Edited by Enrique Alcántara

Merge request reports