-
Notifications
You must be signed in to change notification settings - Fork 27
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
Remove inactive users #305
Conversation
7c70a86
to
44ead9c
Compare
3a723da
to
67d74eb
Compare
some of the commits can be squashed, as they seem to comment-out and un-comment-out bits of code. |
2faa944
to
5397cd4
Compare
How far should I go to squash commits? I've mixed in some commits together while working, and I figure it'd be faff to pick them apart. |
87626a0
to
b8f2c46
Compare
You can probably go quite far with the squashing, along the lines of:
|
725b3c9
to
cc6a597
Compare
cc6a597
to
437bc03
Compare
I've rebased this on top of the current dev so I can see how it works with ID linking. |
aca0540
to
7f325d9
Compare
No, it forces the reassignment/deletion of the API credential before the user can be removed. Short term: that sounds good given the limited API cred usage, but there should be some monitoring/log of failures from the automated script to allow follow-up. |
As a note to future Greg, gocdb/lib/Gocdb_Services/User.php Line 441 in f780966
should be factored out into a method that the runner makes use of. |
Need to rebase this to pick up the changes from #284. |
- GOCDB admins email is better because it doesn't matter what view the user uses. - it's also consistent with other mails sent (e.g. role requests, ID linking).
- to be more consistent with itself and other emails sent
- for consistency and PSR-12 compliance
- as the time this script starts is already captured above.
- we don't want to return here (and skip the rest of the users), we want to continue on to the next user.
- As this script is stateless and might be run weekly, hence a used will get ~4 warnings and we don't want each one saying "30 days".
Co-authored-by: ineilson <[email protected]>
2018a9b
to
77db119
Compare
- so that they can be changed in production based on how frequently the script runs.
- to prevent deleting the user and creating orphaned API credentials.
77db119
to
a97fc22
Compare
@ineilson: I've address the above now - in a97fc22 @tofu-rocketry: Following our discussions about how frequently this should run / how much warning a user should have get, I've softcoded thresholds for warning and deletion - in e86f594 |
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.
Looks okay. If a deletion fails for any user for some reason the whole thing stops. That's intended behaviour?
maybe "intended" is to strong a word, but it feels like an okay thing to do. |
Users who have a lastLoginDate from more than 18 months ago will be removed.
Also catch the case where users who have not logged in since the addition of lastLoginDate, which means they don't have a lastLoginDate. They are also removed.
Depends on#171 is now merged into devMerge after #284