Page MenuHomePhabricator

[Spike, 12hrs] How do we extract beta / stable mode code from MobileContext to new file?
Closed, DeclinedPublic0 Estimated Story PointsSpike

Description

It is suggested that we move all setMobileBetaMode, isBetaGroupMember, and beta/stable constants from MobileContext into new class, something like MobileUserOptions, or MobileUserMode and keep all logic (reading/writing user options/cookies etc) there. It will be easier to maintain/rewrite this feature, plus if we decide to handle anons, the only place where changes will be required are Special::MobileOptions (for render and submit logic) and that new class. See related T144085 and T143189.

We'd like to work out what the plan for refactoring this code is to remove confusion from code review/estimation.

Outcomes

On a wiki page make it clear how we want to architect this code, so that we all understand the planned refactor by answering these questions in the comments:

  • What is needed to move setMobileBetaMode, isBetaGroupMember, and beta/stable constants are moved to a new file or replace them with something unrelated to MobileContext?
  • What tests are missing?
  • How do we deal withNote isBetaGroupMember is a public API - there are 2 known usages outside MobileFrontend - UniversalLanguageSelector and Minerva - https://github.com/search?q=org%3Awikimedia+isBetaGroupMember&type=Code - … we do modify the public API we will need to follow the official MediaWiki deprecation policy.
  • Are there things we should do before taking this on? (We might want to hold off doing this in lieu of a discussed and agreed refactoring plan for MobileContext (see epic))

Sign off steps

Update the epic with the newly revised plan (with all learnings)

Event Timeline

Niedzielski created this task.
Niedzielski created this object with edit policy "Custom Policy".
Jdlrobson renamed this task from Extract beta / stable mode code from MobileContext to new file to [subtask] Extract beta / stable mode code from MobileContext to new file.Jan 2 2019, 7:54 PM

We should flesh this out before commiting to this particular refactoring.
Moving isBetaGroupMember will require following the deprecation notice since this a public API and used outside MobileFrontend.

I need to talk to Piotr about whether this is covered by the task he's working on or something new.

Chatting through this with Piotr tomorrow (hopefully!)

Jdlrobson renamed this task from [subtask] Extract beta / stable mode code from MobileContext to new file to [Spike] How do we extract beta / stable mode code from MobileContext to new file?.Jan 25 2019, 6:29 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson lowered the priority of this task from High to Medium.Feb 5 2019, 5:19 PM
Jdlrobson set the point value for this task to 0.
Jdlrobson renamed this task from [Spike] How do we extract beta / stable mode code from MobileContext to new file? to [Spike, 12hrs] How do we extract beta / stable mode code from MobileContext to new file?.Feb 27 2019, 5:17 PM
Jdlrobson updated the task description. (Show Details)
Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptJul 31 2019, 8:37 PM

Beta has not been enabled for some time, so I think we should instead plan to remove the code.