Page MenuHomePhabricator

Create a mock similar_users API client for development/QA on the Beta Cluster
Closed, ResolvedPublic5 Estimated Story Points

Description

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

  1. The logic to instantiate the correct similar_users API client (real or mock) could/should be in ServiceWiring.php, e.g.
SimilarEditors/src/ServiceWiring.php
// ...
  'SimilarEditors.SimilarUsersClient' => function ( MediaWikiServices $services ): SimilarUsersClient {
    $config = $services->getMainConfig();

    // Real
    if ( $config->get( 'SimilarEditorsApiUrl' ) ) {
      // ...
    }

    // Mock
    return new MockSimilarUsersClient();
  },

Event Timeline

Tchanders set the point value for this task to 5.Apr 19 2022, 4:16 PM

Change 788670 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/SimilarEditors@master] Add SimilarEditorsClient and mock

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

Change 788670 merged by jenkins-bot:

[mediawiki/extensions/SimilarEditors@master] Add SimilarEditorsClient and mock

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

Change 791090 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/SimilarEditors@master] Fix documentation for Neighbor and TimeOverlap from int to float

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

Change 791091 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/SimilarEditors@master] Add $userText property to Neighbor

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

Change 791092 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/SimilarEditors@master] Return data from MockSimilarEditorsClient::getSimilarEditors

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

Change 791090 merged by jenkins-bot:

[mediawiki/extensions/SimilarEditors@master] Fix documentation for Neighbor and TimeOverlap from int to float

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

Change 791091 merged by jenkins-bot:

[mediawiki/extensions/SimilarEditors@master] Add $userText property to Neighbor

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

Change 791092 merged by jenkins-bot:

[mediawiki/extensions/SimilarEditors@master] Return data from MockSimilarEditorsClient::getSimilarEditors

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