Page MenuHomePhabricator

Mark discussiontoolsedit as stable for external users
Closed, ResolvedPublic

Description

The Growth-Team automatically post talk page messages on behalf of new users. We would like the posting new user to be automatically notified of reply in the section. With DiscussionTools, this is fortunately reasonably easy. To make that happen, we need the following changes in DiscussionTools (in this list, "API" refers to action= discussiontoolsedit introduced by DiscusssionTools, unless otherwise specified):

  • The API doesn't allow the posting user to specify extra tags for the edit. This would be used by Growth to specify its own tracking tags ("posted via Special:Homepage", etc.). (EDIT: This is not actually possible, as it is a software-defined tag; but still could be used by gadgets, etc.).
  • The API doesn't allow the user to force (or disable) autosubscription. $autoSubscribe is always determined entriely by DiscussionTools.
  • The API is currently marked as internal (and thus unsafe to use). The designation should disappear, to invite reuse by external users (like Growth).

Event Timeline

Urbanecm_WMF renamed this task from Make discussiontoolsedit stable for external users to Mark discussiontoolsedit as stable for external users.Aug 2 2023, 3:03 PM
Urbanecm_WMF updated the task description. (Show Details)

The tags change would require some minor structural adjustments -- it currently has a hardcoded allowlist of tags that can be added via a dttags request parameter, so we'd need to provide something like a hook to let other extensions modify that.

The tags change would require some minor structural adjustments -- it currently has a hardcoded allowlist of tags that can be added via a dttags request parameter, so we'd need to provide something like a hook to let other extensions modify that.

Not necessarily. AFAIK, the dttags pseudo-parameter exists primarily because it is not possible to add software-defined tags via the standard tags parameter. For user-defined tags, tags should merely need exposing to users (should; the parameter forwarding doesn't actually work in VisualEditor, but that is easy to fix).

Granted, it wouldn't directly help Growth with adding its own tags, but that should be handleable from Growth's end (easiest is to mark the Growth tags as user-addable via the ChangeTagsAllowedAddHook, but that doesn't necessarily guarantee the tag is truthfully added; probably not a terrible issue to have though). It would help other users, and probably good idea when marking the API as non-internal.

Anyway: Uploading some patches to make the changes I described above, feel free to review :).

Change 944951 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/VisualEditor@master] ApiVisualEditorEdit: Make tags param actually work

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

Change 944952 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/DiscussionTools@master] Make ApiDiscussionToolsEdit non-internal

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

I left this comment in gerrit, but in retrospect it makes more sense to have it here:

I did a little digging, and I *think* the reason we've never used the tags param here for any of our tool-based tagging (and thus have never cared that it's broken in the VE API by the array issue) is that it winds up requiring the applychangetags user right, which anons *don't* have.

This is assuming that this comment is still valid: T209132#4748224 -- which it seems to be, based on https://en.wikipedia.org/wiki/Special:ListGroupRights

Agreed. I think we should we should fix the tags forwarding issue regardless -- it is admittedly a clear software bug, and I believe it would be useful in Growth's case (and perhaps for other users, too).

Replying to the Gerrit-only point you wrote:

...I guess that adds up to: we might as well fix this, because it's broken as-is, and end-users might want to use it, but *we* won't be able to use it for anything we're currently using onRecentChange_save hooks for.

I haven't tested that, but it should be possible to call PermissionManager::addTemporaryUserRights() in the API and force the tag through anyway. The other issue is that for applychangetags to play a role, the tag needs to be marked as user-addable in the first place (which might be not desirable for analytics/etc purposes).

Change 944951 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ApiVisualEditorEdit: Make tags param actually work

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

Change 944952 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Make ApiDiscussionToolsEdit non-internal, add 'tags'

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