Skip to content

Admin Dashboard: Get KAS version from server and show a link

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

Part of #458891

Update the KAS version displayed on admin dashboard to:

  1. Switch from the static GITLAB_KAS_VERSION to the GetServerInfo gRPC call

  2. Adjust how the KAS version is displayed on UI according to !163830 (comment 2074925744):

    For the admin panel: We could concatenate the version and git_ref like so <version> (<git_ref), e.g. 17.4.0 (abcdef).

    See the before/after screenshots below.

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

Before After
KAS enabled before When KAS git_ref is a commit: after commit

When KAS git_ref is a tag (simulated via build_info.go): after tag

When getServerInfo RPC failed: failed
KAS not enabled (unchanged) image Not shown under "Components" image Not shown under "Components"

OPTIONAL: Use this table when providing screenshots at relevant viewport sizes. Delete table rows that are not relevant to your changes.

Viewport size Before After
xs (<576px) image image
sm (>=576px) image image
md (>=768px) image image
lg (>=992px) image image
xl (>=1200px) xl before xl after

How to set up and validate locally

  1. Start GDK and visit /admin.
  2. KAS is not enabled by default, so there should not be a GitLab KAS under Components.
  3. Enable KAS in GDK (e.g. gdk config set gitlab_k8s_agent.enabled true && gdk reconfigure && gdk restart rails)
  4. Check the GitLab KAS under `Components. The link should point to a KAS commit.
  5. To test with different git_ref like a git tag, configure run_from_source, modify build_info.go, and gdk restart gitlab-k8s-agent. The getServerInfo RPC should return the value from build_info.go. e.g.
    gdk rails console
    [1] pry(main)> c = Gitlab::Kas::Client.new
    => #<Gitlab::Kas::Client:0x000000014d298738>
    [2] pry(main)> c.get_server_info
    => <Gitlab::Agent::ServerInfo::ServerInfo: version: "v0.0.0", git_ref: "0000000000000000000000000000000000000000">
  6. To simulate a getServerInfo RPC call failure, run gdk stop gitlab-k8s-agent to bring down KAS.

Related to #458891

Edited by Chou Yu Ta

Merge request reports

Loading