Skip to content

feat: add app status tracking to the backend #17163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix linting errors and tests
  • Loading branch information
kylecarbs committed Mar 31, 2025
commit 18952f42db4a4bf19c775924eaa3d0e8a00283ab
3 changes: 2 additions & 1 deletion coderd/workspaceagents.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func (api *API) workspaceAgent(rw http.ResponseWriter, r *http.Request) {

var eg errgroup.Group
eg.Go(func() (err error) {
dbApps, err = api.Database.GetWorkspaceAppsByAgentID(ctx, workspaceAgent.ID)
// nolint:gocritic // This is a system restricted operation.
dbApps, err = api.Database.GetWorkspaceAppsByAgentID(dbauthz.AsSystemRestricted(ctx), workspaceAgent.ID)
return err
})
eg.Go(func() (err error) {
Expand Down
2 changes: 1 addition & 1 deletion codersdk/workspaceapps.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type Healthcheck struct {

type WorkspaceAppStatus struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
WorkspaceID uuid.UUID `json:"workspace_id" format:"uuid"`
AgentID uuid.UUID `json:"agent_id" format:"uuid"`
AppID uuid.UUID `json:"app_id" format:"uuid"`
Expand Down
2 changes: 2 additions & 0 deletions site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ export const MockWorkspaceApp: TypesGen.WorkspaceApp = {
},
hidden: false,
open_in: "slim-window",
statuses: [],
};

export const MockWorkspaceAgentLogSource: TypesGen.WorkspaceAgentLogSource = {
Expand Down Expand Up @@ -1371,6 +1372,7 @@ export const MockWorkspace: TypesGen.Workspace = {
healthy: true,
failing_agents: [],
},
latest_app_status: null,
automatic_updates: "never",
allow_renames: true,
favorite: false,
Expand Down
Loading