Page MenuHomePhabricator

Enable DiscussionTools page transformations (DOM modification) for all users
Closed, ResolvedPublic

Description

We are now able to put the page transformations in the parser cache (T267404), and also selective enable them using CSS/JS (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/647587).

Going forward we expect (1) more users to have the feature enabled by default, and (2) we will be building features that require page transformations even for users that don't have the tools enabled, for example linking to specific comments in a notification (T282029).

At this point it won't make sense to keep generating two versions of the page, and we should just apply our transformations to all talk pages.

Deployment specs

Deployment timing

Target deployment date: Tuesday, 21 September via the deployment train.

⚠️ The above depends on confirmation from @Ryasmeen + @EAkinloose that they have capacity to complete QA of T287098.

Testing instructions

QA
Monitoring for issues

This is a high exposure release, so

  • Check phabricator daily for mentions of issues related to the change @matmarex
  • Test T287098 daily to ensure it continues to work in desirable ways as it's scaled

Open question

  • When do we think this work should be merged? What – if any – specific testing should be done to ensure it's working as expected?
  • Assuming no issues emerge from T267404, these patches can be merged and deployed to all wikis. We've already trialled this on a number of wikis where the reply tool is enabled for everyone (opt-out) in T279864.

Technical description

Additional markup is added on discussion pages (broadly defined: including all talk namespaces, and namespaces like 'Wikipedia:' where comments are often posted). For each discussion comment, an anchor is added, which can be used to link to that comment within the discussion. Additionally, markup for DiscussionTools' reply tool and topic subscriptions is added (it is hidden using CSS when those tools are not enabled).

Below are some examples of the markup, based on the discussion here: https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#dtenable_testing. This is provided for reference only. The markup is subject to change. Please let us know if you're planning to build something that would depend on it.

Comments

Before:

<dl>
	<dd>
		Thank you for testing.  <a href="/wiki/User:Whatamidoing_(WMF)" title="User:Whatamidoing (WMF)">Whatamidoing (WMF)</a> (<a href="/wiki/User_talk:Whatamidoing_(WMF)" title="User talk:Whatamidoing (WMF)">talk</a>) 19:41, 27 August 2021 (UTC)
		<dl>...</dl>
	</dd>
</dl>

After: [when reply tool disabled]

<dl>
	<dd>
		<span data-mw-comment-start="" id="c-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z-Elli-2021-08-27T19:36:00.000Z"></span>
		Thank you for testing.  <a href="/wiki/User:Whatamidoing_(WMF)" title="User:Whatamidoing (WMF)">Whatamidoing (WMF)</a> (<a href="/wiki/User_talk:Whatamidoing_(WMF)" title="User talk:Whatamidoing (WMF)">talk</a>) 19:41, 27 August 2021 (UTC)
		<span class="ext-discussiontools-init-replylink-buttons">
			<span class="ext-discussiontools-init-replylink-bracket">[</span>
			<a class="ext-discussiontools-init-replylink-reply" role="button" tabindex="0" data-mw-comment='{"type":"comment","level":3,"id":"c-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z-Elli-2021-08-27T19:36:00.000Z","replies":["c-Elli-2021-08-27T19:42:00.000Z-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z"],"timestamp":"2021-08-27T19:41:00.000Z","author":"Whatamidoing (WMF)"}' href="">
				<!--__DTREPLY__-->
			</a>
			<span class="ext-discussiontools-init-replylink-bracket">]</span>
		</span>
		<span data-mw-comment-end="c-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z-Elli-2021-08-27T19:36:00.000Z"></span>
		<dl>...</dl>
	</dd>
</dl>

After: [when reply tool enabled]

<dl>
	<dd>
		<span data-mw-comment-start="" id="c-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z-Elli-2021-08-27T19:36:00.000Z"></span>
		Thank you for testing.  <a href="/wiki/User:Whatamidoing_(WMF)" title="User:Whatamidoing (WMF)">Whatamidoing (WMF)</a> (<a href="/wiki/User_talk:Whatamidoing_(WMF)" title="User talk:Whatamidoing (WMF)">talk</a>) 19:41, 27 August 2021 (UTC)
		<span class="ext-discussiontools-init-replylink-buttons">
			<span class="ext-discussiontools-init-replylink-bracket">[</span>
			<a class="ext-discussiontools-init-replylink-reply" role="button" tabindex="0" data-mw-comment='{"type":"comment","level":3,"id":"c-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z-Elli-2021-08-27T19:36:00.000Z","replies":["c-Elli-2021-08-27T19:42:00.000Z-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z"],"timestamp":"2021-08-27T19:41:00.000Z","author":"Whatamidoing (WMF)"}' href="">
				reply
			</a>
			<span class="ext-discussiontools-init-replylink-bracket">]</span>
		</span>
		<span data-mw-comment-end="c-Whatamidoing_(WMF)-2021-08-27T19:41:00.000Z-Elli-2021-08-27T19:36:00.000Z"></span>
		<dl>...</dl>
	</dd>
</dl>
Headings

Before:

<h2>
	<span class="mw-headline" id="dtenable_testing">dtenable testing</span>
	<span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:Village_pump_(technical)&amp;action=edit&amp;section=1" title="Edit section: dtenable testing">edit source</a><span class="mw-editsection-bracket">]</span></span>
</h2>

After: [when topic subscriptions disabled]

<h2 class="ext-discussiontools-init-section">
	<span class="mw-headline" id="dtenable_testing" data-mw-comment='{"type":"heading","level":0,"id":"h-dtenable_testing-2021-08-27T19:35:00.000Z","replies":["c-Whatamidoing_(WMF)-2021-08-27T19:35:00.000Z-dtenable_testing","c-Chipmunkdavis-2021-08-30T12:39:00.000Z-dtenable_testing","h-Arbitrary_subsection-dtenable_testing-2021-08-30T13:34:00.000Z","h-Flow?-dtenable_testing-2021-08-30T22:38:00.000Z","h-Large_number_of_notifications-dtenable_testing-2021-08-30T23:04:00.000Z","h-Master_list-dtenable_testing-2021-09-12T20:26:00.000Z"],"headingLevel":2,"placeholderHeading":false}'><span data-mw-comment-start="" id="h-dtenable_testing-2021-08-27T19:35:00.000Z"></span>dtenable testing<span data-mw-comment-end="h-dtenable_testing-2021-08-27T19:35:00.000Z"></span></span>
	<span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:Village_pump_(technical)&amp;action=edit&amp;section=1" title="Edit section: dtenable testing">edit source</a><span class="mw-editsection-bracket">]</span></span>
	<!--__DTSUBSCRIBE__h-Whatamidoing_(WMF)-2021-08-27T19:35:00.000Z-->
</h2>

After: [when topic subscriptions enabled]

<h2 class="ext-discussiontools-init-section">
	<span class="mw-headline" id="dtenable_testing" data-mw-comment='{"type":"heading","level":0,"id":"h-dtenable_testing-2021-08-27T19:35:00.000Z","replies":["c-Whatamidoing_(WMF)-2021-08-27T19:35:00.000Z-dtenable_testing","c-Chipmunkdavis-2021-08-30T12:39:00.000Z-dtenable_testing","h-Arbitrary_subsection-dtenable_testing-2021-08-30T13:34:00.000Z","h-Flow?-dtenable_testing-2021-08-30T22:38:00.000Z","h-Large_number_of_notifications-dtenable_testing-2021-08-30T23:04:00.000Z","h-Master_list-dtenable_testing-2021-09-12T20:26:00.000Z"],"headingLevel":2,"placeholderHeading":false}'><span data-mw-comment-start="" id="h-dtenable_testing-2021-08-27T19:35:00.000Z"></span>dtenable testing<span data-mw-comment-end="h-dtenable_testing-2021-08-27T19:35:00.000Z"></span></span>
	<span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wikipedia:Village_pump_(technical)&amp;action=edit&amp;section=1" title="Edit section: dtenable testing">edit source</a><span class="mw-editsection-bracket">]</span></span>
	<span class="ext-discussiontools-init-section-subscribe mw-editsection-like"><span class="ext-discussiontools-init-section-subscribe-bracket">[</span><a href="" class="ext-discussiontools-init-section-subscribe-link" role="button" tabindex="0" data-mw-comment-name="h-Whatamidoing_(WMF)-2021-08-27T19:35:00.000Z" title="Subscribe to receive notifications about new comments.">subscribe</a><span class="ext-discussiontools-init-section-subscribe-bracket">]</span></span>
</h2>

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 663223 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] Only show reply links when body class in present

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

META
Updated the task description with what we talked about in our team meeting on 3-Feb.

Change 659960 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Add body class to enable reply links

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

The above patch makes this possible but does not enable the page transformations everywhere as this task describes. That will happen later once we're happy with the initial rollout of the ParserCache feature.

Change 663223 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Only show reply links when body class in present

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

Given that we are happy that most people who receive a topic notification will already have the page transformations enabled, this is not a priority for now.

Given that we are happy that most people who receive a topic notification will already have the page transformations enabled, this is not a priority for now.

Moving to the backlog per the above.

ppelberg added a subscriber: Krinkle.

@Krinkle: a question for you about extending the work the Editing Team did in T280295 and T27964...

Question: what – if any – additional information would you need to give the the Editing Team the "go ahead" to converge on a single, DiscussionTools-transformed version of talk page HTML in the parser cache, on all wikis?

@ppelberg No reservations with that, I believe. If by some unforeseen cause we do find it causing an issue, I'm sure we'll find it and deal with it together accordingly. But, I'm not aware of anything that we know today that we can do to avoid a problem. So.. go ahead from me!

One thing to keep in mind, for the engineers, is to think through the scenario of a deployment rollback. Either the weekly train rolling back for unrelated reasons after a day of it being live, or for reasons specific to DT. At that point, the new/universial transformation entries would exist in the ParserCache and served back to the old not-universal code. Make sure all that is handled correctly by DT in a way that you're happy with. (E.g. through forward/backward compat, or through a parsercache key-vary).

One thing to keep in mind, for the engineers, is to think through the scenario of a deployment rollback. Either the weekly train rolling back for unrelated reasons after a day of it being live, or for reasons specific to DT. At that point, the new/universial transformation entries would exist in the ParserCache and served back to the old not-universal code. Make sure all that is handled correctly by DT in a way that you're happy with. (E.g. through forward/backward compat, or through a parsercache key-vary).

This scenario will work fine, the [reply] and [subscribe] links are hidden when they're undesirable using the styles in the 'ext.discussionTools.init.styles' module, which is already loaded on all pages where DiscussionTools features could theoretically be enabled. Thanks for pointing this out though.

Refs:

Change 713681 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Always apply DiscussionTools page transformations

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

We'll probably want to merge this after the currently planned reply tool deployments (T280599#7281173), so sometime in September.

matmarex updated the task description. (Show Details)

Change 713681 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Always apply DiscussionTools page transformations

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

LZaman renamed this task from Enable DiscussionTools page transformations (DOM modification) for all users to [Release Ticket] Enable DiscussionTools page transformations (DOM modification) for all users.Sep 21 2021, 5:22 PM
LZaman updated the task description. (Show Details)
LZaman updated the task description. (Show Details)

This change has caused visual issues in a few different places, none of them severe enough to revert it. I filed a separate task to list them all: T291833.

LZaman renamed this task from [Release Ticket] Enable DiscussionTools page transformations (DOM modification) for all users to Enable DiscussionTools page transformations (DOM modification) for all users.Sep 28 2021, 9:39 PM
ppelberg updated the task description. (Show Details)