Admin Dashboard: Get KAS version from server and show a link
requested to merge gitlab-community/gitlab:458891-use-serverinfo-grpc-for-admin-dashboard-kas-version into master
-
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:
-
Switch from the static
GITLAB_KAS_VERSION
to theGetServerInfo
gRPC call -
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 | When KAS git_ref is a commit: When KAS git_ref is a tag (simulated via build_info.go ): When getServerInfo RPC failed:
|
|
KAS not enabled (unchanged) | Not shown under "Components" | 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) |
||
sm (>=576px) |
||
md (>=768px) |
||
lg (>=992px) |
||
xl (>=1200px) |
How to set up and validate locally
- Start GDK and visit
/admin
. - KAS is not enabled by default, so there should not be a
GitLab KAS
underComponents
. -
Enable KAS in GDK (e.g.
gdk config set gitlab_k8s_agent.enabled true && gdk reconfigure && gdk restart rails
) - Check the
GitLab KAS
under `Components. The link should point to a KAS commit. - To test with different
git_ref
like a git tag, configure run_from_source, modifybuild_info.go
, andgdk restart gitlab-k8s-agent
. ThegetServerInfo
RPC should return the value frombuild_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">
- To simulate a
getServerInfo
RPC call failure, rungdk stop gitlab-k8s-agent
to bring down KAS.
Related to #458891
Edited by Chou Yu Ta