Commit graph

11584 commits

Author SHA1 Message Date
Petr Pchelko
a1aa3e0827 Hard-deprecate all public property access on CacheTime and ParserOutput.
- Added a test where ParserOutput objects with CacheTime
properties set are unserialized from previous versions.
- Generate new serialization tests for 1.38

Now all serialization in production is JSON, so changing
property visibility shouldn't affect ParserCache.

Bug: T263851
Depends-On: I283340ff559420ceee8f286ba3ef202c01206a23
Change-Id: I70d6feb1c995a0a0f763b21261141ae8ee6dc570
2021-10-13 13:27:16 -04:00
Petr Pchelko
4d54b4caa0 Run ParserOutput serialization tests against latest example available
In ParserOutput serialization tests we have a large number of examples
saved for different versions of MW. When MW version is released,
but the serialization doesn't change, we stop running some serialization
tests cause we can no longer find the latest example.

Change-Id: I01e8e0e17e2371b2cd08d200d3a4611d814e74bb
2021-10-13 13:26:47 -04:00
jenkins-bot
ad9255fe30 Merge "Remove deprecated ApiBase::PARAM_VALUE_LINKS" 2021-10-13 01:54:56 +00:00
Alexander Vorwerk
0a86c3655d phpunit: Fix parameter order on two assertSame() calls
The first parameter of assertSame() is the expected value, the second
one the actual value.

Change-Id: I5a411403443f18b30c93ab9552f625a70c75f75c
2021-10-12 20:22:34 +00:00
jenkins-bot
ce1c6b7002 Merge "Migrate WikiPage::doEditUpdates() to using PageUpdaterFactory" 2021-10-11 11:36:50 +00:00
Reedy
fb235068b8 Remove deprecated ApiBase::PARAM_VALUE_LINKS
Change-Id: I1c544ef58ebb2c83ebdcf7284a8dad2ed364c608
2021-10-09 01:44:42 +01:00
jenkins-bot
cd9c0ba6c0 Merge "Rename ParserOutput::{get,set,unset}Property to {get,set,unset}PageProperty" 2021-10-08 14:47:30 +00:00
C. Scott Ananian
af5d13c5de Rename ParserOutput::{get,set,unset}Property to {get,set,unset}PageProperty
The ::getProperty() naming is too generic and doesn't clearly indicate
that these are "page properties" (which have their own table in the DB).
As part of refactoring a clean API out of ParserOutput which can be used
by Parsoid, clean up the naming here.

Soft-deprecation in this patch, there are a handful of external users
which need to be cleaned up before we hard-deprecate.

Bug: T287216
Change-Id: Ie963eea5aa0f0e984ced7c4dfa0fd65d57313cfa
2021-10-08 10:07:17 -04:00
jenkins-bot
c65c7e4039 Merge "phpunit: Drop bypass for now-fixed dberror from SpecialPageFatalTest" 2021-10-07 20:29:42 +00:00
Derick Alangi
6407361b46 Migrate WikiPage::doEditUpdates() to using PageUpdaterFactory
WikiPage::doEditUpdates() has been deprecated. Using the PageUpdaterFactory's
newDerivedPageDataUpdater() is the new way forward. Also, I made sure to have
the `$options` array with the `causeAction` and `causeAgent` key/value pairs.

Change-Id: I9f2c212d7c83a46799f9f947dc372dc364289680
2021-10-07 11:17:43 +01:00
DannyS712
736e00ee8c resourceloader: omit noscript module from client registry
In all cases where the client registry is used, the `noscript` module
is inapplicable. Additionally, make it illegal to have a module
include the 'noscript' module as a dependency.

Bug: T291735
Change-Id: I5846f2c19b003989b56b12628b385fd37049483b
2021-10-07 01:21:02 +00:00
Ed Sanders
ca846e35cc ParamValidator: Define extra parameters for ExpiryDefTest
This will be tested via ParamValidatorTest->testCheckSettings().

Change-Id: I4e1d24eb0abd88b370165a63a1c1e694edd25996
2021-10-05 16:30:49 -07:00
jenkins-bot
e5b8997536 Merge "Remove "auto-number headings" preference" 2021-10-05 19:18:40 +00:00
jenkins-bot
dcd793203b Merge "Use PageUpdater's fluent interface" 2021-10-05 12:30:37 +00:00
Derick Alangi
d62ba36bba Use PageUpdater's fluent interface
Change-Id: I541b7ae565c46d00ab5e1de08a2447461a9e73a7
2021-10-05 07:18:17 +01:00
jenkins-bot
228e56807e Merge "Remove hard deprecated Watchlist methods in User, Title, and WatchAction" 2021-10-05 03:20:12 +00:00
jenkins-bot
cfb8e80fa3 Merge "WatchedItemStore: forwards compatibility for stash value change" 2021-10-05 02:02:25 +00:00
Tim Starling
a0725871c7 WatchedItemStore: forwards compatibility for stash value change
Stash values will change from a MapCacheLRU to an array, to avoid a
warning. Implement the read side of the change so that the write side
can be safely reverted.

Bug: T282105
Change-Id: I8d60ae709004a8aba9ad916e1a5fd05406a05984
2021-10-05 11:35:00 +11:00
jenkins-bot
3394c53fdb Merge "SkinFactory: Allow skins to be registered as "skippable"" 2021-10-04 22:57:37 +00:00
jdlrobson
576006858d SkinFactory: Allow skins to be registered as "skippable"
The existing method of hardcoding ApiOutput and Fallback is not
great, and there is a use case inside Vector as we split
Vector skin into two as well as inside ContentTranslation.

This adds to the existing wgSkipSkins configuration by allowing
skins to register themselves as skippable without a LocalSettings
change.

Bug: T291193
Change-Id: I9caa8deb5b58fa1ef1eb548db497ef095cbbd154
2021-10-04 23:32:59 +01:00
Daimona Eaytoy
249306e112 Add perm checks to UndeletePage and make it a real service
Add entry in MediaWikiServices, add wiring code, inject all dependencies.

Also add an alternative entry point with permission checks, like for
DeletePage.

The new service is no longer @unstable, and the relevant methods in
PageArchive were deprecated.

Bug: T290021
Change-Id: I452a98679f5bfea3f7367aacd5c930acffd32102
2021-10-04 20:25:49 +00:00
Cindy Cicalese
b0c0a934e4 Remove hard deprecated Watchlist methods in User, Title, and WatchAction
Bug: T292464
Change-Id: Ie9cb3036a69810344971c49c424a76c7fa1cba07
2021-10-04 15:14:24 -04:00
jenkins-bot
38c219ab86 Merge "Remove more defaults for flag UserOptionsManager::EXCLUDE_DEFAULTS" 2021-10-04 14:56:19 +00:00
jenkins-bot
69331e1eb3 Merge "Rename ParserOutput::{allow,prevent}Clickjacking() -> ::{get,set}PreventClickjacking()" 2021-10-04 14:56:08 +00:00
jenkins-bot
bf8839c6b1 Merge "phpunit: Include DevelopmentSettings for composer phpunit:unit" 2021-10-04 07:39:07 +00:00
Amir Sarabadani
649bbdd6c5 Remove "auto-number headings" preference
Bug: T284921
Change-Id: Ic9ed88f419419cf4cc5cc32010539eea8b76314b
2021-10-03 00:47:08 +02:00
Antoine Musso
239cf16fa2 phpunit: Include DevelopmentSettings for composer phpunit:unit
When invoking `composer phpunit:unit` without any configuration, we lack
custom logging or developer enhancements such as $wgDevelopmentWarnings.

Inject `includes/DevelopmentSettings.php` in the PHPUnit bootstrap.

The $wgMWLoggerDefaultSpi is set to LegacyLogger which requires four
global variables:
- `$wgDebugLogFile`
- `$wgDebugLogGroups`
- `$wgDBerrorLog`
- `$wgDBerrorLogTZ`

Allow `$wgDebugLogFile` and `$wgDebugLogGroups` globals to be passed to
unit tests. `$wgDBerrorLog` and `$wgDBerrorLogTZ` are not, since I don't
think that applies to unit tests.

This change does not affect integration tests run via phpunit.php, where
developers may include DevelopmentSettings.php from LocalSettings.php in
a custom order before/after their own changes, or not at all.

Bug: T291227
Change-Id: I792ca0be3456f83b86fb4ebddae4117bf387be3a
2021-10-02 22:34:33 +00:00
Umherirrender
6bda73219a Remove more defaults for flag UserOptionsManager::EXCLUDE_DEFAULTS
Use the isValueEqual function from
I572446faa8d40801a9adc3aee4b26d97c18000a1 to remove more bool values,
if the default options and the user option differs in real type.

Bug: T291748
Change-Id: I6e61c11d8aed27b4b559e74849e0056e5eef3638
2021-10-02 11:45:57 +02:00
C. Scott Ananian
df3cc40fac Rename ParserOutput::{allow,prevent}Clickjacking() -> ::{get,set}PreventClickjacking()
This name is consist with the rest of the setter and getter methods
in ParserOutput.  Renamed the methods in OutputPage, ImageHistoryList,
ImageHistoryPseudoPager, and ContribsPager as well for consistency;
it also makes chasing down lingering references in codesearch easier.

Soft-deprecated the old name for 1.38.  Hard-deprecation will follow,
but there are a number of users in production that should be chased
down first.

Code search:

https://codesearch.https://codesearch.wmcloud.org/deployed/?q=(allow%7Cprevent)Clickjacking&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Change-Id: I9822c60c180d204bd30cb4447a1120155d456da4
2021-10-01 14:13:47 -04:00
Daimona Eaytoy
42a24c3e98 Use fluent setters instead of optional params in UndeletePage
Also make $comment a required parameter, for symmetry with DeletePage.

Bug: T290021
Change-Id: I0bb2c6b782bf4d61396657d367e182295f913f0e
2021-10-01 17:32:10 +00:00
jenkins-bot
25ae909086 Merge "Rename ParserOutput::hideNewSection() -> ::setHideNewSection()" 2021-10-01 14:36:57 +00:00
jenkins-bot
ce228d86f4 Merge "Add 1.36 and 1.37 snapshots to sqlite db tests" 2021-09-30 20:52:08 +00:00
jenkins-bot
8f6d25a974 Merge "Metrics: Implement statsd-exporter compatible Metrics interface" 2021-09-30 19:00:58 +00:00
C. Scott Ananian
db81b56adf Rename ParserOutput::hideNewSection() -> ::setHideNewSection()
This name is consist with the rest of the setter and getter methods
in ParserOutput (note that ParserOutput::getHideNewSection() already
exists and is consistently named).

Hard deprecated the old name for 1.38.  Rarely used outside core, and
a pull request already created for the one outside user:
https://github.com/SkizNet/mediawiki-WikiMirror/pull/15

Code search:
https://codesearch.wmcloud.org/search/?q=hideNewSection&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Change-Id: Ia553373eef78f875a83ad0eebfe2e465ce33272f
2021-09-29 17:47:54 -04:00
Cole White
69d63cdbfe Metrics: Implement statsd-exporter compatible Metrics interface
1. Standardizes metrics interface in a way that supports both statsd
     and a statsd-exporter compatible format (dogstatsd)
  2. Brings metrics formatting in-house
  3. Adds phpunit tests

Bug: T240685
Bug: T205870
Change-Id: I264097c10d83bef291d68bffefa7fb9eb8dc87bb
2021-09-29 15:27:23 -06:00
Amir Sarabadani
c3fff36540 Add 1.36 and 1.37 snapshots to sqlite db tests
To make sure upgrades from those versions work properly

Change-Id: I570cf965286bc5358a43c9601217b8781bb09b0e
2021-09-29 20:13:38 +02:00
jenkins-bot
3ab14c18ca Merge "Move Content::getParserOutput & AbstractContent::fillParserOutput to ContentHandler" 2021-09-29 13:10:00 +00:00
Roman Stolar
a68e641f9d Move Content::getParserOutput & AbstractContent::fillParserOutput to ContentHandler
Update/Create override classes of ContentHandler.
Soft-deprecate and remove method from Content and classes that override them.

Bug: T287158
Change-Id: Idfcfbfe1a196cd69a04ca357281d08bb3d097ce2
2021-09-29 13:10:51 +03:00
jenkins-bot
ff04006810 Merge "Bump minimum required version for upgrade to 1.29" 2021-09-29 07:43:48 +00:00
Tim Starling
f7f84dddb3 Introduce CommentFormatter
CommentParser:

* Move comment formatting backend from Linker to a CommentParser service.
  Allow link existence and file existence to be batched.
* Rename $local to $samePage since I think that is clearer.
* Rename $title to $selfLinkTarget since it was unclear what the title
  was used for.
* Rename the "autocomment" concept to "section link" in public
  interfaces, although the old term remains in CSS classes.
* Keep unsafe HTML pass-through in separate "unsafe" methods, for easier
  static analysis and code review.

CommentFormatter:

* Add CommentFormatter and RowCommentFormatter services as a usable
  frontend for comment batches, and to replace the Linker static methods.
* Provide fluent and parametric interfaces.

Linker:

* Remove Linker::makeCommentLink() without deprecation -- nothing calls
  it and it is obviously an internal helper.
* Soft-deprecate Linker methods formatComment(), formatLinksInComment(),
  commentBlock() and revComment().

Caller migration:

* CommentFormatter single: Linker, RollbackAction, ApiComparePages,
  ApiParse
* CommentFormatter parametric batch: ImageHistoryPseudoPager
* CommentFormatter fluent batch: ApiQueryFilearchive
* RowCommentFormatter sequential: History feed, BlocklistPager,
  ProtectedPagesPager, ApiQueryProtectedTitles
* RowCommentFormatter with index: ChangesFeed, ChangesList,
  ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges
* RevisionCommentBatch: HistoryPager, ContribsPager

Bug: T285917
Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0
2021-09-28 11:13:03 -07:00
Amir Sarabadani
753a4ecdd3 Bump minimum required version for upgrade to 1.29
Since the branch cut has happened, we can bump and get rid of legacy
cruft. According to the policy we can go up to 1.31 but let's keep it
that way to avoid major distruptions.

Change-Id: I9d697445a3bb5047726c8b2a7f808edb8403cdda
2021-09-28 17:57:57 +02:00
jenkins-bot
3801581dae Merge "resourceloader: Preserve new 'debug' param in getScriptURLsForDebug()" 2021-09-28 15:27:27 +00:00
vladshapik
12b42e8023 Hard deprecate User::blockedby(), User::getblockid()
Bug: T290869
Change-Id: If2d96705223bd80ffd68526773a2c81aaeaa898d
2021-09-28 12:50:29 +00:00
jenkins-bot
39c546d706 Merge "Change 'fromdbmaster' to WikiPage::READ_LATEST" 2021-09-27 22:44:26 +00:00
jenkins-bot
7833853b49 Merge "Remove the deprecated IP class" 2021-09-27 22:37:13 +00:00
Samuel Guebo
a8db81dc71 Add script to delete a user email's address
Can be used for a variety of operations
including preservation of users privacy.

Bug: T290099
Change-Id: Iad75810310c95e96b5f8998b201ed04ace5af656
2021-09-27 18:02:11 +00:00
jenkins-bot
eaf10f600b Merge "Expand local URLs to absolute URLs in ParserOutput" 2021-09-27 14:48:02 +00:00
jenkins-bot
07f3f8053b Merge "UndeletePage cleanup, part 1" 2021-09-27 14:24:53 +00:00
jenkins-bot
5c570f46da Merge "Move code from PageArchive to a new UndeletePage command" 2021-09-27 14:22:05 +00:00
jenkins-bot
6b6042b0b8 Merge "Hard deprecate User::setOption()" 2021-09-26 21:56:54 +00:00