Page MenuHomePhabricator

MediaWiki:GrowthMentors.json: Add a write-only username field
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where): MediaWiki:GrowthMentors.json should have an username field, which will be only written to.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

When attempting to check some changes to MediaWiki:GrowthMentors.json it is cumbersome as it doesn't have usernames. Then I attempted to check these with https://test.wikipedia.org/wiki/Special:ManageMentors - which does have access to this value already, but only presents it inside the anchor tags.

Benefits (why should this be implemented?):
Having the username directly in the JSON page is more convenient for administrators needing to edit the mentor list manually.

Notes: In the initial version, renaming of users will not be handled well (it will be only recognized on any subsequent mentor list change). Per T331444#8704980, we can improve that later if it shows to be a frequent problem.

Acceptance criteria
  • MediaWiki:GrowthMentors.json contains an username field with username of each of the listed mentors. At the latest, this field is populated on the next Growth-managed edit of the mentor list (new mentor added, mentor removed/quit, change of mentor message/weight and similar).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The use case described makes sense to me, thanks for filling the ticket @Xaosflux .

I'm wondering, would it make more sense to add a write-only username field to GrowthMentors.json instead (the username won't be ever read from GrowthMentors.json, the ID would still be the way how GrowthExperiments identifies enrolled mentors, but it would be there to make editing easier). This approach has a small disadvantage (upon renaming of a mentor, the username in GrowthMentors.json would be updated together with the next edit of that JSON page), but it fulfils the goal without potentially confusing non-tech users wondering what a mentor ID is (especially considering Special:ManageMentors is transcludeable).

Would this alternative approach (username in GrowthMentors.json as a write-only field) be sufficient for your use case, @Xaosflux?

@Urbanecm_WMF yes, though I don't think that would handle renames very well?

@Xaosflux Renames would be recognized on a subsequent edit of the mentor
list (an user quitting/enrolling, a mentor changing their
message/weight/similar, an admin removing a mentor or similar). It’s also
easy for admins to forcefully trigger an edit of the JSON page if they want
to.

Theoretically, we (Growth) can try hooking into renames and updating the
username field whenever a rename happens. Maybe we can try adding the
username field and potentially improving renames handling in the future?

Maybe we can try adding the username field and potentially improving renames handling in the future?

That sounds like a good plan to me.

Urbanecm_WMF renamed this task from Display the mentorid on managementors to MediaWiki:GrowthMentors.json: Add a write-only username field.Mar 17 2023, 3:27 PM
Urbanecm_WMF updated the task description. (Show Details)
Urbanecm_WMF updated the task description. (Show Details)

Maybe we can try adding the username field and potentially improving renames handling in the future?

That sounds like a good plan to me.

Let's do it then :).

Change 900691 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] GrowthMentors.json: Add a write-only username field

https://gerrit.wikimedia.org/r/900691

Urbanecm_WMF changed the task status from Open to In Progress.Mar 17 2023, 3:53 PM

Change 900691 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] GrowthMentors.json: Add a write-only username field

https://gerrit.wikimedia.org/r/900691

Change 902734 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.1] GrowthMentors.json: Add a write-only username field

https://gerrit.wikimedia.org/r/902734

Change 902734 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.1] GrowthMentors.json: Add a write-only username field

https://gerrit.wikimedia.org/r/902734

Mentioned in SAL (#wikimedia-operations) [2023-03-27T07:58:36Z] <urbanecm@deploy2002> Started scap: Backport for [[gerrit:902734|GrowthMentors.json: Add a write-only username field (T331444)]]

Mentioned in SAL (#wikimedia-operations) [2023-03-27T07:59:58Z] <urbanecm@deploy2002> urbanecm: Backport for [[gerrit:902734|GrowthMentors.json: Add a write-only username field (T331444)]] synced to the testservers: mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-03-27T08:06:29Z] <urbanecm@deploy2002> Finished scap: Backport for [[gerrit:902734|GrowthMentors.json: Add a write-only username field (T331444)]] (duration: 07m 52s)

Deployed to production manually, as the patch should not ever get reverted (at the risk of breaking mentorship at all wikis until the username keys are removed from MediaWiki:GrowthMentors.json).

FYI @Xaosflux.

Thank you, looks good!