Page MenuHomePhabricator

Remove deprecated code from SpecialPageFactory
Closed, ResolvedPublic

Description

Motivation

At the moment there's a deprecated logic exists in SpecialPageFactory.php that can be safely removed

	if ( $rec instanceof SpecialPage ) {
				wfDeprecated(
					"a SpecialPage instance (for $realName) in " .
					'$wgSpecialPages or from the SpecialPage_initList hook',
					'1.34'
				);

				$page = $rec; // XXX: we should deep clone here
			}

Expected Result:

The occurance above should be removed.

Event Timeline

@Peter.ovchyn: Assuming this task is about the MediaWiki-Special-pages code base, hence adding project tag so other people who don't know or don't care about random team tags can find this task when searching for tasks.

@Pchelolo @daniel Honestly, I don't remember the task I took as this one as a followup.

So 2 questions now:

  • According to https://www.mediawiki.org/wiki/Stable_interface_policy : Code MUST emit hard deprecation notices for at least one major MediaWiki version before being removed. It is RECOMMENDED to emit hard deprecation notices for at least two major MediaWiki versions. Doesn't this mean that we can't remove it earlier 1.36?
  • In general, shouldn't it be like a policy that we shouldn't have hard deprecated code for more than 2 versions? Say for 1.35 we can't leave code, hard deprecated 1.33 and earlier?

@Pchelolo @daniel Honestly, I don't remember the task I took as this one as a followup.

So 2 questions now:

  • According to https://www.mediawiki.org/wiki/Stable_interface_policy : Code MUST emit hard deprecation notices for at least one major MediaWiki version before being removed. It is RECOMMENDED to emit hard deprecation notices for at least two major MediaWiki versions. Doesn't this mean that we can't remove it earlier 1.36?

Yes. Or even later, depending on when the hard deprecation started. The version given in the message would be the version for soft deprecation, often one release before hard deprecation.

  • In general, shouldn't it be like a policy that we shouldn't have hard deprecated code for more than 2 versions? Say for 1.35 we can't leave code, hard deprecated 1.33 and earlier?

That is certainly desirable and we should invest into making this happen. It shouldn't be a hard requirement though. But sometimes it's tough to get things migrated in time. Especially for things that are used in thousands of places, like the Revision class.

We're now in 1.38 of MediaWiki, should we begin to investigate and remove this or should we still wait?

Change 735063 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/core@master] specialpage: Remove deprecated check of special page object checks

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

Change 735063 merged by jenkins-bot:

[mediawiki/core@master] specialpage: Remove deprecated check of special page object checks

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

DAlangi_WMF claimed this task.

Code now removed! Thanks!