Skip to content

feat: add codegen for audit.AuditableResources entries #1370

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 3 commits into from
May 10, 2022
Merged

Conversation

coadler
Copy link
Contributor

@coadler coadler commented May 10, 2022

Closes #1331

Usage:

$ ./coderd/audit/audit_gen.sh Workspace User
Copy the following code into the audit.AuditableResources table

	&database.Workspace{}: {
		"id": ActionIgnore, // TODO: why
		"created_at": ActionIgnore, // TODO: why
		"updated_at": ActionIgnore, // TODO: why
		"owner_id": ActionIgnore, // TODO: why
		"organization_id": ActionIgnore, // TODO: why
		"template_id": ActionIgnore, // TODO: why
		"deleted": ActionIgnore, // TODO: why
		"name": ActionIgnore, // TODO: why
		"autostart_schedule": ActionIgnore, // TODO: why
		"autostop_schedule": ActionIgnore, // TODO: why
	},
	&database.User{}: {
		"id": ActionIgnore, // TODO: why
		"email": ActionIgnore, // TODO: why
		"username": ActionIgnore, // TODO: why
		"hashed_password": ActionIgnore, // TODO: why
		"created_at": ActionIgnore, // TODO: why
		"updated_at": ActionIgnore, // TODO: why
		"status": ActionIgnore, // TODO: why
		"rbac_roles": ActionIgnore, // TODO: why
	},

@coadler coadler requested a review from kylecarbs May 10, 2022 19:05
@coadler coadler self-assigned this May 10, 2022
@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #1370 (3641f3d) into main (2df92e6) will decrease coverage by 0.25%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1370      +/-   ##
==========================================
- Coverage   67.08%   66.82%   -0.26%     
==========================================
  Files         288      290       +2     
  Lines       18773    18885     +112     
  Branches      241      241              
==========================================
+ Hits        12593    12620      +27     
- Misses       4906     4973      +67     
- Partials     1274     1292      +18     
Flag Coverage Δ
unittest-go-macos-latest 53.97% <0.00%> (-0.14%) ⬇️
unittest-go-postgres- 65.33% <0.00%> (-0.23%) ⬇️
unittest-go-ubuntu-latest 56.39% <0.00%> (-0.04%) ⬇️
unittest-go-windows-2022 52.40% <0.00%> (-0.05%) ⬇️
unittest-js 74.24% <ø> (ø)
Impacted Files Coverage Δ
scripts/auditgen/main.go 0.00% <0.00%> (ø)
coderd/audit/backends/postgres.go 38.46% <0.00%> (-30.77%) ⬇️
codersdk/provisionerdaemons.go 61.97% <0.00%> (-5.64%) ⬇️
cli/cliui/agent.go 77.46% <0.00%> (-4.23%) ⬇️
peerbroker/listen.go 84.03% <0.00%> (-3.37%) ⬇️
coderd/turnconn/turnconn.go 81.91% <0.00%> (-3.20%) ⬇️
provisionerd/provisionerd.go 76.17% <0.00%> (-1.48%) ⬇️
codersdk/workspaceagents.go 51.52% <0.00%> (-1.36%) ⬇️
agent/agent.go 65.90% <0.00%> (-1.24%) ⬇️
peer/conn.go 80.34% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2df92e6...3641f3d. Read the comment docs.

@coadler coadler force-pushed the colin/audit-gen branch from a95194e to afdbc42 Compare May 10, 2022 19:50
@coadler coadler force-pushed the colin/audit-gen branch from afdbc42 to 3bda3b5 Compare May 10, 2022 19:50
@coadler coadler enabled auto-merge (squash) May 10, 2022 21:18
@coadler coadler merged commit f816bbe into main May 10, 2022
@coadler coadler deleted the colin/audit-gen branch May 10, 2022 21:27
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement code generator for adding new database types to the audit log table
3 participants