Page MenuHomePhabricator

Remove the MinervaTemplate class and complete a technical goal
Closed, ResolvedPublic5 Estimated Story Points

Description

MinervaTemplate::getTemplateData sets data that is indirectly setting data already set in SkinMinerva.

For example SkinMinerva::prepareBanners sets the bannersfield.

All these keys should be set inside SkinMinerva::getTemplateData.

For example the banners key could be set by making prepareBanners return a string and updating SkinMinerva::getTemplateData like so:

'banners' => $this->prepareBanners(),

All remaining code inside MinervaTemplate is in the scope of this task:

			'banners' => $data['banners'],
			'isAnon' => $data['username'] === null,
			'userNotificationsHTML' => $data['userNotificationsHTML'] ?? '',
			'data-main-menu' => $this->getMainMenuData( $data ),
			'hasheadingholder' => $hasHeadingHolder,
			'taglinehtml' => $data['taglinehtml'],
			'headinghtml' => $data['headinghtml'] ?? '',
			'postheadinghtml' => $data['postheadinghtml'] ?? '',
			'userMenuHTML' => $data['userMenuHTML'],

TODO

  • At the end of this task MinervaTemplate should cease to exist.
  • When handling isAnon make sure the data field is replaced with the existing is-anon field rather than creating a new one.
  • There should be no calls to $tpl->set inside SkinMinerva
  • There should be no creation of MinervaTemplate inside SkinMinerva

QA steps

  • Make sure an article page in Minerva looks the same between beta cluster and production
  • Test for anonymous users
  • Test for logged in users with AMC disabled
  • Test for logged in users with AMC enabled

QA Results - Beta

ACStatusDetails
1T293815#7524254
2T293815#7524254
3T293815#7524254

Event Timeline

Jdlrobson triaged this task as Medium priority.
Jdlrobson created this task.
Jdlrobson renamed this task from Remove the MinervaTemplate class. to Remove the MinervaTemplate class and complete a technical goal.Nov 1 2021, 9:33 PM

Change 738034 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/skins/MinervaNeue@master] Remove MinervaTemplate class

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

cjming updated the task description. (Show Details)
cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
cjming subscribed.
cjming updated the task description. (Show Details)

Change 738464 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@master] Remove SkinMinerva class properties

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

Change 738034 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Remove MinervaTemplate class

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

Change 738464 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Remove SkinMinerva class properties

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

Edtadros subscribed.

Test Result - Beta|Prod

Status: ✅ PASS
Environment: beta/enwiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device: iPad

Test Artifact(s):

QA Steps steps

Make sure an article page in Minerva looks the same between beta cluster and production
✅ AC1: Test for anonymous users

BetaProd
en.m.wikipedia.beta.wmflabs.org_wiki_Hooded_skunk(iPad) (4).png (2×1 px, 991 KB)
en.m.wikipedia.org_wiki_Hooded_skunk(iPad) (4).png (2×1 px, 1 MB)

✅ AC2: Test for logged in users with AMC disabled

BetaProd
en.m.wikipedia.beta.wmflabs.org_wiki_Hooded_skunk(iPad) (3).png (2×1 px, 994 KB)
en.m.wikipedia.org_wiki_Hooded_skunk(iPad) (3).png (2×1 px, 1 MB)

✅ AC3: Test for logged in users with AMC enabled

BetaProd
en.m.wikipedia.beta.wmflabs.org_wiki_Hooded_skunk(iPad) (2).png (2×1 px, 992 KB)
en.m.wikipedia.org_wiki_Hooded_skunk(iPad) (2).png (2×1 px, 1 MB)

This should have been tested in Beta before wmf.9 was pushed to prod. At best this shows that the code was deployed in prod without error.

Jdlrobson added a subscriber: ovasileva.

I can sign this one off.