Page MenuHomePhabricator

Curator gets number of unique editors between two revisions
Closed, ResolvedPublic

Description

"As a Curator, I want to know how many editors have created revisions between two revisions, so that I understand what level of collaboration has gone into the changes."

When displaying a diff between two revisions, our clients also show how many revisions happened between the two revisions. (See https://en.wikipedia.org/w/index.php?title=France&type=revision&diff=920186445&oldid=914890923 for an example, "(8 intermediate revisions by 7 users not shown)").

T234940 is for getting the count of revisions; this user story is for getting the count of unique users.


GET /page/{title}/history/editors?from=<from>&to=<to>

Return the number of unique editors who created revisions between revision with id from and revision with id to, non-inclusive

Request body: none

Notable request headers: none

Status codes:

200: body is the editors count
404: revision with id from and/or revision with id to do not exist
403: revision with id from and/or revision with id to is unauthorized, or page that these are revisions of is unauthorized
400: client error, such as if from and to are the same ID, or if from and to are not revisions of the same page

Notable response headers: none

Response body: JSON object with the following properties
count: integer of 0 or more representing count of unique editors who worked on non-inclusive non-deleted intermediate revisions between revision with id from and revision with id to (see above for examples)

Details

Related Gerrit Patches:

Event Timeline

There's a Title::getAuthorsBetween and Title::countAuthorsBetween methods in core, one implemented via another.

I would like to take this as an opportunity to improve upon those methods as well.

A couple of issues with them:

  1. getAuthorsBetween doesn't take into account possibility for the rev_deleted to be set to suppress the author. It's not a big deal in the current codebase as the list is never actually displayed, but it can potentially reveal the suppressed data, and will create inconsistency between editors counts with and without the from/to parameters.
  2. Both methods don't really belong in the Title, but where would they belong? RevisionStore? Also not really.. In case we would like to previous issue, we'd need PermissionManager to fetch proper rev_deleted bits, and RevisionStore can't depend on PermissionManager, as it would be a cycle..

Any ideas?

eprodromou triaged this task as Medium priority.Oct 23 2019, 7:37 PM

Change 545923 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] WIP: Move {get,count}AuthorsBetween into RevisionStore.

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

Sounds like the right move. I'm not sure I understand your first question. The revision is not deleted but the author is suppressed? I agree, best strategy is to have this consistent between the main method and the "between" method.

@Pchelolo this doesn't seem to be merged?

@Pchelolo this doesn't seem to be merged?

This indeed is not merged. This was never even put on a sprint, I've been working on it at my leisure time.

Change 545923 merged by jenkins-bot:
[mediawiki/core@master] REST: Implement from and to for editors count handler.

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

@Pchelolo this looks done. Do we need to add integration tests?

Do we need to add integration tests?

Why wouldn't we? :)

Do we need to add integration tests?

Why wouldn't we? :)

Well, if it had already been done, for example.

eprodromou closed this task as Resolved.Tue, Dec 3, 4:24 PM