Skip to content

fix(enterprise/audit): improve error message for missing action #8335

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 2 commits into from
Jul 6, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jul 6, 2023

Before:

❯ make gen
panic: audit table entry missing action for field "Message" in type "github.com/coder/coder/coderd/database.TemplateVersion"

goroutine 1 [running]:
github.com/coder/coder/enterprise/audit.entry({0x23b2260?, 0xc00055a820}, 0xc0007214d0)
        /home/mafredri/src/coder/coder/enterprise/audit/table.go:238 +0x505
github.com/coder/coder/enterprise/audit.auditMap(0xc000721440)
        /home/mafredri/src/coder/coder/enterprise/audit/table.go:197 +0xb9
github.com/coder/coder/enterprise/audit.init()
        /home/mafredri/src/coder/coder/enterprise/audit/table.go:48 +0x2bee
exit status 2

Now:

❯ make gen
ERROR: Audit table entry missing action for field "Message" in type "github.com/coder/coder/coderd/database.TemplateVersion"
Please update the auditable resource types in: /home/mafredri/src/coder/coder/enterprise/audit/table.go
exit status 1

@mafredri mafredri merged commit 814534d into main Jul 6, 2023
@mafredri mafredri deleted the mafredri/fix-improve-audit-field-missing-message branch July 6, 2023 12:43
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants