Page MenuHomePhabricator

If both types of mentor list are defined, but only one of them exists, MentorProvider::getMentorsSafe() returns an empty array
Closed, ResolvedPublic

Description

MentorProvider::getMentorsSafe always returns an empty array, even if only one of the two methods called throws (and the other one returns a list of mentors).

In case a wiki sets both mentor lists (automatically assigned and manual), but only one of them exists (let's say, the automatically assigned one), getMentorsSafe will return an empty list of usernames (even though there are valid mentors on the wiki).

Event Timeline

Urbanecm_WMF removed a project: Growth-Scaling.

I tested at test.wiki (which doesn't yet have MentorProvider and runs on the pre-refactoring code), and I can reproduce there as well. Since it apparently was the case before, it's not urgent to fix this.

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

[mediawiki/extensions/GrowthExperiments@master] Fix handling in MentorProvider::getMentorsSafe

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

Urbanecm_WMF changed the task status from Open to In Progress.Feb 3 2022, 11:15 AM
Urbanecm_WMF moved this task from Backlog to In review on the User-Urbanecm_WMF (Engineering) board.
kostajh changed the task status from In Progress to Open.Feb 4 2022, 2:44 PM
kostajh moved this task from Code Review to QA on the Growth-Team (Sprint 0 (Growth Team)) board.

Change 759471 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Fix handling in MentorProvider::getMentorsSafe

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