Skins make use of hooks to allow extensions to integrate themselves into the skin and support the extension-ecosystem we have. However, often skins need to make last minute modifications based on the data collected via extensions - for example in some cases it may want to modify HTML to support icons, it may want to disable certain features under certain circumstances, or prefer certain options over others when available.
What happens?:
Right now all hooks are registered and run in ain first in-first out order of registration. This meant that when rolling out a new version of Vector we hit a bug T287533. We fixed this by creating a skin function that essentially wrapped the hook so the skin could register it's hook using inheritance instead of hooks.
What should have happened instead?:
Ideally all skin hooks would be run after extension hooks. Since skins are responsible for the output this makes sense from a product point of view.
- Notes **
In CI we enforce that extensions are loaded before skins so this issue was not picked up in our CI or beta cluster. However, it did surface as an issue in production.
Related: T212482
Related slack thread
https://wikimedia.slack.com/archives/C01R06P8D1B/p1626381636166400
(Sorry this is a private, but basically says all of the above in a less coherent way :))