Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix!: removefailing_sections from healthcheck#13426

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 1 commit intomainfromrmfailingsections
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
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
7 changes: 0 additions & 7 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

7 changes: 0 additions & 7 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

16 changes: 8 additions & 8 deletionscoderd/healthcheck/healthcheck.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -156,27 +156,27 @@ func Run(ctx context.Context, opts *ReportOptions) *healthsdk.HealthcheckReport
wg.Wait()

report.Time = time.Now()
report.FailingSections= []healthsdk.HealthSection{}
failingSections := []healthsdk.HealthSection{}
if report.DERP.Severity.Value() > health.SeverityWarning.Value() {
report.FailingSections = append(report.FailingSections, healthsdk.HealthSectionDERP)
failingSections = append(failingSections, healthsdk.HealthSectionDERP)
}
if report.AccessURL.Severity.Value() > health.SeverityOK.Value() {
report.FailingSections = append(report.FailingSections, healthsdk.HealthSectionAccessURL)
failingSections = append(failingSections, healthsdk.HealthSectionAccessURL)
}
if report.Websocket.Severity.Value() > health.SeverityWarning.Value() {
report.FailingSections = append(report.FailingSections, healthsdk.HealthSectionWebsocket)
failingSections = append(failingSections, healthsdk.HealthSectionWebsocket)
}
if report.Database.Severity.Value() > health.SeverityWarning.Value() {
report.FailingSections = append(report.FailingSections, healthsdk.HealthSectionDatabase)
failingSections = append(failingSections, healthsdk.HealthSectionDatabase)
}
if report.WorkspaceProxy.Severity.Value() > health.SeverityWarning.Value() {
report.FailingSections = append(report.FailingSections, healthsdk.HealthSectionWorkspaceProxy)
failingSections = append(failingSections, healthsdk.HealthSectionWorkspaceProxy)
}
if report.ProvisionerDaemons.Severity.Value() > health.SeverityWarning.Value() {
report.FailingSections = append(report.FailingSections, healthsdk.HealthSectionProvisionerDaemons)
failingSections = append(failingSections, healthsdk.HealthSectionProvisionerDaemons)
}

report.Healthy = len(report.FailingSections) == 0
report.Healthy = len(failingSections) == 0

// Review healthcheck sub-reports.
report.Severity = health.SeverityOK
Expand Down
68 changes: 24 additions & 44 deletionscoderd/healthcheck/healthcheck_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,11 +49,10 @@ func TestHealthcheck(t *testing.T) {
t.Parallel()

for _, c := range []struct {
name string
checker *testChecker
healthy bool
severity health.Severity
failingSections []healthsdk.HealthSection
name string
checker *testChecker
healthy bool
severity health.Severity
}{{
name: "OK",
checker: &testChecker{
Expand DownExpand Up@@ -93,9 +92,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
healthy: true,
severity: health.SeverityOK,
failingSections: []healthsdk.HealthSection{},
healthy: true,
severity: health.SeverityOK,
}, {
name: "DERPFail",
checker: &testChecker{
Expand DownExpand Up@@ -135,9 +133,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
healthy: false,
severity: health.SeverityError,
failingSections: []healthsdk.HealthSection{healthsdk.HealthSectionDERP},
healthy: false,
severity: health.SeverityError,
}, {
name: "DERPWarning",
checker: &testChecker{
Expand DownExpand Up@@ -178,9 +175,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
healthy: true,
severity: health.SeverityWarning,
failingSections: []healthsdk.HealthSection{},
healthy: true,
severity: health.SeverityWarning,
}, {
name: "AccessURLFail",
checker: &testChecker{
Expand DownExpand Up@@ -220,9 +216,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
healthy: false,
severity: health.SeverityWarning,
failingSections: []healthsdk.HealthSection{healthsdk.HealthSectionAccessURL},
healthy: false,
severity: health.SeverityWarning,
}, {
name: "WebsocketFail",
checker: &testChecker{
Expand DownExpand Up@@ -262,9 +257,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
healthy: false,
severity: health.SeverityError,
failingSections: []healthsdk.HealthSection{healthsdk.HealthSectionWebsocket},
healthy: false,
severity: health.SeverityError,
}, {
name: "DatabaseFail",
checker: &testChecker{
Expand DownExpand Up@@ -304,9 +298,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
healthy: false,
severity: health.SeverityError,
failingSections: []healthsdk.HealthSection{healthsdk.HealthSectionDatabase},
healthy: false,
severity: health.SeverityError,
}, {
name: "ProxyFail",
checker: &testChecker{
Expand DownExpand Up@@ -346,9 +339,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
severity: health.SeverityError,
healthy: false,
failingSections: []healthsdk.HealthSection{healthsdk.HealthSectionWorkspaceProxy},
severity: health.SeverityError,
healthy: false,
}, {
name: "ProxyWarn",
checker: &testChecker{
Expand DownExpand Up@@ -389,9 +381,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
severity: health.SeverityWarning,
healthy: true,
failingSections: []healthsdk.HealthSection{},
severity: health.SeverityWarning,
healthy: true,
}, {
name: "ProvisionerDaemonsFail",
checker: &testChecker{
Expand DownExpand Up@@ -431,9 +422,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
severity: health.SeverityError,
healthy: false,
failingSections: []healthsdk.HealthSection{healthsdk.HealthSectionProvisionerDaemons},
severity: health.SeverityError,
healthy: false,
}, {
name: "ProvisionerDaemonsWarn",
checker: &testChecker{
Expand DownExpand Up@@ -474,9 +464,8 @@ func TestHealthcheck(t *testing.T) {
},
},
},
severity: health.SeverityWarning,
healthy: true,
failingSections: []healthsdk.HealthSection{},
severity: health.SeverityWarning,
healthy: true,
}, {
name: "AllFail",
healthy: false,
Expand DownExpand Up@@ -518,14 +507,6 @@ func TestHealthcheck(t *testing.T) {
},
},
severity: health.SeverityError,
failingSections: []healthsdk.HealthSection{
healthsdk.HealthSectionDERP,
healthsdk.HealthSectionAccessURL,
healthsdk.HealthSectionWebsocket,
healthsdk.HealthSectionDatabase,
healthsdk.HealthSectionWorkspaceProxy,
healthsdk.HealthSectionProvisionerDaemons,
},
}} {
c := c
t.Run(c.name, func(t *testing.T) {
Expand All@@ -537,7 +518,6 @@ func TestHealthcheck(t *testing.T) {

assert.Equal(t, c.healthy, report.Healthy)
assert.Equal(t, c.severity, report.Severity)
assert.Equal(t, c.failingSections, report.FailingSections)
assert.Equal(t, c.checker.DERPReport.Healthy, report.DERP.Healthy)
assert.Equal(t, c.checker.DERPReport.Severity, report.DERP.Severity)
assert.Equal(t, c.checker.DERPReport.Warnings, report.DERP.Warnings)
Expand Down
2 changes: 0 additions & 2 deletionscodersdk/healthsdk/healthsdk.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -105,8 +105,6 @@ type HealthcheckReport struct {
Healthy bool `json:"healthy"`
// Severity indicates the status of Coder health.
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
// FailingSections is a list of sections that have failed their healthcheck.
FailingSections []HealthSection `json:"failing_sections"`

DERP DERPHealthReport `json:"derp"`
AccessURL AccessURLReport `json:"access_url"`
Expand Down
1 change: 0 additions & 1 deletiondocs/api/debug.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 0 additions & 2 deletionsdocs/api/schemas.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

1 change: 0 additions & 1 deletionsite/src/api/typesGenerated.ts
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 0 additions & 2 deletionssite/src/testHelpers/entities.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2528,7 +2528,6 @@ export const MockHealth: TypesGen.HealthcheckReport = {
time: "2023-08-01T16:51:03.29792825Z",
healthy: true,
severity: "ok",
failing_sections: [],
derp: {
healthy: true,
severity: "ok",
Expand DownExpand Up@@ -3322,7 +3321,6 @@ export const MockSharedPortsResponse: TypesGen.WorkspaceAgentPortShares = {
export const DeploymentHealthUnhealthy: TypesGen.HealthcheckReport = {
healthy: false,
severity: "ok",
failing_sections: [], // apparently this property is not used at all?
time: "2023-10-12T23:15:00.000000000Z",
coder_version: "v2.3.0-devel+8cca4915a",
access_url: {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp