| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Why:
- We would like to make the user links associated with expired temporary
accounts visually distinguishable from non-expired ones using
strikethrough styling and an information tooltip.
- The designs call for using Codex tooltips for the latter. Using the
Vue directive for this would require us to take a dependency on Codex
and Vue for every page that renders user links, and render a small
Vue.js app for each expired temporary user link, which does not seem
practical.
- We can, however, use Codex styles and implement our own simple tooltip
functionality without taking on unnecessary dependencies.
- This requires adding a new RL module to every page that uses
userLink(), so we should update userLink() to do this for us instead
of having to update every core and extension page that needs this.
What:
- Add a strikethrough to expired temporary account links
as per the design specification.
- Render a tooltip, hidden by default, for expired temporary account
links that is styled using Codex styles.
- Implement a simple jQuery tooltip handler for expired temporary
account links.
- Avoid caching expired temporary account link in UserLinkRenderer to
ensure each of them receives a unique ID.
- Add required ResourceLoader modules directly to the output in
userLink().
Bug: T358469
Change-Id: I4f70ff15becbc4991c4f1b0307a14d5354c79dc1
|
|\| | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why:
- After I4f70ff15becbc4991c4f1b0307a14d5354c79dc1, it will become
necessary to prefetch the expiration status of temporary accounts when
rendering user links via UserLinkRenderer for a large list of users.
- We would ideally like to accomplish this without requiring every user
of UserLinkRenderer to take a direct dependency on
TempUserDetailsLookup, which exposes this functionality.
- Since most users of UserLinkRenderer / Linker::userLink() already use
LinkBatch to prefetch page existence for the user and user talk pages
that UserLinkRenderer will link to, encapsulating the
TempUserDetailsLookup interaction within LinkBatch seems like a decent
middle ground.
What:
- Add LinkBatch::addUser(), which takes a UserIdentity and adds its user
and user talk pages to the batch while also triggering a batch lookup
of expiration status for users added this way when execute() is called.
Bug: T358469
Change-Id: Ic837961296cc4bf166dde79c7f073cc50ce925da
|
|/
|
|
|
|
|
|
|
| |
Provide an interface allowing extensions to add global preferences.
Add test for all the $global values.
Bug: T386592
Change-Id: Id982656e228efaa97068b90f5137a0495c86fae5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- The TSP team would like to change the way expired temporary account
user links are displayed, which requires an efficient way to fetch
their registration timestamps.
- On WMF wikis, which use CentralAuth, this requires fetching the first
(i.e. global) registration timestamp of the account, rather than the
naïve approach of using the registration timestamp from the local user
table.
- MediaWiki provides the UserRegistrationLookup facade to transparently
fetch the earliest registration timestamp for a single user, but
offers no batch interface to do the same.
- Since user links are often rendered in large pagers, a batch interface
is needed.
What:
- Add IUserRegistrationProvider::fetchRegistrationBatch(), which takes
an iterable of UserIdentities and returns a map of their registration
timestamps (or null if not available), keyed by user ID. Although this
interface is marked as stable to implement, its sole non-core
implementor according to codesearch is CentralAuth.
- Add UserRegistrationLookup::getFirstRegistrationBatch(), which
delegates to fetchRegistrationBatch() on configured registration
providers and returns the earliest registration timestamp for each user
in the batch.
- To avoid potential interface incompatibility in WMF production, this
depends on CentralAuth implementing the new IUserRegistrationProvider
method first.
Bug: T358469
Depends-On: Ibe28163e962161567d486607e36d999a36a1e604
Change-Id: I1f6af2693a8f0c5c854b8a6b04edd1eb21934007
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Main change:
* Add a class hierarchy representing block targets, representing a
target and type.
* Add BlockTargetFactory, replacing BlockUtils.
* Add CrossWikiBlockTargetFactory, replacing BlockUtilsFactory.
* Construct a BlockTarget object early in the request flow and pass it
down through the layers, instead of having every layer interpret
UserIdentity|string target specifications.
Also:
* Remove Block::TYPE_ID. Nothing uses it in code search, so there's
no point in porting it to the new system.
* Stop using the type constants as specificity scores. Add
BlockTarget::getSpecificity().
* Add DatabaseBlockStore::newUnsaved() to replace direct construction of
DatabaseBlock in insertBlock() callers. There are many such callers in
tests. This is part of the effort to remove the service container
usage in DatabaseBlock::__construct().
* Make DatabaseBlock::getRangeStart() and getRangeEnd() return null if
the block is not a range, since that is convenient for their only
caller following the resolution of T51504.
* Add DatabaseBlock::getIpHex() which similarly maps to a DB field in
the new schema.
* In ApiBlock and ApiUnblock, have ParamValidator provide UserIdentity
objects instead of converting to a string and back to a UserIdentity
again.
Bug: T382106
Change-Id: I2ce1a82f3fbb3cf18aa2d17986d46dbdcc70c761
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The doc comment of newBlockPermissionChecker() describes the $target
parameter as being optional. The returned object does not need or use a
target when checkBasePermissions() or checkEmailPermissions() are
called. But failing to pass a target when calling
checkBlockPermissions() is incorrect. This was the subject of the
linked bug. If an admin is performing a block, self-unblock permissions
need to be checked, this is not optional.
This could be enforced at runtime, but it seems safer and simpler to
enforce it statically.
So, move $target from being a constructor parameter to being a formal
parameter of checkBlockPermissions(). This formal parameter will be
statically required after a deprecation period.
Deprecate newBlockPermissionChecker() and introduce newChecker(), using
a name with a slightly less than conventional verbosity to allow us to
change the parameter order. There is no $target parameter to
newChecker().
Backwards compatibility is supported by adding an internal mutator
method setTarget(). This can easily be removed after the deprecation
period is over.
In Special:Block, checkBlockPermissions() was called with $target=null
on form entry, meaning that the user could unblock themselves if the
target was specified in the URL, but could not unblock themselves by
searching with the form. This seems inconsistent. So allow blocked
admins to see the search form, but show an error when they try to block
or unblock someone other than themselves.
Bug: T384716
Change-Id: I8c26cdcc9b87b74bc458fe731cf7f170a2607150
|
| |
| |
| |
| |
| |
| |
| | |
Since Ibffb2daaf817ce41102211bb9668b29a6e59c0c1, PageBundle::getHtml has
been removed. It shouldn't be used in tests.
Change-Id: I460e05b2095c354187678219d45f5488132005a4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
content and file pages
This patch reworks RestrictionStore::getCascadeProtectionSourcesInternal
to return a third and fourth array:
* One for cascading restrictions originating from templatelinks
* Another for those originating from imagelinks
They are used in PermissionManager::checkCascadingSourcesRestrictions
to differentiate cascading protection of file content and file page,
but could also be used in the future by action=info and other callers.
Bug: T24521
Bug: T62109
Bug: T140010
Change-Id: Ia5863f418538106f4fd657c672298ff6ac835805
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why:
- Rendering user links via UserLinkRenderer::userLink() and its
predecessor Linker::userLink() can be fairly expensive, so
RecentChanges has been caching them since
I91588aebae7e49e3d3cb77702cf28677b4a14c8d.
- We would like to start rendering a custom tooltip for user links
associated with temporary accounts, which requires returning a unique
ID for each tooltip so that it can be associated with the
corresponding link via an aria-describedby attribute for
accessibility.
- This won't work with the existing caching logic because it doesn't
treat links differently.
- Now that the UserLinkRenderer service exists, we can move the caching
logic there instead and allow every page, not just RecentChanges, to
automatically enjoy its benefits while transparently handling special
cases like expired temporary account links.
What:
- Implement process caching for user links in UserLinkRenderer.
- Replace Linker::userLink() with UserLinkRenderer in
RCCacheEntryFactory, and remove the now-redundant local process cache.
Bug: T358469
Change-Id: I0259e860c19f356ab66f45955f2997d307daa6e1
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- The TSP team would like to render user links for expired temporary
accounts differently.
- User links are currently rendered by Linker::userLink(), which is in
need of some refactoring as documented in T308000 and elsewhere.
- We should take this opportunity to clean up relevant code before
implementing our temporary account-related changes on top.
What:
- Introduce a new UserLinkRenderer class and service, and move the
functionality of Linker::userLink() to this class.
- Soft-deprecate Linker::userLink() and have it delegate to the new
service.
- Move and expand related test cases.
Bug: T358469
Bug: T308000
Change-Id: I974c4d92c5281067d53bb3bdc94eb0e290b7cadb
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This patch migrates the `MediaWiki.RateLimiter` metric to the new
Prometheus format.
Bug: T359367
Change-Id: Ic5098c9d9a2b7fd1aa4f7f6abde46ceb2cf58887
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RenameUserJob is moved to Job/RenameUserTableJob because there are two kinds of jobs now.
The newly added RenameUserDerivedJob is used for performing user-renames across
a wiki family using virtual domains or shared tables. Most code are
moved from SpecialRenameUser and maintenance/renameUser.
The new service, RenameUserFactory is added for constructing RenameUser
easier.
When a global rename happen, the central wiki will enqueue
RenameUserDerivedJobs for other wikis in the same family.
The derived jobs will check if the central wiki has the same user table
as local, and perform updates to local tables.
A new user-right 'renameuser-global' is also added because wiki families may
want global users to be renamed only by a limit set of users or
on a certain global wiki.
Bug: T104830
Change-Id: Ic4120cbd9a4850dfe22d009daa171199fe7c5e39
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Many tests failed if $wgAutoCreateTempUser['enabled'] was not set.
This is set in DevelopmentSettings.php. Set it in TestSetup.php.
* The Asia/Calcutta timezone, described as deprecated, is missing from
my system. Remove the test case.
* Three stub object tests called error_reporting(-1) on setUp() and
restored it on tearDown(), but our check for preserved error level
now runs as a postCondition hook, before tearDown(). This worked
anyway for most people because DevelopmentSettings.php also has
error_reporting(-1). Remove the error_reporting(-1) calls from the
tests since it's not actually needed to pass -- we intercept
deprecation calls at the application level. I confirmed that this fix
works with php -d error_reporting=0.
Change-Id: Ia43ce26345a0a8432c41b46907de2dfbffa00670
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- The REST API takes an optional renderid param when converting HTML
back to source wikitext, which is user-provided and may be invalid.
- Invalid render IDs cause an InvalidArgumentException to be thrown that
causes a 500 response.
What:
- Introduce a new error message for invalid render IDs in the REST API.
- Return a 400 with this new error message for HTML reverse-parses with
an invalid render ID.
Bug: T385568
Change-Id: I062419fe8952329a39781a49cdca2e94c3996447
|
|
|
|
|
|
|
| |
Backwards compatibility is being removed in
If7f3094dda0559ca8f515501d8a043322d1a7d90
Change-Id: I2b9b4090ba777e49d5f4b2e29f70ce88f7888f8b
|
|
|
|
|
|
|
|
|
|
|
| |
When renaming a user, RenameuserSQL will be (since next change) called
on each wiki within the family, so that all local (non-shared and not in
a mapped virtual domain) tables can be updated.
This is necessary to avoid updating tables that are set to be shared
with virtual domains for multiple times.
Bug: T104830
Change-Id: Ic4c4838ab6663594b35c0286dd0d5e168a2f6432
|
|
|
|
| |
Change-Id: I0f8a8cac36015bba52aea3ee2affd92f83d3574a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When unblocking by ID, ApiUnblock passed the target to
BlockPermissionChecker as a string, but the check for self-unblock
requires a UserIdentity.
UnblockUser passed the $target constructor argument to
BlockPermissionChecker, but that is always null when unblocking by ID.
Fix both and add tests.
Bug: T384716
Change-Id: I26a634cbed8789dd9fca48655f41fdd8c7066007
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- We want to refactor code that performs page lifecycle changes,
such as edit, create, delete, import, etc.
- The goal of the refactoring is to apply the observer pattern in
order to remove direct dependencies from page related code on
code that needs to be notified of the change.
- Before we start refactoring, we should cover the current behavior in
tests.
What
- Rename and clarify semantics of spy traits introduced earlier.
- Add coverage for talk page notifications
- Add coverage for resource loader module cache updates
- Fix dirty entries in Title instance cache after deletion
Bug: T378936
Change-Id: If06e2aa5bda84dfbee3278bf4a8d16064b6effc8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- Title::newFromText puts Title objects into a static cache array
to avoid parsing the same title text multiple times.
- After page deletion, objects in that cache may still reflect the
state prior to deletion.
What:
- Make DeletePage call Title::clearCaches()
- Also add checks for the same issue to MovePageTest.
Change-Id: I26a4aab19212ba5182b6ef3e9873a994954b4072
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Hard-deprecate all public DatabaseBlock methods which are simply a
b/c proxy into a service method. Most were already soft-deprecated.
* Hard-deprecate BlockManager::getUserBlock()
* Move DatabaseBlockTest methods testHardBlocks,
testT31116NewFromTargetWithEmptyIp, testNewFromTargetRangeBlocks,
testNewFromRow and testInsertExistingBlock to DatabaseBlockStoreTest.
* Move DatabaseBlockTest methods testBlockedUserCanNotCreateAccount and
testBlocksOnXff to BlockManagerTest.
Depends-On: I653d969a00d8f9732b347c2e409564d514acae67
Depends-On: Id603cf5959552847c99c222bfaa459ca260d6210
Depends-On: I539e4db644a882f6e4f363ffa1e483fd4b7950c1
Depends-On: Ied545f26fd657315682b0eb42da9e9dde73288d6
Depends-On: If38ec08111d40a261e34a63d67083b8faa862422
Depends-On: I527b8197cbe8085072b598c3b12621c63ddb9355
Depends-On: I0ba3fb90bc0512216cb2b3d7b5896f5de5232716
Change-Id: Ib0a3dbfa17c9250b6cec732a547b2ef0f70b2440
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Same as Ia294bf4 did for 1-line comments. This patch removes slightly
more complex 2-line PHPDoc comments that don't add any new information
to the code, but literally repeat what the code already says.
They say "don't document the code, code the documentation", and we
are doing this more and more. We just tend to forget to remove the
obsolete comments.
Note I'm also removing a line of text in a few cases when it's very
short and literally says the same as the method name. Again, such
comments add zero new information.
Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Found via a very hacky Codesearch [1]. Compare also the [[mw:Dependency
Injection]] edits [2] and [3].
[1]: https://codesearch.wmcloud.org/deployed/?q=\s[A-Z][A-Za-z0-9]*+\%24[A-Za-z0-9]%2B+%3D+null\b&files=\.php%24
[2]: https://www.mediawiki.org/w/index.php?title=Dependency_Injection&diff=prev&oldid=6096656
[3]: https://www.mediawiki.org/w/index.php?title=Dependency_Injection&diff=prev&oldid=6826718
Bug: T376276
Change-Id: I5274417342fa13f8c8b3e6af1b578f2d41fc063e
|
|\ \ \ |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I assume these are all either auto-generated by an IDE or the
language-level type declarations have been added later. In any case
the comments don't add any new information to what the code already
says. This is just extra clutter that makes the code harder to read,
I would argue.
There are many, many more comments like this. In this patch I
intentionally focus on the most trivial 1-line comments.
Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | | |
Bug: T379705
Change-Id: I6f1925f564e708be47cbc13a01a1b5d2d7b3da69
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Re-purpose the existing id parameter to support block ID. If both id,
and username are provided the request will fail
* If a target has more than one block and a specific block is not
provided it will fail with ipb_cant_unblock_multiple_blocks
Bug: T378148
Change-Id: I04928d989e6764ac93ec243a5fec9c7fe2b0b9b0
|
|\ \ \ \ |
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Add a limit to the HideUserUtils subqueries to avoid error "Subquery
returns more than 1 row". We really want to know if at least one row
exists.
* Fix outdated doc comment
* Add tests.
Bug: T382399
Change-Id: Ib3bc22e0b3080b3ae6e1d2591ac7f2a1ef57c6b3
|
|\ \ \ \
| |/ / /
|/| | |
| | | | |
patrolled."
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This keeps consistency as the original edit was never automatically patrolled - and the rollback action was a manual patrol of the original edit.
Bug: T302140
Change-Id: I3c28be8e606c7a427cecdfd31f115fa1c32641a5
|
|\ \ \ \ |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
RevisionRecord::getPage() returns a PageIdentity, which may
be a Title or a WikiPage. In the context of an ongoing page deletion,
the state of these objects may change and the page ID may get set to 0.
To provide a reliable stable interface that can be used e.g. in a
deferred update or job, we need to return an immutable value object
instead.
NOTE: this may break callers of getPage() that downcast to Title,
or that rely on the page ID contained in the returned PageIdentity
to be updated dynamically during page creation or deletion.
This is a modified version of I7440f8f30b05949. It reverts I4ed5406a8b3aa9, which reverted the original patch. The main difference
to the original patch is the additional check in the constructor of the
RevisionRecord base class and the regression test in SignatureValidatorTest.
Bug: T380536
Change-Id: I0ea915983b6187090f46ad23c9b582196b4be85f
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
same target"
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The loop releasing targets with different deltas did not account for the
fact that there may be some deltas with no targets. An
InvalidArgumentException was thrown.
So, fix it twice and add a regression test.
Bug: T382881
Change-Id: I7feac31891b5314daf20cec161fbadf7c5b4f8ca
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Why:
- Special:BlockList currently supports excluding blocks targeting IP
addresses or registered users, but not temporary accounts.
- To preserve feature parity when temporary accounts are enabled, it
should also allow excluding blocks that are targeting temporary
accounts.
What:
- Add a new filtering option to exclude blocks targeting temporary
accounts on Special:BlockList. This is only displayed if temporary
accounts are a known concept on the local wiki.
- Have the existing "Hide account blocks" checkbox exclude named users
only if temporary accounts are a known concept on the local wiki, and
show a different label if so.
Bug: T380266
Change-Id: I63ada264c0da406c728ac54fcbe0b6621f1e9250
|
|\ \ \ \ |
|
| |/ / /
| | | |
| | | |
| | | |
| | | | |
Bug: T368113
Change-Id: I8d98d187ba4f1342167820b5710f5382b2ac4831
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Example output:
https://phabricator.wikimedia.org/F58134893
Bug: T340552
Change-Id: Ib9ee43f1b10655a674f32339d5ec139e4551fa0a
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously when system message text of rick description is empty his lead to insert spaces between grant name and their separators.
Change-Id: Ic03324738a6be56b33058df3bb27113008487ef5
|