Page MenuHomePhabricator

Should be possible to rename or merge change tags
Open, Stalled, MediumPublic

Description

In https://www.wikidata.org/wiki/Special:Tags there're some duplicate change tags (such as "adding language as description", "possible non-constructive description", "adding Q#### as label/description/alias"), and some
change tags in incorrect names (such as "URL in item"). It should be possible to merge or rename them.

See also T20670: Create ability to add / remove tags from edits / actions.

Event Timeline

Bugreporter raised the priority of this task from to Needs Triage.
Bugreporter updated the task description. (Show Details)
Bugreporter added subscribers: Bugreporter, TTO.
TTO triaged this task as Medium priority.
TTO updated the task description. (Show Details)

How do you want to force an extension to rename a tag? I think just merging would be enough. I don't know how OAuth apps work but renaming for instance VisualEditor tags would not make sense. AbuseFilter tags could be also renamed easily, you would only have to go to the filter, change the tag name and then merge the old one to the new one.

TTO removed TTO as the assignee of this task.Aug 18 2018, 12:53 AM

Rename should be easily doable given that change_tag is normalized T185355. Merging might be complex but can be done through batches of jobs.

Renaming problems:

  • should a rename update log entries, which enumerate all added/removed tags?
  • system and extension tags (eg. AbuseFilter) shouldn't be renamed

Merging problems:

  • a revision/log entry may be tagged with more tags, two of which should be merged

Renaming problems:

  • should a rename update log entries, which enumerate all added/removed tags?
  • system and extension tags (eg. AbuseFilter) shouldn't be renamed

Merging problems:

  • a revision/log entry may be tagged with more tags, two of which should be merged

Per the report at T250571: Add a way to rename a tag, extension tags should be renamable

This would actually be pretty simple; current tag names are only stored in one place - change_tag_def.ctd_name

Proposal:
At Special:Tags, add a rename action
Rename from: any current tag name, regardless of validity
Rename to: any valid tag name
New log entry: managetags/rename
Required right: managechangetags (or should it be a new right?)

Remaining issues:
What should happen to log entries that include the names of tags added?
Example:
https://en.wikipedia.org/w/index.php?title=Special:Log&logid=107321456 is adding a tag to a revision. In the database, it is stored as (log_params):
a:7:{s:8:"4::revid";s:9:"801986013";s:8:"5::logid";b:0;s:16:"6:list:tagsAdded";a:1:{i:0;s:12:"New redirect";}s:23:"7:number:tagsAddedCount";i:1;s:18:"8:list:tagsRemoved";a:0:{}s:25:"9:number:tagsRemovedCount";i:0;s:11:"initialTags";a:0:{}}
In this case, the New redirect tag was added.

Potentially, tag names wouldn't be stored directly in the log entries, but rather log entries would refer to the change_tag_def.ctd_id of the relevant tags, with change_tag_def.ctd_name being checked at run time.

If existing log entries should be updated, it would have a slightly higher db impact, though a preliminary look suggests that there aren't many cases of users manually adding and removing tags on most wikis.
If the existing log entries don't need to be updated, the db impact should only be a single write to the definition table (and the associated logging of the action, recent change, etc)

Thanks for working on this!

extension tags should be renamable

I was concerned about AbuseFilter where the filters store tags by name. I created T202195 for this but nothing has been done yet (low prio). Now I can imagine that hooks could work (the extension should be willing to rename tags, we cannot force it if it isn't).

DannyS712 changed the task status from Open to Stalled.May 27 2020, 5:16 AM
DannyS712 moved this task from Unsorted to Later on the User-DannyS712 board.

Waiting until T253716: `tag` log entries should reference tag id rather than name is decided one way or another before proceeding