Page MenuHomePhabricator

ChangeMentor should drop mentor/mentee relationship if it notices a mentee who opted out
Closed, ResolvedPublic

Description

ChangeMentor currently ignores mentees who happen to be opted-out (MentorManager::getMentorshipStateForUser( $user ) === MentorManager::MENTORSHIP_OPTED_OUT). This causes troubles for eg. the ReassignMentees class, which subsequently leaves opted out mentees assigned to the former mentor, which is (again) not the desirable behaviour.

In theory, opted-out mentees should not have a mentor assigned in the first place, but for various reasons, it still happens from time to time (see T351415 as an example). To account for that, let's make ChangeMentor automatically drop the mentor/mentee relationship whenever it notices a opted out mentee, rather than refusing to process the mentee altogether.

Event Timeline

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

[mediawiki/extensions/GrowthExperiments@master] ChangeMentor: Drop relationship for mentees who opted out

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

Change 987421 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] ChangeMentor: Drop relationship for mentees who opted out

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

Etonkovidova subscribed.

Checked in testwiki wmf.14 - what was tested:

  1. a user opts out from Mentorship - {{#mentor:}} doesn't show an assigned mentor anymore.
  2. a mentor cannot claim that mentee via Specail:ClaimMentee - "a user opted out from Mentorship message is displayed" message is displayed.
  3. a user clicks to "Get a mentor" - and a mentor gets assigned.
  4. another mentor can claim that user as a mentee (via Special:ClaimMentee)