Skip to content

Commit 7f43838

Browse files
committed
WIP
1 parent 36b8c1c commit 7f43838

File tree

6 files changed

+32
-13
lines changed

6 files changed

+32
-13
lines changed

coderd/healthcheck/accessurl.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ import (
1616
// @typescript-generate AccessURLReport
1717
type AccessURLReport struct {
1818
// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.
19-
Healthy bool `json:"healthy"`
20-
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
21-
Warnings []string `json:"warnings"`
19+
Healthy bool `json:"healthy"`
20+
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
21+
Warnings []string `json:"warnings"`
22+
Dismissed bool `json:"dismissed`
2223

2324
AccessURL string `json:"access_url"`
2425
Reachable bool `json:"reachable"`
@@ -30,6 +31,8 @@ type AccessURLReport struct {
3031
type AccessURLReportOptions struct {
3132
AccessURL *url.URL
3233
Client *http.Client
34+
35+
Dismissed bool
3336
}
3437

3538
func (r *AccessURLReport) Run(ctx context.Context, opts *AccessURLReportOptions) {

coderd/healthcheck/database.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ const (
1818
// @typescript-generate DatabaseReport
1919
type DatabaseReport struct {
2020
// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.
21-
Healthy bool `json:"healthy"`
22-
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
23-
Warnings []string `json:"warnings"`
21+
Healthy bool `json:"healthy"`
22+
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
23+
Warnings []string `json:"warnings"`
24+
Dismissed bool `json:"dismissed`
2425

2526
Reachable bool `json:"reachable"`
2627
Latency string `json:"latency"`
@@ -32,6 +33,8 @@ type DatabaseReport struct {
3233
type DatabaseReportOptions struct {
3334
DB database.Store
3435
Threshold time.Duration
36+
37+
Dismissed bool
3538
}
3639

3740
func (r *DatabaseReport) Run(ctx context.Context, opts *DatabaseReportOptions) {

coderd/healthcheck/derphealth/derp.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ type Report struct {
4747
NetcheckLogs []string `json:"netcheck_logs"`
4848

4949
Error *string `json:"error"`
50+
51+
Dismissed bool `json:"dismissed`
5052
}
5153

5254
// @typescript-generate RegionReport
@@ -95,6 +97,8 @@ type StunReport struct {
9597
}
9698

9799
type ReportOptions struct {
100+
Dismissed bool
101+
98102
DERPMap *tailcfg.DERPMap
99103
}
100104

coderd/healthcheck/healthcheck.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"time"
88

99
"github.com/coder/coder/v2/buildinfo"
10+
"github.com/coder/coder/v2/coderd/database"
1011
"github.com/coder/coder/v2/coderd/healthcheck/derphealth"
1112
"github.com/coder/coder/v2/coderd/healthcheck/health"
1213
"github.com/coder/coder/v2/coderd/util/ptr"
@@ -60,6 +61,8 @@ type ReportOptions struct {
6061
WorkspaceProxy WorkspaceProxyReportOptions
6162

6263
Checker Checker
64+
65+
DB database.Store
6366
}
6467

6568
type defaultChecker struct{}

coderd/healthcheck/websocket.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ type WebsocketReportOptions struct {
1919
APIKey string
2020
AccessURL *url.URL
2121
HTTPClient *http.Client
22+
23+
Dismissed bool
2224
}
2325

2426
// @typescript-generate WebsocketReport
2527
type WebsocketReport struct {
2628
// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.
27-
Healthy bool `json:"healthy"`
28-
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
29-
Warnings []string `json:"warnings"`
29+
Healthy bool `json:"healthy"`
30+
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
31+
Warnings []string `json:"warnings"`
32+
Dismissed bool `json:"dismissed`
3033

3134
Body string `json:"body"`
3235
Code int `json:"code"`

coderd/healthcheck/workspaceproxy.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ type WorkspaceProxyReportOptions struct {
1919
// We pass this in to make it easier to test.
2020
CurrentVersion string
2121
WorkspaceProxiesFetchUpdater WorkspaceProxiesFetchUpdater
22+
23+
Dismissed bool
2224
}
2325

2426
// @typescript-generate WorkspaceProxyReport
2527
type WorkspaceProxyReport struct {
26-
Healthy bool `json:"healthy"`
27-
Severity health.Severity `json:"severity"`
28-
Warnings []string `json:"warnings"`
29-
Error *string `json:"error"`
28+
Healthy bool `json:"healthy"`
29+
Severity health.Severity `json:"severity"`
30+
Warnings []string `json:"warnings"`
31+
Error *string `json:"error"`
32+
Dismissed bool `json:"dismissed`
3033

3134
WorkspaceProxies codersdk.RegionsResponse[codersdk.WorkspaceProxy] `json:"workspace_proxies"`
3235
}

0 commit comments

Comments
 (0)