everypolitician / compare_with_wikidata

Library for diffing Wikidata and CSVs
MIT License
2 stars 0 forks source link

Use the bot flag on edits made by the bot user #131

Closed mhl closed 6 years ago

mhl commented 6 years ago

We've had a problem reported with edits made by this tool: the Prompter Bot account, which edits are made by in the production deployment, has a bot flag for the account, but isn't setting the bot flag on the edits it makes:

https://www.wikidata.org/wiki/User_talk:Chris_Mytton#Bot_flag

This pull request looks at the username of the account the edit is being made under, and will add the bot flag to edits when the username is 'Prompter Bot' (overridable with the BOT_USERNAME environment variable).

This doesn't deal with refactoring the run! method of DiffOutputGenerator or testing that the new proxy client class is used by that method, because we've established that such refactoring (and getting run! under test) is a larger task, and we should be dealing with this user complaint as promptly as we can. It does have unit tests for the proxy client class however.

Having run this manually from the command line using the "Prompter Bot" account, this view shows that the edits do have the bot flag (see the bold b beside two of the Prompter Bot edits:

https://www.wikidata.org/w/index.php?hidecategorization=1&target=User%3AMhl20%2Fprompts%2FRiigikogu&namespace=2&limit=50&days=30&enhanced=1&damaging__likelybad_color=c4&damaging__verylikelybad_color=c5&title=Special:RecentChangesLinked&urlversion=2

bot-flag