Commit d604075f authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[TASK] Speed up ReST file reference check

There is a test related check for the extension scanner
to verify all referenced ReST files actually exist. It
is active as part of the 'integrity' job in bamboo.
The patch adds a variable to suppress checking the same
ReST file name multiple times if it is referenced in many
matchers. In practice, this speeds up the scanning process
drastically, on my local machine with current master from
more than a minute to less than ten seconds.

Resolves: #87493
Releases: master, 9.5
Change-Id: Iaa19add06ad9eeda9d36e3e204c1a671368b5f29
Reviewed-on: https://review.typo3.org/59495


Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 43604604
......@@ -30,11 +30,16 @@ call_user_func(function () {
->in(__DIR__ . '/../../typo3/sysext/install/Configuration/ExtensionScanner/Php');
$invalidRestFiles = [];
$validRestFiles = [];
foreach ($matcherConfigurationFiles as $matcherConfigurationFile) {
/** @var SplFileInfo $matcherConfigurationFile */
$matcherConfigurations = require $matcherConfigurationFile->getPathname();
foreach ($matcherConfigurations as $matcherConfiguration) {
foreach ($matcherConfiguration['restFiles'] as $restFile) {
if (in_array($restFile, $validRestFiles, true)) {
// Local cache as guard to not check same file over and over again
continue;
}
$restFinder = new \Symfony\Component\Finder\Finder();
$restFileLocation = $restFinder->files()
->in(__DIR__ . '/../../typo3/sysext/core/Documentation/Changelog')
......@@ -44,6 +49,8 @@ call_user_func(function () {
'configurationFile' => $matcherConfigurationFile->getPathname(),
'invalidFile' => $restFile,
];
} else {
$validRestFiles[] = $restFile;
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment