Commit graph

11 commits

Author SHA1 Message Date
daniel
166b569444 Make use of the new PageUpdateStatus
PageUpdateStatus provides clean access the the newly created
RevisionRecord.

Depends-On: Ia08c586198082ea47e8313d0d41835f9830fb29e
Change-Id: Id6963842321c4eaa3d7d029ad0b769f73433c103
2022-11-30 17:56:58 +00:00
Thiemo Kreuz
67c56155c7 Replace trivial usages of code in strings with concatenation
This is really hard to read. What is code, what is string? These
places are so simple, they really don't need the "{$var}" syntax.

Change-Id: I589dedb8c0193eec4eef500bbb896b5b790b727b
2022-08-26 12:26:44 +00:00
Derick Alangi
f88eab53a6 tests: Use overrideConfig(Value|Values) where needed
This continues the work in the child patch to replace callers
of setMwGlobals() with the appropriate method. Directory this
patch covers is `tests/phpunit/integration/`.

Change-Id: I0a9abf0d2a43587f2ffa029b68024a1ba5165fc7
2022-07-12 14:40:46 +01:00
Umherirrender
8b1a3d13eb tests: Use WikiPageFactory to create WikiPage object
Bug: T259948
Change-Id: I9afcf3b845306f81ee5ca156553256e6c38df3a0
2022-06-26 23:21:02 +02:00
Umherirrender
cada8a827f RollbackPage: Include patrol status of revisions with same timestamp
In case two revision have the same timestamp, the higher rev_id is the
later revision and needs to be patrolled as well.

This also fix the tests, where the clock was faked to get higher
timestamps on the revisions

The WHERE changed from:
rc_cur_id = 2 AND (rc_timestamp > '20220603122124') AND rc_actor = 10
to
rc_cur_id = 2 AND ((rc_timestamp > '20220603122124') OR (rc_timestamp =
'20220603122124' AND (rc_this_oldid > 2))) AND rc_actor = 10

Bug: T309817
Bug: T304766
Bug: T260798
Follow-Up: I66bb6575dad4a970339e93b91fe486727111092a
Change-Id: I3cfcca4f0405f1d701c2883109c53b15854d6e64
2022-06-03 20:49:51 +00:00
Matěj Suchánek
5e5c879be2 RollbackPage: Make rollback not overwrite manual RC patrol status
When performing a rollback, we marks the reverted edits as
patrolled (on UseRCPatrol wikis) and also pretend they were by a bot
(discussion at T304766).

The way it is marked as patrolled is by setting the patrol status to
autopatrolled. But, if (one of) the edits was already patrolled before
the rollback, the manual patrol status should not be overwritten.

* Fix this.
* Also improve query performance by setting via rc_id instead of
  through more complex conditional clauses in the update query
  (should help with T260798).
* Test as much of this patrolling stuff as possible.

Bug: T304766
Bug: T260798
Change-Id: I66bb6575dad4a970339e93b91fe486727111092a
2022-06-01 09:36:55 +02:00
Umherirrender
2909d06a08 Use new namespace for revision related classes
All revision related classes are namespaced MediaWiki\Revision
instead of MediaWiki\Storage since 1.32. The old namespaced
class names are deprecated and only kept for backwards-compatibility.

Bug: T305784
Change-Id: I34e492d84d9fc4bc78481667202716d93b3c43cb
2022-04-14 23:03:43 +02:00
daniel
e239b02a5e Add convenience methods for asserting status.
This ensures that assertions work in a uniform way,
and provides meaningful messages in cause of failure.

Change-Id: Ic01715b9a55444d3df6b5d4097e78cb8ac082b3e
2022-03-16 22:44:25 +01:00
Reedy
6e29611642 Remove or replace usages of "sanity"
Still some more to go...

Bug: T254646
Change-Id: Ia117f01e443c35b4765f3275cab4f2707e1be96f
2021-11-21 16:42:31 +00:00
libraryupgrader
5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00
Petr Pchelko
46db19ecdf Factor out rollback logic from WikiPage
Change-Id: I95da91875fcf2f53143c315560e35ccd5ffbf4b3
2021-04-14 11:49:07 -07:00