Why:
* When a temporary account exits their session, the
Special:UserLogout page is loaded to indicate the success.
* However, the success page talks about the temporary account
logging out which may cause confusion.
* Per design mocks shared on T374519, this should be modified
to indicate that the user logged out of a temporary account.
What:
* Set 'templogout' as the page title when the user is logging out
of a temporary account.
* Set 'logouttext-for-temporary-account' as the message shown
for a logout success when the user is logging out from a
temporary account
* Update mediawiki.page.ready/ready.js to add a flag to the
URL Special:UserLogout URL that is redirected to once the
logout API call has occured.
* Update tests for SpecialUserLogoutTest
Bug: T374519
Change-Id: Ib62cdb5ba716976321cd556aa9defe97b3446b33
This brings Jest to MW Core so that Vue components can more easily be
tested. Packages ending with 'icons.json' are auto-mapped to the
@wikimedia/codex-icons package, establishing a new convention.
Jest is needed for testing Vue, but can be used for general JS testing
as well. Documentation to come at https://www.mediawiki.org/wiki/Jest
Usage: to run the tests, run "npx jest" or "npm run jest" in the root
folder. This could be aliased to a "test:unit" script in package.json
if desired.
In order to make a Vue component testable, it is required to follow the
`module.exports = exports` pattern. See:
https://nodejs.org/api/modules.html#exports-shortcut
A default jest.setup.js is added that mocks Core's mw global object, as
well as providing the $i18n Vue plugin. This is based on
Extension:GrowthExperiments (GPL-3.0-or-later). See https://w.wiki/B9vM
An initial test for mediawiki.special.block is added, exemplifying how
to mock calls to mw.config.get().
NOTE: The "overrides" added to package.json is a temporary measure to
get around a current issue with caniuse-lite and the stylelint plugin
that relies on it. See:
https://github.com/RJWadley/stylelint-no-unsupported-browser-features/issues/299
Bug: T251790
Change-Id: I1af15e038d17b0f1c645fc5debf9db5846f6215c
Why:
* The deleteSelfExternals.php maintenance script is broken on
my local wiki as the SQL generated by the script errors out
when run on MariaDB.
* This script should be fixed, updated to use the query builders,
and tested to ensure that any future breakages do not go
unnoticed.
What:
* Fix the deleteSelfExternals.php script to use a DELETE query
that works, by generating it using the query builder.
* Create DeleteSelfExternalsTest to test that the script now
works.
Bug: T371167
Change-Id: Id423fa5c1bfe666f57a38e733334342ac1ad2cea
Three tests with that name were by mistake going to `/Main Page` instead of `Main Page`.
Bug: T373125
Change-Id: I5936f2c944765f576ab87d899002f7f24116ef44
Fix file doc blocks while at it.
> Remove duplicate description from file block in favour of class doc.
> This reduces needless duplication and is often incorrect or outdated,
> and helps make file headers more consistently (visually) ignorable.
>
> Add missing `ingroup` to class doc (and remove any from file doc)
> as otherwise the file is indexed twice (e.g. in Doxygen) which makes
> navigation on doc.wikimedia.org rather messy.
>
> Ref https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged+owner:Krinkle+branch:master
Bug: T364652
Change-Id: Icc36566da1c7190b0f4269719f34d3d6a83026c1
Make it explicit that there are three separate tests
by expanding test names.
Until now, these three tests were doing the same thing,
but in a different way. All three tests had the same name.
That made it harder to debug if anything went wrong.
For example, all three tests created the screenshot file
with the same name.
Bug: T373125
Change-Id: I53f62186fd4e8ffbe5e93642c933da2493b91896
This patch begins migrating the WANObjectCache metrics from graphite
to prometheus. This class can be constructed directly and parameter
options (which might include a stats collector object) passed, so we
need a way to detect the incorrect case and warn accordingly.
Since this is used by extensions, and we want to support only the new
StatsFactory option. We need a way to track and warn places where the
old stats collector is still in use and also put in place a mechanism
so new code doesn't use the old stats collector.
So, constructing a WANObjectCache object with an IBufferingStatsDataFactory
stats collector is deprecated in this patch in favor of the new collector.
Callers are responsible for fixing usage to StatsFactory.
Bug: T359257
Change-Id: If1162f69997b1b914fb9e02dad7d7ae1540d2d01
wfGetUrlUtils() is also deprecated, but less so, so we can do this first
and then properly replace the individual uses with dependency injection
in local pieces of work.
Also:
* Switching Parser::getExternalLinkRel to UrlUtils::matchesDomainList
exposed a type error in media.txt where $wgNoFollowDomainExceptions
was set to a string (which is invalid) instead of an array.
Bug: T319340
Change-Id: Icb512d7241954ee155b64c57f3782b86acfd9a4c
Why:
- When signing up for an account, temporary users are currently forced
to provide a reason for creating an account, and also have the option
to send a temporary password to an email address.
- Neither of these options are useful for temporary users wanting to
create a full user account.
What:
- Don't show these two form fields on Special:CreateAccount for temporary users.
- Add a functional test for the temporary user account creation flow.
Bug: T328718
Change-Id: Ie545857f7647be89d9462ec2b0def48690f0a2bf
I believe we don't need this any more. A test should never leave an
uploaded image behind, but delete it. It should be totally fine when
the same trivial test uploads the same image over and over again. All
the extra complexity to trick MediaWiki's duplicate detection shouldn't
be necessary (any more).
Also change the default to svg instead of jpg. Again, this creates much
smaller files with much less effort.
Note this code was already mostly unused because of the previous patch
I7f3d586.
Change-Id: I5c16ba7bed0fffa43549b786e50d6d1dd5592ad0
This allows a primary auth providers to update the "remember me" status
of another primary provider in the same login request flow. If authentication
that happened elsewhere and a "remember me" / "keep me logged in" (extended
login period is selected), the value of this action applied by the remote
primary provider should be applied to the local wiki when the user is
redirected back to continue authentication there.
This is useful because:
In the case of Wikimedia's central domain wiki in SUL3 mode, we want to
apply the remember me (keep me logged in) flag value from the central domain
to the local domain.
Bug: T369668
Change-Id: I6e2e2d892d2b777cb4757c7c0d222afad9da506c