Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94c735c

Browse files
committed
feat: add template_active_version_id to workspaces
This reduces a fetch in the VS Code extension when getting the active version update message!
1 parent 6d939b7 commit 94c735c

File tree

8 files changed

+21
-3
lines changed

8 files changed

+21
-3
lines changed

coderd/apidoc/docs.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/oauthpki/oidcpki.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"encoding/base64"
99
"encoding/json"
1010
"encoding/pem"
11-
"fmt"
1211
"io"
1312
"net/http"
1413
"net/url"
@@ -243,7 +242,7 @@ func (src *jwtTokenSource) Token() (*oauth2.Token, error) {
243242
}
244243

245244
if unmarshalError != nil {
246-
return nil, fmt.Errorf("oauth2: cannot unmarshal token: %w", err)
245+
return nil, xerrors.Errorf("oauth2: cannot unmarshal token: %w", err)
247246
}
248247

249248
newToken := &oauth2.Token{
@@ -264,7 +263,7 @@ func (src *jwtTokenSource) Token() (*oauth2.Token, error) {
264263
// decode returned id token to get expiry
265264
claimSet, err := jws.Decode(v)
266265
if err != nil {
267-
return nil, fmt.Errorf("oauth2: error decoding JWT token: %w", err)
266+
return nil, xerrors.Errorf("oauth2: error decoding JWT token: %w", err)
268267
}
269268
newToken.Expiry = time.Unix(claimSet.Exp, 0)
270269
}

coderd/workspaces.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ func convertWorkspace(
11871187
TemplateIcon: template.Icon,
11881188
TemplateDisplayName: template.DisplayName,
11891189
TemplateAllowUserCancelWorkspaceJobs: template.AllowUserCancelWorkspaceJobs,
1190+
TemplateActiveVersionID: template.ActiveVersionID,
11901191
Outdated: workspaceBuild.TemplateVersionID.String() != template.ActiveVersionID.String(),
11911192
Name: workspace.Name,
11921193
AutostartSchedule: autostartSchedule,

codersdk/workspaces.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type Workspace struct {
2828
TemplateDisplayName string `json:"template_display_name"`
2929
TemplateIcon string `json:"template_icon"`
3030
TemplateAllowUserCancelWorkspaceJobs bool `json:"template_allow_user_cancel_workspace_jobs"`
31+
TemplateActiveVersionID uuid.UUID `json:"template_active_version_id" format:"uuid"`
3132
LatestBuild WorkspaceBuild `json:"latest_build"`
3233
Outdated bool `json:"outdated"`
3334
Name string `json:"name"`

docs/api/schemas.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/workspaces.md

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)