* Tag and Template search is enabled using config variable
'LinterUserInterfaceTagAndTemplateStage' and also checks for
the linter table column 'linter_tag' to exist to protect the
report code from error if the column is absent. As the linter
table alter maintenance added both the linter_tag and
linter_template at the same time, there is no reason to check
both. The user interface code does not check for the field
presence only the config variable.
* This code depends on the recordLintJob code writing the tag
and template data which is enabled by the config variable
'LinterWriteTagAndTemplateColumnsStage' and also assumes the
data migration maintenance script migrateTagTemplate.php has
been run to populate linter error records created prior to
the table alter and the write code being enabled.
Bug: T175177
Change-Id: I2f951dfcd34e3dc6ca17e8754cfaeba8baa3e835
* This performance improvement patch uses the namespace from the
new field 'linter_namespace' in the linter table instead of
the 'page_namespace' in the page table. It checks for and
requires the presence of the linter_namespace field in the
linter table, as well as the config variable
'LinterUseNamaspaceColumnStage' being set true.
* If the linter_namespace field is present and aforementioned
config variable is true, the code assumes that the config
variable 'LinterWriteNamespaceColumnStage' is set true and
recording the linter_namespace for new lint errors is
active and the migrateNamespace.php migrate code has been
run to migrate the page_namespace data into existing linter
records that were created before the linter_namespace column
existed and were left NULL during the table alter maintenance
operation.
* A follow on patch should remove the configuration variables and
conditional code producing the final, refactored code dependent
on the new namespace column index.
Bug: T299612
Change-Id: I4a1497d9e4dcd6a9a7befdaccf3e34c61694365d
The action=record-lint was a hack that allowed Parsoid/JS to send data
to MediaWiki to be stored in the linter database. Thankfully we no
longer need it in the glorious Parsoid/PHP world because it can write
directly to the database.
The API module, i18n messages and $wgLinterSubmitterWhitelist are all
removed.
Bug: T329992
Change-Id: Iba70e05a2e28f4ecd02101cff51993ebe65f19d0
* Having separate config variables to enable the maintenance
migrateNamespace and migrateTagTemplate scripts is duplicitous
and should be shared with the write enable config variables.
Bug: T329342
Change-Id: I4cb453fc0678b065cb42a2ca59863da1ab9cdbe4
* The linter migrate code for linter_tag field and linter_template
field are constrained by the database schema to 32 characters
for the tag field and 255 characters for the template field.
In some anomalous circumstances parsoid can report tag and or
template fields in the linter_params object that exceed those
character limits. This code truncates these excessively long
strings to protect the database migrate update code from a
length exceeded error.
Bug: T329113
Change-Id: I8af7c44759f172eae77d3519a6eac47110e9b1e7
* The linter write code for linter_tag field and linter_template
field are constrained by the database schema to 32 characters
for the tag field and 255 characters for the template field.
In some anomalous circumstances parsoid can report tag and or
template fields in the linter_params object that exceed those
character limits. This code truncates these anomalous strings
to protect the database update code from a length exceeded
error.
Bug: T328979
Change-Id: I057ae2e32a9e1a7735b5300409e5693e8db5c764
action=info has a summary table of number of lint errors by category,
but we have richer information available via Special:LintErrors. If
there is a "Lint errors" section, provide a link below the table to
Special:LintErrors for the errors on this page.
Update ApiRecordLint for the new Hooks constructor and leave a FIXME
to eliminate the coupling.
Bug: T301374
Change-Id: Ic1fcf42b50d1392ac53201ceb256691133cf62ff
This hook is not allowed to have a service, so before we can add
services to the main Hooks class, it needs to be split out.
Change-Id: Ia7b4b8bf7c91ebb851c5de9f0f54f56b0993bf83
* update all schema files to correct linter_params being set nullable by accident in
2020 during abstract definition update
* include hook to provide 3rd party support, use $updater->modifyExtensionField(
Bug: T327806
Change-Id: I7fea08280cf2fa7956e5b300dc3365dc3561ca52
* It should be safe to automatically run during wiki update on
3rd party wikis, and requires manual invocation on enwiki.
* The tag and template migrate for enwiki will be run by an admin
during a backport window so the process can be monitored and
may run for a day potentially.
Bug: T175177
Change-Id: I6ce30767300cc907639d72b34f7756f3d9563ca7
* The migrate code is designed to perform a one-time update of
linter_params JSON encoded template and tag information into
the new discrete template and tag text fields for use as
additional search criteria. The function can be restarted if
it is interrupted.
* It now uses configurable batching and sleep times between
batches to allow the database to do other work and replication
to occur without stressing infrastructure.
* The migrate code is only called by test code and needs to be
called one-time from a maintenance script.
Bug: T175177
Change-Id: Idc4ca88d4762bc7a3bcbc4e66c0f275562083867
* It should be safe to automatically run during wiki update on
3rd party wikis, and requires manual invocation on enwiki
* The namespace migrate for enwiki will be run by an admin during
a backport window so the process can be monitored and may run
for a day potentially.
Bug: T299612
Change-Id: I19091a6f177e8b67d80c0b8f46782929d2e951d4
* Migrates namespace info from the page tables page_namespace field
to the new linter table field linter_namespace. This duplication
of the namespace value was requested to greatly reduce the amount
of database activity required by the linter search and reporting
code.
* This patch has been prepared as a dark launch patch enabled with
config value LinterMigrateNamespaceStage and assumes that the
Linter table has had the linter_namespace column added to it,
and recording of the namespace field is already enabled and is
populating the namespace column.
* The migrate code now runnable from Linter/maintenance directory,
using migrateNamespace.php, which will be deployed in a separate
patch. The maintenance code creates an appropriate environment
to call migrateNamespace( in Database.php.
Bug: T299612
Change-Id: I73cb80729d6a5a8716fe93164ad1e42e6958d672