Page MenuHomePhabricator

API: `user.search` should output MediaWiki User
Closed, ResolvedPublicFeature

Description

The Phabricator API endpoint user.search should also output the value for "MediaWiki User". This would allow for tools and scripts linking the two. As a use case I'm working on a script that will pull new signatures from L37 (and others) and provide their MediaWiki usernames for vetting / adding to the ANPDP noticeboard. There is an endpoint that does the opposite (user.mediawikiquery). Perhaps there was a decision made to exclude this for some reason?

See also: https://secure.phabricator.com/T10512

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Conduit API: Include MediaWiki username in user.search outputrepos/phabricator/phabricator!15aklapperT344303wmf/stable
Customize query in GitLab

Event Timeline

Aklapper triaged this task as Medium priority.

The endpoint user.mediawikiquery is entirely custom downstream code.
This would require some custom code in PhabricatorUser.php to provide that data, and an additional call to that custom code in the endpoint.

(PS: For any Phab questions, there's https://www.mediawiki.org/wiki/Talk:Phabricator/Help which also helps others outside of WMF's walled gardens :)

I don't have a clean tree so I dropped a PoC in P50590 which works locally for the deprecated API call user.query. (I realized too late that's not the non-deprecated call user.search. The latter would require different fiddling with PhabricatorPeopleSearchEngine.php etc; I did not fully get its structure/logic from a quick look.)

The endpoint user.mediawikiquery is entirely custom downstream code.
This would require some custom code in PhabricatorUser.php to provide that data, and an additional call to that custom code in the endpoint.

Yeah, I figured that might be the case.

(PS: For any Phab questions, there's https://www.mediawiki.org/wiki/Talk:Phabricator/Help which also helps others outside of WMF's walled gardens :)

Ah neat. Figured this was a technical feature request that ought to be requested here.

I don't have a clean tree so I dropped a PoC in P50590 which works locally for the deprecated API call user.query. (I realized too late that's not the non-deprecated call user.search. The latter would require different fiddling with PhabricatorPeopleSearchEngine.php etc; I did not fully get its structure/logic from a quick look.)

I'm not sure what this means (PoC? clean tree?) but thank you!

Aklapper changed the task status from Open to In Progress.Sep 4 2023, 6:37 PM
Aklapper moved this task from To Triage to Needs code (in Phab or bot) on the Phabricator board.

(Sorry! PoC=proof of concept, and clean tree referred to my messy local git checkout after diff'ing against upstream Phorge to prepare that now-past migration.)

Hmm, this was easier than I had expected. So there's a patch now waiting in GitLab for review...

Thanks for the explainer :) Appreciate the patch!

Deployed on 2024-01-16