Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
79c761e
add db types
f0ssel Sep 19, 2022
511be13
add sdk types
f0ssel Sep 19, 2022
b034b06
add postWorkspaceAppHealth route
f0ssel Sep 19, 2022
419f8e7
Add more healthcheck fields to db schema
f0ssel Sep 19, 2022
8d0517e
healthcheck threshold
f0ssel Sep 19, 2022
719eb4d
add storybooks
f0ssel Sep 19, 2022
1bcac73
typo
f0ssel Sep 19, 2022
ae77f1c
change to warning icon
f0ssel Sep 19, 2022
467a715
fix missing err check
f0ssel Sep 19, 2022
22e275e
gosec
f0ssel Sep 19, 2022
9f84cf2
make fmt
f0ssel Sep 19, 2022
7793799
fix js tests
f0ssel Sep 19, 2022
349116c
add authtest skip
f0ssel Sep 19, 2022
66a6146
rebase
f0ssel Sep 19, 2022
342cbb0
fix insert
f0ssel Sep 19, 2022
c8534d7
whitespace
f0ssel Sep 19, 2022
48c9c76
whitespace
f0ssel Sep 19, 2022
f08718e
healthcheck url
f0ssel Sep 19, 2022
737209f
add proto
f0ssel Sep 19, 2022
466340a
connect proto
f0ssel Sep 20, 2022
25fc5d8
whitespace
f0ssel Sep 20, 2022
e28c366
lint
f0ssel Sep 20, 2022
1c179a4
add workspace agent apps route
f0ssel Sep 20, 2022
6df6998
add myWorkspaceAgent
f0ssel Sep 20, 2022
18fb1a5
noauthorize
f0ssel Sep 20, 2022
dea8070
add postworkspaceagentapphealth
f0ssel Sep 20, 2022
c098980
docs
f0ssel Sep 20, 2022
84c3cf8
add reportAppHealth
f0ssel Sep 20, 2022
7028377
add retry loop
f0ssel Sep 20, 2022
947ff9c
gosimp
f0ssel Sep 20, 2022
047a2e6
fix
f0ssel Sep 20, 2022
26d902a
authorizer
f0ssel Sep 20, 2022
4e65229
workspace app health reporter
f0ssel Sep 20, 2022
9129027
health
f0ssel Sep 20, 2022
e87b48a
fix types
f0ssel Sep 20, 2022
2d5d27a
handle context
f0ssel Sep 20, 2022
fec256d
handle nil interface
f0ssel Sep 21, 2022
a3330c7
add test for agent app health routes
f0ssel Sep 21, 2022
18d05a9
fix test
f0ssel Sep 21, 2022
e6dc742
fix json
f0ssel Sep 21, 2022
1947adc
remove healthcheck_enabled
f0ssel Sep 21, 2022
bb5aa3e
add healthcheck type
f0ssel Sep 22, 2022
d7c2ef2
fix merge
f0ssel Sep 22, 2022
e7a2798
fix nil
f0ssel Sep 22, 2022
b774aee
fix js
f0ssel Sep 22, 2022
8cfef1a
update tf provider
f0ssel Sep 22, 2022
aaabc5a
make fmt
f0ssel Sep 22, 2022
7c70495
add to example
f0ssel Sep 22, 2022
5aedcdc
fix agent logic
f0ssel Sep 22, 2022
2654c1a
fix cast
f0ssel Sep 22, 2022
8b293fe
add apphealth_test.go
f0ssel Sep 23, 2022
6b95ddd
lint
f0ssel Sep 23, 2022
cf53ce6
lint
f0ssel Sep 23, 2022
2f17c5a
lint
f0ssel Sep 23, 2022
e63769b
make tests more reliable
f0ssel Sep 23, 2022
0fbd251
fix migration number
f0ssel Sep 23, 2022
1cde12b
fix migration number
f0ssel Sep 23, 2022
e7f93a9
fix goleak
f0ssel Sep 23, 2022
d304f64
simplify goroutines
f0ssel Sep 23, 2022
634fb64
pr comments
f0ssel Sep 23, 2022
7f3f45a
fix datarace in test
f0ssel Sep 23, 2022
7caea9a
fix another datarace
f0ssel Sep 23, 2022
52ab3dc
dont wait twice
f0ssel Sep 23, 2022
f1ca9c5
cleanup
f0ssel Sep 23, 2022
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 types
  • Loading branch information
f0ssel committed Sep 22, 2022
commit e87b48a4977da0e15068eb7ff042e35d88ebeb5c
3 changes: 3 additions & 0 deletions codersdk/agentconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ var (

// ReconnectingPTYRequest is sent from the client to the server
// to pipe data to a PTY.
// @typescript-ignore ReconnectingPTYRequest
type ReconnectingPTYRequest struct {
Data string `json:"data"`
Height uint16 `json:"height"`
Width uint16 `json:"width"`
}

// @typescript-ignore AgentConn
type AgentConn struct {
*tailnet.Conn
CloseFunc func()
Expand Down Expand Up @@ -70,6 +72,7 @@ func (c *AgentConn) Close() error {
return c.Conn.Close()
}

// @typescript-ignore ReconnectingPTYInit
type ReconnectingPTYInit struct {
ID string
Height uint16
Expand Down
8 changes: 8 additions & 0 deletions codersdk/workspaceagents.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,43 @@ import (
"github.com/coder/retry"
)

// @typescript-ignore GoogleInstanceIdentityToken
type GoogleInstanceIdentityToken struct {
JSONWebToken string `json:"json_web_token" validate:"required"`
}

// @typescript-ignore AWSInstanceIdentityToken
type AWSInstanceIdentityToken struct {
Signature string `json:"signature" validate:"required"`
Document string `json:"document" validate:"required"`
}

// @typescript-ignore ReconnectingPTYRequest
type AzureInstanceIdentityToken struct {
Signature string `json:"signature" validate:"required"`
Encoding string `json:"encoding" validate:"required"`
}

// WorkspaceAgentAuthenticateResponse is returned when an instance ID
// has been exchanged for a session token.
// @typescript-ignore WorkspaceAgentAuthenticateResponse
type WorkspaceAgentAuthenticateResponse struct {
SessionToken string `json:"session_token"`
}

// WorkspaceAgentConnectionInfo returns required information for establishing
// a connection with a workspace.
// @typescript-ignore WorkspaceAgentConnectionInfo
type WorkspaceAgentConnectionInfo struct {
DERPMap *tailcfg.DERPMap `json:"derp_map"`
}

// @typescript-ignore PostWorkspaceAgentVersionRequest
type PostWorkspaceAgentVersionRequest struct {
Version string `json:"version"`
}

// @typescript-ignore WorkspaceAgentMetadata
type WorkspaceAgentMetadata struct {
DERPMap *tailcfg.DERPMap `json:"derpmap"`
EnvironmentVariables map[string]string `json:"environment_variables"`
Expand Down Expand Up @@ -427,6 +434,7 @@ func (c *Client) WorkspaceAgentReconnectingPTY(ctx context.Context, agentID, rec
// Stats records the Agent's network connection statistics for use in
// user-facing metrics and debugging.
// Each member value must be written and read with atomic.
// @typescript-ignore AgentStats
type AgentStats struct {
NumConns int64 `json:"num_comms"`
RxBytes int64 `json:"rx_bytes"`
Expand Down
1 change: 1 addition & 0 deletions codersdk/workspaceapps.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type WorkspaceApp struct {
Health WorkspaceAppHealth `json:"health"`
}

// @typescript-ignore PostWorkspaceAppHealthsRequest
type PostWorkspaceAppHealthsRequest struct {
// Healths is a map of the workspace app name and the health of the app.
Healths map[string]WorkspaceAppHealth
Expand Down
33 changes: 0 additions & 33 deletions site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ export interface APIKey {
readonly lifetime_seconds: number
}

// From codersdk/workspaceagents.go
export interface AWSInstanceIdentityToken {
readonly signature: string
readonly document: string
}

// From codersdk/licenses.go
export interface AddLicenseRequest {
readonly license: string
Expand Down Expand Up @@ -250,11 +244,6 @@ export interface GitSSHKey {
readonly public_key: string
}

// From codersdk/workspaceagents.go
export interface GoogleInstanceIdentityToken {
readonly json_web_token: string
}

// From codersdk/licenses.go
export interface License {
readonly id: number
Expand Down Expand Up @@ -331,16 +320,6 @@ export interface ParameterSchema {
readonly validation_contains?: string[]
}

// From codersdk/workspaceagents.go
export interface PostWorkspaceAgentVersionRequest {
readonly version: string
}

// From codersdk/workspaceapps.go
export interface PostWorkspaceAppHealthsRequest {
readonly Healths: Record<string, WorkspaceAppHealth>
}

// From codersdk/provisionerdaemons.go
export interface ProvisionerDaemon {
readonly id: string
Expand Down Expand Up @@ -581,18 +560,6 @@ export interface WorkspaceAgent {
readonly latency?: Record<string, DERPRegion>
}

// From codersdk/workspaceagents.go
export interface WorkspaceAgentAuthenticateResponse {
readonly session_token: string
}

// From codersdk/workspaceagents.go
export interface WorkspaceAgentConnectionInfo {
// Named type "tailscale.com/tailcfg.DERPMap" unknown, using "any"
// eslint-disable-next-line @typescript-eslint/no-explicit-any
readonly derp_map?: any
}

// From codersdk/workspaceresources.go
export interface WorkspaceAgentInstanceMetadata {
readonly jail_orchestrator: string
Expand Down