Page MenuHomePhabricator

Add a tags parameter to API modules creating a logentry
Open, LowPublic

Description

Please add a tags parameter to API modules that create a logentry, allowing a user with applychangetags right to tag his action and the corresponding logentry, just like action=edit module has now.

Relevant modules in core:

  • action=block
  • action=createaccount
  • action=delete
  • action=imagerotate
  • action=import
  • action=managetags
  • action=move
  • action=patrol
  • action=protect
  • action=revisiondelete
  • action=tag (tagception...)
  • action=unblock
  • action=undelete
  • action=upload
  • action=userrights

Modules in extensions (some of these look internal, so maybe not relevant):

  • action=cxdelete
  • action=flow (and its submit submodules)
  • action=flowthank
  • action=globalblock
  • action=globaluserrights
  • action=massmessage
  • action=review Patch-Needs-Improvement
  • action=stabilize Patch-Needs-Improvement
  • action=thank
  • action=visualeditoredit

And perhaps some other modules from other extensions used on wikimedia wikis

Event Timeline

Dr_Brains raised the priority of this task from to Medium.
Dr_Brains updated the task description. (Show Details)
Dr_Brains subscribed.
Dr_Brains set Security to None.
Anomie subscribed.

In general a good idea. Open question is whether core "business logic" should handle this like was done for action=edit, or if the API should offer this feature without it being available to the web UI.

Anomie lowered the priority of this task from Medium to Low.May 1 2015, 4:17 PM
Dr_Brains renamed this task from Add a tag parameter to API modules creating a logentry to Add a tags parameter to API modules creating a logentry.May 1 2015, 10:07 PM

I removed action=imagerotate as it doesn't appear to create log entries.

The call to $file->upload() creates the log entry. Although see T35186: Provide a well-performing API to rotate an image, the whole module needs work so it can be undisabled on WMF wikis.

Based on how many API modules need support for this, I think we need some kind of common/shared code to help out:

  • API should have a PARAM_TYPE => 'tag' or something which automatically validates that the tag exists and can be used
  • ManualLogEntry should have a ->setTag() method (or something). So API code would just need to pass $params['tag'] directly to it.

Rollback doesn't create log entries.

I think Legoktm is onto something here...

Change 265230 had a related patch set uploaded (by Victorbarbu):
Add logic for "tags" in ApiBase

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

Change 266181 had a related patch set uploaded (by Unicornisaurous):
Add parameter to API modules to apply change tags to log entries

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

Change 266185 had a related patch set uploaded (by Sn1per):
Add tags support to ApiProtect

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

I am interested in learning how to do this. I will look into action=createaccount. I will definitely ask for guidance on IRC. :)
Thanks,
MtDu

I am interested in learning how to do this. I will look into action=createaccount.

Since action=createaccount is probably being completely rewritten for T110276: Rewrite the login API to use AuthManager, you might want to choose a different action to look into.

Change 266185 merged by jenkins-bot:
Add tags support to patrol, protect, unblock, and undelete

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

Change 329653 had a related patch set uploaded (by MtDu):
Add tags support to the following API modules

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

Change 330116 had a related patch set uploaded (by Georggi199):
Add tags support to userrights

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

Change 330133 had a related patch set uploaded (by Georggi199):
Add tags support to FlaggedRevs extension

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

Change 329653 merged by jenkins-bot:
Add tagging support to imagerotate, revisiondelete, and tag API modules

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

Change 331134 had a related patch set uploaded (by Georggi199):
Add change tagging support to ApiStabilize

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

Change 266181 merged by jenkins-bot:
Add parameter to API modules to apply change tags to log entries

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

VisualEditor just got tagged here and so I learned about this task. I think we've already done everything it requests as of T343339.

Pppery updated the task description. (Show Details)
Pppery subscribed.

Looks like it to me as well.

(Sidenote: I have no idea why I added VisualEditor and FlaggedRevs but not any of the other extensions listed.)