-
Notifications
You must be signed in to change notification settings - Fork 7
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
Purge logs cmd #1008
Purge logs cmd #1008
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 with some comments
I made my comments and forgot to click submit. I see some new commits came through since, will take another look in a bit |
@@ -79,6 +80,7 @@ func init() { | |||
r.AddMethod("JIMM", 4, "UpdateMigratedModel", updateMigratedModelMethod) | |||
r.AddMethod("JIMM", 4, "AddCloudToController", addCloudToControllerMethod) | |||
r.AddMethod("JIMM", 4, "RemoveCloudFromController", removeCloudFromControllerMethod) | |||
r.AddMethod("JIMM", 4, "PurgeLogs", purgeLogsMethod) |
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.
not for this PR but for future consideration. Imagine we had clients out there that were already using facade version 4. .then we release these changes and release a new client that is also using client facade version 4.. then they try to use this client to interact with a server that has not been upgraded to include the new method yet - we'd have a problem :)
Signed-off-by: Mina Ashraf <[email protected]>
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'm happy with this now, provided Ales gives the thumbs up.
tomorrow := relativeNow.AddDate(0, 0, 1) | ||
deleted_count, err := s.Database.DeleteAuditLogsBefore(ctx, tomorrow.Format(time.RFC3339)) | ||
// check that logs have been deleted | ||
c.Assert(err, qt.IsNil) |
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 would add an assertion that the count of logs in the DB is 1. But not super necessary.
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 modulo some comments
Signed-off-by: Mina Ashraf <[email protected]>
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 bar mini comments, will merge mine in a moment as it's updated to reflect yours
Description
Adds a command and an endpoint in juju that purges logs before a certain date
Fixes CSS-3781
Engineering checklist
Check only items that apply
Test instructions
not yet tested