Skip to content

Commit a31d474

Browse files
committed
feat: include server agent API version in buildinfo
1 parent f0969f9 commit a31d474

File tree

9 files changed

+33
-14
lines changed

9 files changed

+33
-14
lines changed

coderd/apidoc/docs.go

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/deployment.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ func (api *API) deploymentStats(rw http.ResponseWriter, r *http.Request) {
7171
func buildInfo(accessURL *url.URL) http.HandlerFunc {
7272
return func(rw http.ResponseWriter, r *http.Request) {
7373
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.BuildInfoResponse{
74-
ExternalURL: buildinfo.ExternalURL(),
75-
Version: buildinfo.Version(),
76-
DashboardURL: accessURL.String(),
77-
WorkspaceProxy: false,
74+
ExternalURL: buildinfo.ExternalURL(),
75+
Version: buildinfo.Version(),
76+
AgentAPIVersion: AgentAPIVersionREST,
77+
DashboardURL: accessURL.String(),
78+
WorkspaceProxy: false,
7879
})
7980
}
8081
}

codersdk/deployment.go

+4
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,10 @@ type BuildInfoResponse struct {
20032003
DashboardURL string `json:"dashboard_url"`
20042004

20052005
WorkspaceProxy bool `json:"workspace_proxy"`
2006+
2007+
// AgentAPIVersion is the current version of the Agent API (back versions
2008+
// MAY still be supported).
2009+
AgentAPIVersion string `json:"agent_api_version"`
20062010
}
20072011

20082012
type WorkspaceProxyBuildInfo struct {

docs/api/general.md

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/schemas.md

+8-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enterprise/wsproxy/wsproxy.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,11 @@ func (s *Server) DialCoordinator(ctx context.Context) (tailnet.MultiAgentConn, e
475475

476476
func (s *Server) buildInfo(rw http.ResponseWriter, r *http.Request) {
477477
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.BuildInfoResponse{
478-
ExternalURL: buildinfo.ExternalURL(),
479-
Version: buildinfo.Version(),
480-
DashboardURL: s.DashboardURL.String(),
481-
WorkspaceProxy: true,
478+
ExternalURL: buildinfo.ExternalURL(),
479+
Version: buildinfo.Version(),
480+
AgentAPIVersion: coderd.AgentAPIVersionREST,
481+
DashboardURL: s.DashboardURL.String(),
482+
WorkspaceProxy: true,
482483
})
483484
}
484485

site/src/api/typesGenerated.ts

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/testHelpers/entities.ts

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ export const MockProxyLatencies: Record<string, ProxyLatencyReport> = {
194194
};
195195

196196
export const MockBuildInfo: TypesGen.BuildInfoResponse = {
197+
agent_api_version: "2.1",
197198
external_url: "file:///mock-url",
198199
version: "v99.999.9999+c9cdf14",
199200
dashboard_url: "https:///mock-url",

0 commit comments

Comments
 (0)