Skip to content

feat: add database support for dismissed healthchecks #10845

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 9 commits into from
Nov 23, 2023
Merged
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
dbmem
  • Loading branch information
mtojek committed Nov 23, 2023
commit c4829fb1d1f2381b4d46b71709016cd3fb36fb61
18 changes: 15 additions & 3 deletions coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ type data struct {
derpMeshKey string
lastUpdateCheck []byte
serviceBanner []byte
dismissedHealthchecks []byte
applicationName string
logoURL string
appSecurityKey string
Expand Down Expand Up @@ -1592,7 +1593,14 @@ func (q *FakeQuerier) GetDeploymentWorkspaceStats(ctx context.Context) (database
}

func (q *FakeQuerier) GetDismissedHealthchecks(ctx context.Context) (string, error) {
panic("not implemented")
q.mutex.RLock()
defer q.mutex.RUnlock()

if q.dismissedHealthchecks == nil {
return "", sql.ErrNoRows
}

return string(q.dismissedHealthchecks), nil
}

func (q *FakeQuerier) GetExternalAuthLink(_ context.Context, arg database.GetExternalAuthLinkParams) (database.ExternalAuthLink, error) {
Expand Down Expand Up @@ -6794,8 +6802,12 @@ func (q *FakeQuerier) UpsertDefaultProxy(_ context.Context, arg database.UpsertD
return nil
}

func (q *FakeQuerier) UpsertDismissedHealthchecks(ctx context.Context, value string) error {
panic("not implemented")
func (q *FakeQuerier) UpsertDismissedHealthchecks(ctx context.Context, data string) error {
q.mutex.RLock()
defer q.mutex.RUnlock()

q.dismissedHealthchecks = []byte(data)
return nil
}

func (q *FakeQuerier) UpsertLastUpdateCheck(_ context.Context, data string) error {
Expand Down