- Notifications
You must be signed in to change notification settings - Fork928
feat(coderd/healthcheck): add access URL error codes and healthcheck doc#10915
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
17 commits Select commitHold shift + click to select a range
2f5530f
feat(coderd/healthcheck): add access URL error codes and healthcheck doc
johnstcn87e5f26
feat(coderd/healthcheck: add error codes for the rest of the owl
johnstcn1994ce1
add remaining health codes, todo writing words
johnstcn00505c9
database: assert that we put the right codes in the right places
johnstcn6cdc918
add words about database
johnstcn179fa17
Update docs/admin/healthcheck.md
johnstcn970cf5d
Update docs/admin/healthcheck.md
johnstcn1b56493
add DERP words
johnstcn942513e
add some words about websockets
johnstcnf259c25
add playground link for access url
johnstcndecf017
add more words about workspace proxies
johnstcn26c522e
add icon and manifest
johnstcn45f1689
make fmt
johnstcnaed87f4
address comments
johnstcn7bfe253
appease linter
johnstcn1bf956a
add another note about troubleshooting websockets
johnstcnf9494c8
adjust icon viewBox
johnstcnFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
13 changes: 6 additions & 7 deletionscoderd/healthcheck/accessurl.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
82 changes: 57 additions & 25 deletionscoderd/healthcheck/accessurl_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletionscoderd/healthcheck/database.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletionscoderd/healthcheck/database_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 4 additions & 8 deletionscoderd/healthcheck/derphealth/derp.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletioncoderd/healthcheck/derphealth/derp_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletionscoderd/healthcheck/health/model.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,37 @@ | ||
package health | ||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
const ( | ||
SeverityOK Severity = "ok" | ||
SeverityWarning Severity = "warning" | ||
SeverityError Severity = "error" | ||
// CodeUnknown is a catch-all health code when something unexpected goes wrong (for example, a panic). | ||
CodeUnknown Code = "EUNKNOWN" | ||
CodeProxyUpdate Code = "EWP01" | ||
CodeProxyFetch Code = "EWP02" | ||
CodeProxyVersionMismatch Code = "EWP03" | ||
CodeProxyUnhealthy Code = "EWP04" | ||
CodeDatabasePingFailed Code = "EDB01" | ||
CodeDatabasePingSlow Code = "EDB02" | ||
CodeWebsocketDial Code = "EWS01" | ||
CodeWebsocketEcho Code = "EWS02" | ||
CodeWebsocketMsg Code = "EWS03" | ||
CodeAccessURLNotSet Code = "EACS01" | ||
CodeAccessURLInvalid Code = "EACS02" | ||
CodeAccessURLFetch Code = "EACS03" | ||
CodeAccessURLNotOK Code = "EACS04" | ||
CodeDERPNodeUsesWebsocket Code = `EDERP01` | ||
CodeDERPOneNodeUnhealthy Code = `EDERP02` | ||
Comment on lines +13 to +34 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. review: these all have to go in here to be generated properly | ||
) | ||
// @typescript-generate Severity | ||
@@ -18,3 +46,17 @@ var severityRank = map[Severity]int{ | ||
func (s Severity) Value() int { | ||
return severityRank[s] | ||
} | ||
// Code is a stable identifier used to link to documentation. | ||
// @typescript-generate Code | ||
type Code string | ||
// Messagef is a convenience function for formatting a healthcheck error message. | ||
func Messagef(code Code, msg string, args ...any) string { | ||
var sb strings.Builder | ||
_, _ = sb.WriteString(string(code)) | ||
_, _ = sb.WriteRune(':') | ||
_, _ = sb.WriteRune(' ') | ||
_, _ = sb.WriteString(fmt.Sprintf(msg, args...)) | ||
return sb.String() | ||
} |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.