Background
The initial version of the similar_users API is deployed in production but is not publicly accessible. There is also a WMCloud-hosted version of the API but that is not guaranteed to be available/maintained. Therefore, we need to create a mock similar_users API client for development/QA on the Beta Cluster.
AC
- By default (if $wgSimilarEditorsApiUrl is falsy), I should see mock responses when interacting with /wiki/Special:SimilarEditors
Notes
- The logic to instantiate the correct similar_users API client (real or mock) could/should be in ServiceWiring.php, e.g.
// ... 'SimilarEditors.SimilarUsersClient' => function ( MediaWikiServices $services ): SimilarUsersClient { $config = $services->getMainConfig(); // Real if ( $config->get( 'SimilarEditorsApiUrl' ) ) { // ... } // Mock return new MockSimilarUsersClient(); },