Page MenuHomePhabricator

Combine the action text and comment if both are defined in the results of the 'actions' request to the CheckUser API
Closed, ResolvedPublic2 Estimated Story Points

Description

When generating results for the CheckUser API, either the comment or the action text can be provided in the summary key-value pair. However, it should be possible for the caller to get both the action text and the comment.

To make this backwards compatible (as the comment and action text can both be provided under the name summary), when both are provided it should be possible to combine them by adding the comment after the action text in parentheses. For example it would be like: Action text .... (comment ...).

Acceptance criteria
  • Have the comment and action text combined for the summary key when they are both defined
  • In all other cases, just use the one that is defined (or the empty string if both are not)

QA Results - Local

Event Timeline

Change #1013433 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Combine the summary and actiontext if both are available for a row

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

Change #1013433 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Combine the summary and actiontext if both are available for a row

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

Suggested QA steps (can be done on patch demo or local wiki):

  1. Log into an account with the checkuser group
  2. Perform a two testing edits with one without an edit summary and one with an edit summary. Perform two testing log actions (for example deleting a page or moving a page) with one with an empty reason and one with a defined reason.
  3. Open Special:ApiSandbox#action=query&format=json&list=checkuser&formatversion=2&curequest=actions
  4. Add a target as the username you used to perform the actions in step 2 and run the query
  5. Verify that for the edits without an edit summary, there is no summary key provided.
  6. Verify that for the edits with an edit summary the summary key is provided and set to the edit summary you used
  7. Verify that for the log actions without a provided reason, the summary key contains the action text (for example the delete action would have the text Dreamyjazz deleted page [[CheckUserSimulated-7c261cd73e2fd44dc1a8041b1b551047]])
  8. Verify that for the log actions with a provided reason, the summary key contains the action text and reason combined where the action text is shown first and then the reason is shown in parentheses after the action text. For example, the delete action could be Dreamyjazz deleted page [[CheckUserSimulated-7c261cd73e2fd44dc1a8041b1b551047]] (content was: \"37c871609629f6c270b8e0897fc61ec1\", and the only contributor was \"[[Special:Contributions/CheckUserSimulated-f917787ef9bc5d73d7bf8a08b81a7c36|CheckUserSimulated-f917787ef9bc5d73d7bf8a08b81a7c36]]\" ([[User talk:CheckUserSimulated-f917787ef9bc5d73d7bf8a08b81a7c36|talk]]))

You may also wish to test suppressing the edit summary / reason associated with a log event, and test that the a user with checkuser but not suppressor cannot see the edit summary / reason associated with the log event. Testing how suppression interacts with the results can be done in QA of T341827. Furthermore, the reason associated with a check does not get hidden if the user does not have the rights to see it. This is described in T361291 and QA to ensure that this issue is fixed will be done in that task.

@Dreamy_Jazz used "Testuserone" and my action as "move". I gave no reason for the first edit as seen by moving "Canine" to "Puppy". My next edit was moving "Puppy" to "Mutt" with the reason highlighted in blue. This is what you are looking for, right as seen in the first video?
Also for the last part, you wanted me to just add Suppressor rights with my CheckUser as seen in the 2nd video but it seems like the same result. Am I missing something or doing something wrong?

Status: ❓NMI
Environment: Local: 1.42.0-alpha (2e857b0)15:04, 25 March 2024; CheckUser 2.5 (b1a41ff) 18:59, 28 March 2024
OS: macOS Sonoma 14.4.1
Browser: Chrome 123
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
http://localhost:8080/wiki/Special:ApiSandbox#action=query&format=json&list=checkuser&formatversion=2&curequest=actions&cutarget=Testuserone&cutoken=9323912b8879ed5924cae045948113b56605f0bf%2B%5C
http://localhost:8080/wiki/Mutt

❓AC1: https://phabricator.wikimedia.org/T361263

Only CheckUserCheckUser & Suppressor

@Dreamy_Jazz used "Testuserone" and my action as "move". I gave no reason for the first edit as seen by moving "Canine" to "Puppy". My next edit was moving "Puppy" to "Mutt" with the reason highlighted in blue. This is what you are looking for, right as seen in the first video?
Also for the last part, you wanted me to just add Suppressor rights with my CheckUser as seen in the 2nd video but it seems like the same result. Am I missing something or doing something wrong?

Status: ❓NMI
Environment: Local: 1.42.0-alpha (2e857b0)15:04, 25 March 2024; CheckUser 2.5 (b1a41ff) 18:59, 28 March 2024
OS: macOS Sonoma 14.4.1
Browser: Chrome 123
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
http://localhost:8080/wiki/Special:ApiSandbox#action=query&format=json&list=checkuser&formatversion=2&curequest=actions&cutarget=Testuserone&cutoken=9323912b8879ed5924cae045948113b56605f0bf%2B%5C
http://localhost:8080/wiki/Mutt

❓AC1: https://phabricator.wikimedia.org/T361263

Only CheckUserCheckUser & Suppressor

Hi. The first video is as expected.

Because of T361291, there is a bug with the way that suppression works so testing suppression can be done in that ticket. As such, I've struck that part from my suggested steps.

@Dreamy_Jazz Ok sounds good. Since the first video displays the log action when given a reason vs not giving a reason, I will move this to Done. The suppressor issue that's mentioned above will be fixed on T341827. Thanks for all your work and steps!