Page MenuHomePhabricator

Hidden lint rules are unexpectedly applying to signatures and throwing errors
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Visit https://www.mediawiki.org/wiki/Special:Preferences

  • Add <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)"><a href="/wiki/User:Sdkb" title="Testing"><span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Testing</span></a></span> to new signature.

What happens?:

  • It triggers a lint error

What should have happened instead?:

  • No lint error - signatures shouldn't need to confirm to lint errors IMO. Is this intentional behaviour? and should at least be able to save preferences when there is a lint error.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • Workaround **

Signatures need to define color as well as background color.

<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;color:inherit;background:linear-gradient(6rad,#86c,#2b9)"><a href="/wiki/User:Sdkb" title="Testing"><span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Testing</span></a></span>` to new signature.

Event Timeline

Jdlrobson renamed this task from Lint rules are applying to signatures to Lint rules are unexpectedly applying to signatures and throwing errors.Mar 22 2024, 4:56 PM

This is intentional - DiscussionTools uses linting against signatures to ensure DT tools don't break -- it disables DT on some talk pages if certain kinds of lints show up.

Signatures should definitely need to confirm Linter errors. That is by design, and it took us years to get it rolled out. See T355462 and its predecessors.

Signatures should probably not be subject to hidden Linter rules like the wide table rule or this new background color rule. If the background color gets debugged and promoted to a real Linter rule because night mode is close to deployment, applying it to signatures may be appropriate.

@ssastry but I don't think it is intentional that hidden lints apply here? When we envisioned T334527 we didn't expect it to impact any community workflows.

Observation: It seems like we have pivoted from having lints that are essential to fix, to lints of a lower priority that are non-essential to fix. For example I don't think it is expected that this lint or https://www.mediawiki.org/wiki/Wikimedia_Apps/Team/Android/Image_Recommendations would apply to signatures.

The issue seems to be with T140606: Check user signature for linter errors which needs to exclude hidden categories.

In theory we should probably have a separate tagging system for lint rules which would give finer control over which lint rules apply to signatures, which to discussion tools replys, etc. But for the moment excluding hidden categories ought to be enough.

Jdlrobson renamed this task from Lint rules are unexpectedly applying to signatures and throwing errors to Hidden lint rules are unexpectedly applying to signatures and throwing errors.Mar 22 2024, 5:13 PM

Actually this bug can be fixed with a simple configuration change:
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/569062/18/includes/preferences/SignatureValidator.php#80

There already exists a SignatureAllowedLintErrors configuration variable, which the new dark mode lint can be added to. That would be a short term fix while we work on the patch to automatically skip hidden categories (which is the "more correct" fix).

Change #1013583 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[operations/mediawiki-config@master] Exclude night-mode lint from signature validation

https://gerrit.wikimedia.org/r/1013583

Change #1013583 merged by jenkins-bot:

[operations/mediawiki-config@master] Exclude night-mode lint from signature validation

https://gerrit.wikimedia.org/r/1013583

Mentioned in SAL (#wikimedia-operations) [2024-03-22T17:48:01Z] <dancy@deploy1002> Started scap: Backport for [[gerrit:1013583|Exclude night-mode lint from signature validation (T360796)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-22T17:50:20Z] <dancy@deploy1002> dancy and cscott: Backport for [[gerrit:1013583|Exclude night-mode lint from signature validation (T360796)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-22T18:13:56Z] <dancy@deploy1002> Finished scap: Backport for [[gerrit:1013583|Exclude night-mode lint from signature validation (T360796)]] (duration: 25m 55s)

Change #1013589 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] SignatureValidator: Don't fail signature validation on hidden lints

https://gerrit.wikimedia.org/r/1013589

Okay configuration change has been backported so the immediate problem has now been addressed.

Change #1013591 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] [i18n] Add missing localizations for night-mode lint

https://gerrit.wikimedia.org/r/1013591

Change #1013589 merged by jenkins-bot:

[mediawiki/core@master] SignatureValidator: Don't fail signature validation on hidden lints

https://gerrit.wikimedia.org/r/1013589

Change #1013591 merged by jenkins-bot:

[mediawiki/core@master] [i18n] Add missing localizations for linterror-*

https://gerrit.wikimedia.org/r/1013591