Skip to content

Conversation

Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented Aug 13, 2022

Overview

Closes #483. This is a somewhat urgent mitigation due to a technical limitation. Our helper-role system breaks once a helper role has more than 100 users (usually the JAVA helper role).

This mitigates the problem by automatically removing some users from helper roles.

Details

Roles are pruned once they go beyond 95 users (the hard limit is 100). It will then attempt to prune 10 random users who fulfill:

  • not recently joined (7 days)
  • no recent message in a help thread (90 days - this is also the lookback limit of our DB as of today)

Users are send a DM to inform them about what happened:

DM

The routine also logs on INFO level who got pruned, so we can always double check in the logs. It will also tell us on WARN level if a role is, despite auto-pruning, approaching or even going beyond the limit. So that we can start to prune manually.

Latter warnings are also forwarded to the #mod_audit_log channel, so that we really do not miss it:

audit log

Other stuff

This PR also addresses two unrelated things:

  • Added hints on how to change the logging level (also for bot only) in log4j2.xml
  • Fixed a bug with routines starting too early (they must only be started once the system is ready, not directly during startup)
  • Fixed a bug where BotCore#onReady is not always triggered because the core is added too late to JDA

@Zabuzard Zabuzard added enhancement New feature or request priority: major labels Aug 13, 2022
@Zabuzard Zabuzard self-assigned this Aug 13, 2022
@Zabuzard Zabuzard requested review from a team as code owners August 13, 2022 20:58
Copy link
Contributor

@marko-radosavljevic marko-radosavljevic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean. ☺️

* Added hints to change logging level (also for bot only)
* Fixed bug with routines starting too early
* also fixed a bug with BotCore missing its onReady event
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Zabuzard Zabuzard merged commit 09d914d into develop Aug 20, 2022
@Zabuzard Zabuzard deleted the feature/auto_prune_helpers branch August 20, 2022 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-prune helpers

3 participants