-
Notifications
You must be signed in to change notification settings - Fork 886
feat: audit addition and removal of licenses #6125
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
coderd/audit/request.go
Outdated
case database.License: | ||
// TODO: return a valid ID here when the below ticket is completed: | ||
// https://github.com/coder/coder/pull/6012 | ||
return uuid.New() |
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.
idk that we can merge this up with this line the way it is.
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.
is there a reason we can't just use the numerical id?
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.
@coadler Do you mean the the License.ID
field? That is type int32
- if we used that that, how would we get the AuditLog
model to accept it, given it only takes UUIDs?
Another issue: for some reason, License.ID
changes. Like if I delete 'license 4' in the CLI, the License.ID
will change from 4 to 0. IDK why we're doing this.
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.
coderd/audit/request.go
Outdated
case database.License: | ||
// TODO: return a valid ID here when the below ticket is completed: | ||
// https://github.com/coder/coder/pull/6012 | ||
return uuid.New() |
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.
is there a reason we can't just use the numerical id?
coderd/audit/request.go
Outdated
@@ -71,6 +71,8 @@ func ResourceTarget[T Auditable](tgt T) string { | |||
case database.APIKey: | |||
// this isn't used | |||
return "" | |||
case database.License: | |||
return typed.UUID.String() |
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 think the numerical ID might make more sense as the target, rather than just having the UUID for both.
return typed.UUID.String() | |
return strconv.Itoa(typed.ID) |
resolves #6029
