This is needed for proper cross-RDBMS support
This reapply a change from I46206e0b3a687dff3168a81cf0020e669133e876,
reverted with I1c8c409b7820512b3e31246a7f3d8c1cf4db209c.
Bug: T244898
Change-Id: I8b1387aff18d88088a993bc099165e9882658ac0
This reverts commit 4eb8fa23e4.
Reason for revert:
Wikimedia\Timestamp\ConvertibleTimestamp::getTimestamp:
The timestamp cannot be represented in the specified format
Bug: T304307
Change-Id: I1c8c409b7820512b3e31246a7f3d8c1cf4db209c
== Problem 1 ==
As of I09c27a084100b223, tests/qunit/index.js or equiv was used to
load test files asynchronously from a using() callback. This was
untracked by RL or QUnit, and thus sometimes ended up finishing after
the test runner was already done executing all tests. In CI this
means the tests are sometimes never loaded and the browser (or Node)
process already killed before they even have a chance to arrive.
Prior to QUnit 2.17, this was no way of detecting this. As of
QUnit 2.17 (core upgraded last week) when running tests manually
the following helpful warnings appear in the console:
> [warning] Unexpected test after runEnd.
> [warning] This is unstable and will fail in QUnit 3.0.
> test @ qunit.js
> tests/qunit/model/test_mw.echo.dm.SeenTimeModel.js
> require
There were about 1072 instances of this warning, all from Echo.
Fix this problem by removing the async callbacks and specifying the
two modules as normal dependencies instead.
== Problem 2 ==
Class NotificationBadge was being loaded in a strange way out of
bound. This was a violation of module boundaries and should not be
needed other than for a temporary hack or other tech debt. More
generally when a test uses `packageFiles` this is a likely sign of
tech debt or misunderstandings.
Instead, depend on `ext.echo.mobile` and export/import the class
as normal.
After this, the test module can use `scripts` instead.
== Problem 3 ==
The `ext.echo.mobile` uses a Mustache template which the test
was also duplicating a reference to. This is no longer needed now.
Due to the `qunit/index.js` file carefully splitting the operations
between template assignment and file loading, I wondered whether
it was meaning to replace or mock it with something else, but it
simply refers to the same file and only does this because it wasn't
using the module directly. This is now resolved.
If you do need to mock in the future, this can simply be done
by assigning `NotificationBadge.prototype.template` from a
beforeEach() callback in the test suite, or by supporting it
property as a constructor option in NotificationBadge.js and
assigning `this.template` there, which is supported by the
mobile `View` class already it seems and would follow DI patterns
more effectively.
== Problem 4 ==
Most of the Echo tests were ignored sometimes and executed other
times.
The test for `ext.echo.mobile` in particular though was never
executed in CI specifically because:
> Undefined module: 'mobile.startup'
This became a hard error with this patch, which is fixed by
the CI config change with Ie9dabe3269c56fa76db8e51.
Bug: T299780
Change-Id: Ie4a87f3b8085fd6ae53ec586c1782cc266d5288a
It is common for internal files to export a single value, e.g.
when a file exports a single class or other special value.
However, this is uncommon for a module's overall export.
* It can create the misunderstanding that the init code is immediately
executed, when it is in fact delayed.
* This leads to the obscure `require()()` statement that is easy to
misunderstand.
* The least-effort way to expand this is by adding a statement
like `module.exports.Foo = Foo` after `module.exports = init`
which has the sublte behaviour that 1) it only works in this
order, not reversed as then Foo would be de-referenced by the
second assignment, and 2) it has the subtle effect of attaching
Foo to the `init` function as `init.Foo` which is non-obvious,
and 3) makes the init function unsafe to pass around, wrap,
stub or otherwise treat as a regular function.
Remedy by naming it as "init" on a regular module export object.
Change-Id: I51065e00f9dcaec075578a46df4de32c7a427df3
Updating 'svgo' to v2.8.0 and newest Wikimedia SVG guidelines –
mainly around new whitespace features of SVGO.
Change-Id: I63c72634eb2bb7063d71c8c21679f6f2091a4f1f
Comments has been duplicating these methods for quite some time for no real reason other than that they're private here.
Duplicating these methods appears to be necessary if and when working with extensions where users can be @mentioned but which are
not implemented as ContentHandler subclasses or otherwise related to regular wikitext pages.
Change-Id: I9c097bab9c5eed8f2399c86897b1f8968126c765
Moved the factory deeper into the code right before the one usage it
still needed a full user object
Narrow done method arguments from User to UserIdentity
and use the identity directly
Change-Id: Ic118f23ef504c7fda892480df61ea68c10915f78