提交图

2750 次代码提交

作者 SHA1 备注 提交日期
jenkins-bot
2ef7a7adfb Merge "Add ->caller() to various queries" 2024-05-31 16:06:56 +00:00
Bartosz Dziewoński
fbeeff9f2c Add ->caller() to various queries
Change-Id: I304148e01449a7e159b9e3f7e5a4d07eb239e17c
2024-05-31 16:50:35 +02:00
Sergio Gimeno
572651f74f Config: add maintenance script to migrate to CC2.0
The script contains an allow list of provider ids
to migrate.

When using the --dry-run option the script will
collect the provider/schema informed configuration
options and use the provider validator to check
for the config validity.

On standard run  validity of the collected
configs is also checked and if passed, the new
configuration is stored in the wiki page informed
by the provider.

Note: config options showing as untouched are
most probably legacy options that have not
been removed from the wiki config. Consider
removing them.
Note: config options showing as missing are most
probably options that belong to a feature is not
enabled in the wiki. These need to be reviewed
when running the script.

GEHomepageManualAssignmentMentorsList
GEHomepageMentorsList

Bug: T359038
Depends-On: I1ec7d9f9b67c47955e94ad7f9bec5576bc6f9c8e
Change-Id: Ida92d0e94ae49cc768736fc29e129ca6bc6adf08
2024-05-31 12:29:25 +02:00
Sergio Gimeno
40f6f4ebdc Config: load infobox templates from newcomer tasks loader
Bug: T365606
Change-Id: Ibbb3f81ba31df4641c064c800801598b1f3db637
2024-05-30 17:36:39 +02:00
jenkins-bot
b30fcc082e Merge "Config: add missing leveling up options in newcomer schema" 2024-05-30 10:03:53 +00:00
Sergio Gimeno
d941b100dd Config: add missing leveling up options in newcomer schema
Bug: T365612
Change-Id: Ibd24d8c334a82dbf7912294f429803e53bfb963f
2024-05-29 18:37:46 +02:00
Michael Große
d6f1d32594 Fix PHPNotice about index registration not being set
This now logs an error with the user id, so that we can follow-up on the
underlying issue. If that reveals that a user with no registration data
is valid, then this logging can be later removed as well.

Based on https://www.mediawiki.org/wiki/Manual:User_table#user_registration
the `registration` field should always have been set except for very old users.
Maybe we just need to run the maintenance script mentioned there for
another wiki.

Bug: T355344
Change-Id: I95494b0cd96e24fa1bab66bf843e5f927b5f9c16
2024-05-29 09:49:58 +02:00
Michael Große
3b02896467 Fix PHP Notice: Undefined Index <username>
If a username only consists of digits, then setting it as the key of an
array will set it as a _numeric_ key. MySQL/MariaDB in turn does some
strange type conversion when it receives a numeric value in a where
clause for a field that contains strings. That lead to the query for the
username `555` also returning the usernames `555_É_GAY`, `555éGAYSAÇO`,
and `555éViado`.

Bug: T355344
Change-Id: I9493d67c5cb5d6088723c64950f57ff6512ba528
2024-05-29 09:49:58 +02:00
jenkins-bot
b61b5712dd Merge "Util: avoid weeks as duration format" 2024-05-27 15:15:53 +00:00
Sergio Gimeno
4a30af9918 Util: avoid weeks as duration format
Language:formatDuration no longer supports
weeks as a format, T219397.

Bug: T365530
Change-Id: I2b77faf8e192a6c92c798e3c18bce780b5c57462
2024-05-27 16:29:08 +02:00
Michael Große
5524148901 Fix package module error message generation
The user session is not available in package modules, and trying to use
that fails with `Sessions are disabled for load entry point`. To fix
that we have to use the \MediaWiki\ResourceLoader\Context::msg method.

See https://www.mediawiki.org/wiki/ResourceLoader/Package_files#Common_pitfall:_using_i18n_messages_in_generated_content_callbacks

Adjust the test because this is now actually treated as a message.

Bug: T365653
Change-Id: Ic1fb83979cc2280a5191fa2842b0e0d9c6659485
2024-05-23 13:03:44 +02:00
Sergio Gimeno
18e4371e73 Config: add missing help panel option GEHelpPanelViewMoreTitle
Bug: T360472
Change-Id: Icb50bb5d689891a33cf5c50d11080971d5774eae
2024-05-22 11:58:28 +02:00
Martin Urbanec
39de0c9583 Switch to CommunityConfiguration for SuggestedEdits config
Bug: T364717
Change-Id: Ied0c13cf072365d1aae13176f746d1b998f500c5
2024-05-15 15:48:30 +02:00
jenkins-bot
a7e9983bd3 Merge "HomepageHooks: Inherit documentation for contributions hook" 2024-05-13 16:35:11 +00:00
jenkins-bot
63865d1213 Merge "Config: support config transforms for some options" 2024-05-13 16:18:29 +00:00
Thalia
b9a0b88685 HomepageHooks: Inherit documentation for contributions hook
Reduce the maintenance burden of needing to update the documentation
when the interface changes.

This is needed for T363358, which refactors some classes that build
Special:Contributions.

Bug: T364569
Change-Id: Ia14784908790dc2cfd1b65b738730f759c780642
2024-05-13 13:54:54 +01:00
Sergio Gimeno
2748bf052e Config: support config transforms for some options
In I05e1c6dc322939619855a690a55d07adcb6b55ae two
enum config options GEHelpPanelAskMentor and
GEHelpPanelHelpDeskPostOnTop. However GE code
still expects these options to be booleans.

Introduce a wrapper config reader that relies
on CommunityConfiguration WikiPage reader but maps
new values to old values. This is in order to keep
the config code intact for eventual roll backs of
the CommunityConfiguration extension/migration.

Bug: T364053
Change-Id: I279040fef9ebcb42d333096d6675b3051e4101ed
2024-05-13 12:53:59 +02:00
Sergio Gimeno
a9d5a82401 Config: fix property name in HelpPanel schema
A spelling mistake was made for the property
GEHelpPanelHelpDeskPostOnTop. This is relevant
for migrating existing wiki configs to the new
config files structure without having to special
case this option.

Also rename the property associated messages.

Change-Id: Ibc61716ea5d7cecbe9dfdfa8ea41a75d84088512
2024-05-11 11:00:44 +00:00
jenkins-bot
f714dc3e9e Merge "Use new body validation in the handlers" 2024-05-07 10:38:20 +00:00
Sergio Gimeno
ec26bb0b27 Config: use type integer instead of number
Use TYPE_INTEGER for pressumably int values and
keep TYPE_NUMBER for float values.

Bug: T363733
Depends-On: Ida3964c0293c67766607dcf437b8d26892418459
Change-Id: Ie5c9523758b660674af4a751275d6820f73f6876
2024-05-03 19:04:35 +00:00
jenkins-bot
fbe8ee96e7 Merge "Use user_properties.up_value with string in database query" 2024-05-03 05:10:09 +00:00
Umherirrender
cf6bb3b393 Use user_properties.up_value with string in database query
The field up_value is a varbinary and should be provided as string,
not all rdbms implicit converts int/strings

Change-Id: I3d016969559401ecc54bb27c192b66183d47345b
2024-05-02 23:26:01 +02:00
Umherirrender
7bd60806e0 Migrate TaggedEditsForUsers to IReadableDatabase::newSelectQueryBuilder
Bug: T312330
Change-Id: Ib42f74c6372c56dd0bc9382d911e44b51890d44b
2024-05-02 21:58:09 +02:00
Atieno
eac25ef9f1 Use new body validation in the handlers
Bug: T361995
Change-Id: Ie48ac3a2b99320ca40c0d2597eb59ff79faabb2d
2024-04-30 18:02:29 +03:00
Michael Große
1d2c691fd0 Add support for ask-mentor and post-on-top community config enums
Bug: T362685
Depends-On: Ia58213956daea1972415d6b41a235ef478a18fe4
Change-Id: I05e1c6dc322939619855a690a55d07adcb6b55ae
2024-04-30 13:08:14 +02:00
jenkins-bot
c73c0420bf Merge "Add SuggestedEditsSchema" 2024-04-29 16:17:08 +00:00
Umherirrender
d91fa9a1ba Migrate to IReadableDatabase::newSelectQueryBuilder
Also use expression builder to avoid raw sql

Bug: T312330
Bug: T350954
Change-Id: Iaa1b114954da723bef14d1a59953aeffb85f4a8c
2024-04-28 10:23:32 +02:00
Martin Urbanec
456a16f5a7 Add SuggestedEditsSchema
Immediately after merging the patch,
Special:CommunityConfiguration/GrowthSuggestedEdits will work,
but it will look very broken. This is because of T363477 and
T362098, which will make the form look (mostly) normally.

The form should now look like https://ctrlv.cz/1zNn, and
the config for the three structured tasks should work
as expected.

Bug: T360471
Depends-On: I6b6470ac05316f475660294740fecb4e35296229
Change-Id: I0a25dd94c5f88b2a887dc7879623dd9e3219e2c8
2024-04-26 18:33:06 +02:00
Martin Urbanec
f1aa3924b2 Help panel: Do not break when CommunityConfiguration is used
`GEHelpPanelLinks` is represented as associative arrays in
CC1.0, but in CC2.0, it is returned as a stdClass. Fix
that by adding a casing.

Also remedy PHP Warnings by renaming `label` to `text`,
which is expected in HelpPanel class. Otherwise,
the following notice would be displayed:

Warning: Undefined array key "text" in
/var/www/html/w/extensions/GrowthExperiments/includes/HelpPanel.php
on line 68.

Bug: T363459
Change-Id: I1507dcb6739cb22c5cf049d19b7e3bad8db2c0da
2024-04-25 11:03:38 +00:00
jenkins-bot
c3b103dde6 Merge "Config: add partial HelpPanel schema" 2024-04-24 21:29:36 +00:00
Sergio Gimeno
bde8ea59a1 Config: add partial HelpPanel schema
Add currently supported configuration options from
Help Panel settings. This is to facilitate the testing
of the namespaces control, T357708.

Unsupported options which are left out:
 - "GEhelpPanelAskMentor" and "GEHelpPanelHelpDeskPostOnTop" which
require enumerations support, T362685.

Bug: T360472
Depends-On: I2d1e0796dbd1a521d8e930eeafbde61794f92150
Depends-On: I600347aec0baa403e2c96e02dc2d897954df2005
Change-Id: I6d2b4c8639f765909c21b1cae5a60b5f5898a647
2024-04-24 19:40:46 +02:00
Wargo
b328413db1 Show link to mentor, not mentee in Notifications.
Previously, link was titled about mentor but pointed to mentee's userpage.

Bug: T363008
Change-Id: Ie4f4859edea76c2ddfc73afdd4030061c9192819
2024-04-23 22:27:03 +00:00
jenkins-bot
6815f79951 Merge "MenteesPrefixSearchHandler: Set prefix as required" 2024-04-23 16:01:33 +00:00
jenkins-bot
2bf26924f2 Merge "Config: add partial suggested edits schema" 2024-04-21 12:14:58 +00:00
Sergio Gimeno
93685b0925 Config: add partial suggested edits schema
- Add only "GEInfoboxTemplates" configuration option
which uses "PageTitles" Mediawiki definition from
community configuration.

Bug: T360471
Depends-On: I384eb017f41e665a43583aac2620157d94e61ffd
Change-Id: I752ea041632338a388770585fcf4f111e139782a
2024-04-20 14:48:13 +02:00
Martin Urbanec
c31463a8ef MenteesPrefixSearchHandler: Set prefix as required
The handler needs the prefix to work, but it is incorrectly
labelled as optional. Fix that.

See I47aa1f3000833f7c6f572bbd262153b5b79aef38 as well.

Bug: T359652
Change-Id: Id216e1c0c6797e2b76a1bc9510877d416b5b9e06
2024-04-18 09:32:05 +02:00
jenkins-bot
ee24ed14a2 Merge "Only treat first colon as a delimeter in onFormatAutocomments" 2024-04-16 11:58:41 +00:00
jenkins-bot
a7055c64ea Merge "Migrate to IDatabase::newInsertQueryBuilder/newUpdateQueryBuilder" 2024-04-14 17:13:16 +00:00
Umherirrender
ab102b03f9 Migrate to IDatabase::newInsertQueryBuilder/newUpdateQueryBuilder
Change-Id: I3df99f34548d2ca1ba822e0a004d6296b1adc2d0
2024-04-13 20:40:14 +02:00
Umherirrender
6cf6889c7a Migrate to IDatabase::newDeleteQueryBuilder
Change-Id: Id39f29e0e7a5f7f56c9857d40eeced4f6a5bc7d5
2024-04-12 22:30:39 +02:00
Martin Urbanec
3ae9d8c150 Only treat first colon as a delimeter in onFormatAutocomments
The autocomments have the following format:
message-key:param1|param2|param...|paramN

Prior to this patch, we used explode( ':', $comment )
to parse the comment into the message key and param array.
However, this does not work if there is a colon in one
of the params.

Resolve this issue by using explode( ':', $comment, 2 ),
which only uses the first colon as a delimeter, and ignores
any other colons.

NOTE: The same problem will happen when using a pipe character.
This is less critical, as pipe is less commonly used (and it has
special meaning in wikitext already, so easier to explain). This
is left for a future discussion and/or fix.

Bug: T360846
Change-Id: I5d0974f4e2154ae41cce6629c8e1d19e166a2913
2024-04-09 13:28:41 +02:00
Martin Urbanec
c4af191e79 Community configuration: Add HomepageSchema
Bug: T360473
Depends-On: Idb707870f2a09439e0ee479761ddd0eb4c3d2c3f
Change-Id: I9ac86c85b573c6a51d00d9e11c62db68052c625b
2024-04-05 15:20:16 +02:00
jenkins-bot
3e3e8ba99d Merge "Migrate to IDatabase::newReplaceQueryBuilder" 2024-04-03 20:14:18 +00:00
Umherirrender
b8ef97d9de Migrate to IDatabase::newInsertQueryBuilder for upsert
Change-Id: I2eaad60844ecd2401569c1ba3f8c8e97a45ad22c
2024-04-02 16:38:16 +02:00
Umherirrender
3a2c679fd5 Migrate to IDatabase::newReplaceQueryBuilder
Change-Id: Ia986ac87ddba19f236a791da5717acadd9b57449
2024-04-02 14:14:08 +02:00
jenkins-bot
9f1e269d66 Merge "Add GEUseCommunityConfigurationExtension feature flag" 2024-03-25 12:14:31 +00:00
Umherirrender
c21d3ece00 Add explicit parentheses around mixed boolean operator
Mixing different binary boolean operators within an expression
without using parentheses to clarify precedence is not allowed (T358966)

Change-Id: I450a224552ac7ddb0c638afe8c16e4f1d9583c92
2024-03-23 01:05:58 +01:00
Martin Urbanec
67042a7099 Add GEUseCommunityConfigurationExtension feature flag
Why:
The Growth team works on the CommunityConfiguration extension,
which re-implements the ability for administrators to edit
MediaWiki configuration on-wiki in a different way.

This patch allows developers to switch from the GE-specific
implementation of community configuration (so-called CC1.0)
into the new dedicated implementation that CommunityConfiguration
represents.

The patch is meant to make GrowthExperiments stop use any of its
CC1.0 implementation if GEUseCommunityConfigurationExtension is true,
including the editing form.

Notes:
CommunityConfiguration expects client extensions to use a single
Config object (=the one provided by CommunityConfiguration)
for all config needs. This enables client extensions to seamlessly
switch between configurable and non-configurable fields (it is a matter
of changing the scmea), without having to review their usage across their
whole repository. To fully benefit from this expectation, we need to change
how we approach config within GrowthExperiments.

What:
* Introduce `GEUseCommunityConfigurationExtension` config flag, which
  is false by default.
* Create `GrowthExperimentsCommunityConfig`, which either returns
  the `GrowthExperimentsMultiConfig` service or the CommunityConfiguration
  provided service, depending on the feature flag.
* Switch SpecialEditGrowthConfig's registration to a conditional one,
  based on the feature flag value.
* Move two schemas from CommunityConfigurationExample to GrowthExperiments

Bug: T359124
Depends-On: If9db50b8ba8dc835a7d5e1c49de83e7ff2941c01
Change-Id: I2b6e3436c08100442baf4ed65582d0bc17fd449c
2024-03-22 21:58:14 +00:00
Umherirrender
df4ae94093 build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Disable BraceNotOnOwnLine due to T347440

Change-Id: Ia591cf9cc027e7186f9e275e5048af51ac9d4923
2024-03-10 23:27:21 +01:00
jenkins-bot
d57a98c148 Merge "Stop using DBAccessObjectUtils::getDBOptions()" 2024-03-05 15:04:16 +00:00