Page MenuHomePhabricator

Proofread Page: Review stable code (hooks, mw object, undocumented) and mark (un)stable interfaces before 1.42.0
Closed, ResolvedPublic

Description

The stable interface policy was introduced in September 2023 during the 1.41 MediaWiki release. As a result of the introduction of this policy I am asking teams to take the opportunity to review their existing stable APIs and take appropriate action to limit unsupported APIs where necessary and possible.

TODO

  • Please read the guidelines around what constitutes stable code
  • Please remove any functions on the mw object that you do not wish to consider stable. Note "Code that was never part of a public MediaWiki release, and never consumed according to Codesearch and Global Search MAY be changed (including marked explicitly as @private) or removed without deprecation, since the code has never become part of the stable interface or used."
  • Please add @private or @internal documentation tags to hook events that you wish to limit usage of.

Event Timeline

Jdlrobson renamed this task from Proofread Page: Review code on mw object and mark (un)stable interfaces before 1.42.0 to Proofread Page: Review stable code (hooks, mw object, undocumented) and mark (un)stable interfaces before 1.42.0.Oct 4 2023, 4:45 PM

FYI, the 1.42 branch point is in a matter of hours; it doesn't appear that this will be done by then?

The stable policy grace period is now closed, so any code from now on that has not been marked as @internal or @private should be considered stable per the frontend stable policy.

For ProofReadPage the following APIs (and all public methods associated with these objects) can now be considered stable for use in extensions and gadgets (and are subject to the deprecation policy)

  • mw.ext.proofreadPage
  • mw.proofreadpage

Hooks:

If this is not acceptable please comment in the next 7 days so we have a record of the intent to change this, otherwise we can decline this ticket.
(If you need to fix these APIs to not be stable, please make sure to backport any applicable patches to 1.42 branch).

@Jdlrobson What/where is mw.ext.proofreadPage being created ?

Similarly proofreadpage-openseadragon-no-image-found is not a API that is provided by ProofreadPage. I'm super confused where these are showing up.

@Soda my mistake - I got this list from doing a quick grep of code. Looks like mw.ext.proofreadPage is in a Lua template. Updated my message!

Taking a look at the rest:

  • ext.proofreadpage.osd-no-image-found should be fine to have around. That code path does get exercised (Thumbor is notoriously unstable for Wikisource).
  • ext.proofreadpage.page-selection-register-filter is part of a beta feature, but is mostly staT344928ble, no issues there
  • ext.proofreadpage.osd-controller-available is very stable no issues there

Regarding mw.proofreadpage:

  • mw.proofreadpage.PagelistInputWidget most of this is supposed to be internal and probably needs to be removed unless somebody legitimately uses this (I do not know if anyone does)
  • mw.proofreadpage.viewer is deprecated and has been for a while, however it cannot be removed since Inductive's tool still uses it (AFAIK)
  • mw.proofreadpage.openseadragon is stable and has been for a while
  • mw.proofreadpage.PageQualityInputWidget is internal and probably should not be exposed. (I'm pretty sure nobody uses this since it was introduced fairly recently in T344928)

Unrelated to this, there is a bunch of scripts on wikisource that use $( '.prp-page-image img' ).attr( 'src' ) which would probably go against the stable interface policy :( These should probably be asked to change over to the mw.proofreadpage.openseadragon API.

@Soda let me know if you need any help reviewing or documenting these APIs and preparing backports. Happy to help!

Change #1020816 had a related patch set uploaded (by Sohom Datta; author: Sohom Datta):

[mediawiki/extensions/ProofreadPage@master] Remove internal APIs from global namespace after OOUI infusion

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

Change #1020734 had a related patch set uploaded (by Sohom Datta; author: Sohom Datta):

[mediawiki/extensions/ProofreadPage@REL1_42] Remove internal APIs from global namespace after OOUI infusion

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

@Jdlrobson Could you take a look at the patch if the cherry pick/backport was setup correctly ?

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

[mediawiki/extensions/ProofreadPage@master] Mark APIs as internal and not stable

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

Change #1020734 abandoned by Sohom Datta:

[mediawiki/extensions/ProofreadPage@REL1_42] Remove internal APIs from global namespace after OOUI infusion

Reason:

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

Change #1020816 abandoned by Sohom Datta:

[mediawiki/extensions/ProofreadPage@master] Remove internal APIs from global namespace after OOUI infusion

Reason:

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

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

[mediawiki/extensions/ProofreadPage@REL1_42] Mark APIs as internal and not stable

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

Change #1020848 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] Mark APIs as internal and not stable

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

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

[mediawiki/extensions/ProofreadPage@master] mw.proofreadpage.viewer should log deprecation warnings

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

Change #1020855 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] mw.proofreadpage.viewer should log deprecation warnings

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

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

[mediawiki/extensions/ProofreadPage@REL1_42] mw.proofreadpage.viewer should log deprecation warnings

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

Change #1020735 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@REL1_42] Mark APIs as internal and not stable

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

Change #1020741 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@REL1_42] mw.proofreadpage.viewer should log deprecation warnings

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

Jdlrobson claimed this task.