Commit graph

3 commits

Author SHA1 Message Date
Siddharth VP c82db2de3e Add structure test to verify contents of pygments.generated.css
Verify that running Pygmentize::fetchGeneratedCss() (which gets invoked
from the updateCss.php maintenance script) gives CSS that matches the
generated file pygments.generated.css.

Change-Id: I454f287cb461b596178ee47c44634e2e127fe576
2024-09-28 21:59:47 +05:30
Fomafix 173e215bde Use overrideConfigValues instead of setMwGlobals
Also use MainConfigNames.

Change-Id: Ic51c376be4642eecbeb29d2ec2d2b2de388c2f61
2024-08-05 18:34:51 +00:00
Timo Tijhof 682fe922f9 Pygmentize: Treat Shellbox network loss like non-zero exit code
Prior to the shellbox migration, if during the parsing of a page,
pygmentize failed (i.e. non-zero exit from its local shell command,
pretty much the only way a php shell exec could fail), then
SyntaxHighlight would fallback to outputting a preformatted plain
`<pre>`.

The logic still exists in the code, and is still triggered for cases
where the command reached shellbox and its result was "successfully"
communicated to MediaWiki (HTTP 200), with the boxed result reporting
the non-zero exit code on the shellbox server.

However, the more likely scenario in the new setup is that the command
times out or never reaches the server in the first place, in which
case we don't get any shell exit code. Instead, we get a Shellbox
exception since the result is unknowable.

Instead of fatalling the entire pageview with a PHP exception and
HTTP 500 from MW, use the same graceful fallback.

Bug: T292663
Change-Id: Icaa8c34ff97ad8a99d044beab529ef943071269c
2023-06-03 14:25:50 +01:00