docs(cluster_agents): fix broken API doc anchors

What does this MR do?

GitLab renamed the section titles on the Kubernetes agent API page, so 11 of the 16 doc links in cluster_agents.go point at anchors that no longer exist. The page opens, but at the top instead of at the method.

This MR points each link at the section that documents the endpoint the method calls:

Method(s) Endpoint Old anchor New anchor
ListAgents, ListAgentsOptions GET /projects/:id/cluster_agents #list-the-agents-for-a-project #list-all-agents
GetAgent GET /projects/:id/cluster_agents/:agent_id #get-details-about-an-agent #retrieve-an-agent
RegisterAgent, RegisterAgentOptions POST /projects/:id/cluster_agents #register-an-agent-with-a-project #create-an-agent
DeleteAgent DELETE /projects/:id/cluster_agents/:agent_id #delete-a-registered-agent #delete-an-agent
ListAgentTokens, ListAgentTokensOptions, AgentToken GET .../cluster_agents/:agent_id/tokens #list-tokens-for-an-agent #list-all-agent-tokens
GetAgentToken GET .../cluster_agents/:agent_id/tokens/:token_id #get-a-single-agent-token #retrieve-an-agent-token

It also removes a copy of the ListAgents doc comment in ClusterAgentsServiceInterface. The same four comment lines (with the same broken link) were there twice in a row.

This is the same kind of fix as !2723 (merged), !2777 (merged) and !2779 (merged).

How was this checked?

  • Every new anchor was checked against the id values in the live HTML of https://docs.gitlab.com/api/cluster_agents/. After the change, all 15 links in the file resolve (before: 11 of 16 broken; one link is removed with the duplicate comment).
  • Each mapping was checked against the route constant and HTTP method the function uses.
  • Comment-only change.

This contribution was prepared with the help of an AI assistant. I reviewed the changes and take responsibility for them.

Merge request reports

Loading
Loading