Page MenuHomePhabricator

Review uses of ParserOptions::setInterfaceMessage(), add setIsMessage() to them if appropriate
Closed, ResolvedPublic

Description

We should probably review all uses of ParserOptions::setInterfaceMessage (https://codesearch.wmcloud.org/search/?q=setInterfaceMessage\b) and consider if they should use setIsMessage too.

Event Timeline

Reviewed extensions:

Change #1152109 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/CiteThisPage@master] Add setIsMessage() to match setInterfaceMessage()

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

Change #1152123 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] OutputPage: Use ParserOptions::setIsMessage() in wrapWikiMsg()

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

Change #1152124 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] ParserOutput: Document setIsMessage() with setInterfaceMessage()

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

Reviewed all of core as well, these seem like the only places that need changes.

A_smart_kitten subscribed.

Side note — genuine question, if 223e85ac was/could be a breaking change for some extensions, should something about it be mentioned in the 1.45 release notes?
& as another question (for my own information): I don't know what the stable interface policy would imply with regards to the change — should it technically go/have gone through the deprecation process (due to not necessarily maintaining backwards compatibility), or would e.g. just a mention in the release notes be fine here? (genuine question; i'm not trying to suggest anything either way here — i'd just like to learn myself for the future :))

Side note — genuine question, if 223e85ac was/could be a breaking change for some extensions, should something about it be mentioned in the 1.45 release notes?
& as another question (for my own information): I don't know what the stable interface policy would imply with regards to the change — should it technically go/have gone through the deprecation process (due to not necessarily maintaining backwards compatibility), or would e.g. just a mention in the release notes be fine here? (genuine question; i'm not trying to suggest anything either way here — i'd just like to learn myself for the future :))

Genuine answer: I think the stable interface policy doesn't specify this. You could argue that ParserOptions::setInterfaceMessage() is stable to call, and therefore its behavior must not change without deprecation, and so it's a breaking change; or you could argue that this behavior was never documented anywhere (this is true AFAICS), and therefore it is not a part of the method's contract, there are also better and documented ways to achieving the same thing, and so it's not a breaking change.

My approach in such cases is usually to try to be nice to each other, that is (on the one hand) MW developers should review the uses in extensions, propose fixes or at least file bugs, and put it in the release notes anyway; and (on the other hand) MW users shouldn't try to get this change backed out and replaced by a deprecation, since it would be rather annoying.

(And we probably shouldn't make the policy more detailed to try to provide answers for this case… It's already long enough and no one reads this except when rules-lawyering each other)

I'll send another patch with a release note, thanks for the reminder.

Change #1152170 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] Add release note for ParserOptions::setInterfaceMessage() / setIsMessage()

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

Change #1152124 merged by jenkins-bot:

[mediawiki/core@master] ParserOutput: Document setIsMessage() with setInterfaceMessage()

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

Change #1152123 merged by jenkins-bot:

[mediawiki/core@master] OutputPage: Use ParserOptions::setIsMessage() in wrapWikiMsg()

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

Change #1152170 merged by jenkins-bot:

[mediawiki/core@master] Add release note for ParserOptions::setInterfaceMessage() / setIsMessage()

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

Change #1152109 merged by jenkins-bot:

[mediawiki/extensions/CiteThisPage@master] Add setIsMessage() to match setInterfaceMessage()

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

Side note — genuine question, if 223e85ac was/could be a breaking change for some extensions, should something about it be mentioned in the 1.45 release notes?
& as another question (for my own information): I don't know what the stable interface policy would imply with regards to the change — should it technically go/have gone through the deprecation process (due to not necessarily maintaining backwards compatibility), or would e.g. just a mention in the release notes be fine here? (genuine question; i'm not trying to suggest anything either way here — i'd just like to learn myself for the future :))

Genuine answer: I think the stable interface policy doesn't specify this. You could argue that ParserOptions::setInterfaceMessage() is stable to call, and therefore its behavior must not change without deprecation, and so it's a breaking change; or you could argue that this behavior was never documented anywhere (this is true AFAICS), and therefore it is not a part of the method's contract, there are also better and documented ways to achieving the same thing, and so it's not a breaking change.

My approach in such cases is usually to try to be nice to each other, that is (on the one hand) MW developers should review the uses in extensions, propose fixes or at least file bugs, and put it in the release notes anyway; and (on the other hand) MW users shouldn't try to get this change backed out and replaced by a deprecation, since it would be rather annoying.

(And we probably shouldn't make the policy more detailed to try to provide answers for this case… It's already long enough and no one reads this except when rules-lawyering each other)

I'll send another patch with a release note, thanks for the reminder.

Thank you for the detailed explanation (and for the release notes patch)!