On Mon, Jul 22, 2013 at 8:39 AM, Mark A. Hershberger <mah(a)everybody.org>wrote;wrote:
Do you have any recommendations for how we should
handle deprecations?
Is this done on a case-by-case basis?
Most of the deprecated hooks have ContentHandler-aware replacements with
compatible signatures. The mapping is as follows:
ArticleAfterFetchContent -> ArticleAfterFetchContentObject
ArticleInsertComplete -> ArticleContentInsertComplete
ArticleSave -> ArticleContentSave
ArticleSaveComplete -> ArticleContentSaveComplete
ArticleViewCustom -> ArticleContentViewCustom
EditFilterMerged -> EditFilterMergedContent
EditPageGetDiffContent -> EditPageGetPreviewContent
EditPageGetDiffText -> EditPageGetDiffContent
EditPageGetPreviewText -> EditPageGetPreviewContent
Only one deprecated hook could not be updated in this fashion:
'ShowRawCssJs'.
(If you want to see the diff of the patch that deprecated the hooks, see <
https://git.wikimedia.org/commitdiff/mediawiki%2Fcore/49ed9dfdd05023cbd5d06…
)
I like the approach that Python's 2to3 tool (<
http://docs.python.org/2/library/2to3.html>) and the 'six' library (<
http://pythonhosted.org/six/>) take, which is to provide an interface for
declaring 'moves', which map a deprecated or renamed method name to its
modern equivalent. We could have something like that in core.
Daniel was diligent about adding wfDeprecated calls to the deprecated
methods that the older hooks calls. I wonder if we could add a Jenkins
check that flags usage of deprecated features. A sophisticated version
would trace the execution of unit tests and flag diffs that activate
deprecated code paths. But for starters we could just have a non-voting
Jenkins job that greps diffs for deprecated hook names.
Ori