**User story:** As an interface administrator, I want to configure the username shown to users when Automoderator reverts an edit, so that it is localised and understandable to users on my wiki.
----
We want each Wikimedia project to be able to configure their own username for Automoderator, and we want the username to be localised. This spike is to help us understand if and how this might be possible.
Wikidata has localisable edit summaries, which can be translated via TranslateWiki - this might be a sensible place to start the investigation.
**Questions**
[x] Can we have Automoderator's username be configurable? If so, how?
[x] Can we have Automoderator's username be localised? If so, how?
[x] Is it possible for us to prevent other users from registering a new account with the local username, to avoid confusion?
[x] Are there any drawbacks we should be aware of?
**Answers**
> Can we have Automoderator's username be localised? If so, how?
Yes, but it's messy.
We could copy abusefilter's approach exactly and put the username in the localization system (explored in [[ https://gerrit.wikimedia.org/r/c/1000038 | gerrit:1000038 ]]) . That has the consequence of managing username changes in translatewiki. The username would vary by wiki content language + translatewiki translation rather than being directly changeable.
> Can we have Automoderator's username be configurable? If so, how?
Yes.
1. We could put the username in extension config only (explored in [[ https://gerrit.wikimedia.org/r/c/1000038 | gerrit:1000038 ]] ). That has the consequence of managing username changes via backports. Or, we could:
1. Put the username in the extension config and manage it with community config. That has the consequence of managing username changes along side other CC options we expose.
The main difference is the amount of friction for username changes.
Changing the username in any of these places has the consequence of a new automoderator username being used moving forward. All of the options should include a step (manual or automated) of checking for availability of the new name.
> Is it possible for us to prevent other users from registering a new account with the local username, to avoid confusion?
Yes.
As @Umherirrender pointed out, we can add to the reserved usernames list via [[ https://www.mediawiki.org/wiki/Manual:Hooks/UserGetReservedNames | UserGetReservedNames hook ]].
- This is really straightforward with the localization approach, as we just add the message label into the reserved names list via that hook.
- I didn't have success when I experimented with pulling an AutoModerator username from config and adding it to the reserved names list. Since that is itself managed by configuration, there may be a lifecycle or dependency reason that this doesn't work, but I've not investigated further.
Since the code as written "steals" accounts via [[ https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1User_1_1User.html#a8c034c8d9c7342a33a74fed6bc18dff4 | MediaWiki\User\User\newSystemUser ]], it may be enough to simply register the desired username as soon as it's decided upon. Once Automoderator uses the account to revert edits, it should be disabled for future login. Perhaps the account could be added to the [[ https://www.mediawiki.org/wiki/Manual:$wgReservedUsernames | $wgReservedUsernames ]] config after the fact.
> Are there any drawbacks we should be aware of?
Once username changes are made the consequences/pitfalls are:
- no single source of truth in special:contributions for AutoModerator activity on a given project
- old talk page still in place; new account won't have a talk page unless someone makes a new one / moves the existing one
- possibility of user confusion over which account is actually AutoModerator
- multiple sources of echo notifications if that's implemented down the road (not a problem for the pilot)
I suggest that we start by putting the username in the extension config for now while we explore our options for mitigating the downsides listed. It will not preclude implementing option 3 down the road and is in fact a prerequisite for option 3. From my research so far, I believe that if we include rename or account merge in the process for AutoModerator username changes (manual or automated), we can address all of those downsides.