-
Notifications
You must be signed in to change notification settings - Fork 887
feat: manage health settings using Coder API #10861
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple things I'd like to see added first.
@@ -232,6 +233,52 @@ func TestDebugHealth(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestHealthSettings(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can we add a test case where we un-dismiss?
- This should be audited, so we want to add an auditor and assert that an audit action took place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be audited, so we want to add an auditor and assert that an audit action took place.
Do you know any good code examples I can review first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Undismiss test case done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I added support for auditing, but I have no idea if this is sufficient. Keep in mind that "health settings" are stored as site configs, so in this case, the resource (and its ID) is artificial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add a mock auditor into the unit tests and assert that the changes were audited as expected.
Related: #10712
This PR exposes new API endpoints to modify health page settings.
Follow-up:
dismissed
property via/debug/health