Feature: "academic:upgrade:check" finds dead overrides
Description
EXT: ships the console command
academic:. It compares the Fluid files below one or more
project override folders with the files the installed academic extension ships,
and reports every file that no longer matches one.
vendor/bin/typo3 academic:upgrade:check academic_persons_edit \
--override-path=EXT:my_site/Resources/Private/Extensions/AcademicPersonsEdit/
EXT:my_site/Resources/Private/Extensions/AcademicPersonsEdit/
compared with EXT:academic_persons_edit/Resources/Private/
x missing-upstream Templates/Profile/Show.html
= identical Partials/Profile/Image.html
! case-mismatch Pages/Academicprogram.html -> Pages/AcademicProgram.html
2 problems and 1 notice in 1 override folder.
Three findings are reported:
| Finding | Meaning | Exit status |
|---|---|---|
missing- | The extension ships no file at that relative path, not even one differing in case. Fluid never resolves the override. | problem |
case- | The extension ships the file under a name that differs only in case. Such an override resolves on a case insensitive file system and is dead on the Linux server next to it. | problem |
identical
| The override is a byte identical copy. It renders, and it freezes the markup of that one file at the version it was taken from. | notice |
A changed copy of a file the extension still ships is not reported: it is a deliberate override that works.
The command exits with
1
when at least one problem is reported, with
2
on invalid input, and with
0
otherwise - a notice alone does
not fail a pipeline. It only reads; it changes no file.
Naming the folders
-
- Type
- string
- Required
true
The extension key of the academic extension the overrides belong to, for example
academic_.persons_ edit
-
- Type
- string
A folder holding the project overrides, as an
EXT:path or an absolute path. May be given more than once. It is compared withEXT:<extension>/.Resources/ Private/
-
- Type
- string
The folder the override folders are compared with, when the override folder mirrors a single one rather than
Resources/:Private/ vendor/bin/typo3 academic:upgrade:check academic_persons \ --override-path=EXT:my_site/Resources/Private/Partials/Academic/ \ --upstream-path=EXT:academic_persons/Resources/Private/Partials/Copied!
-
- Type
- string
Take the override folders from the TypoScript of that site instead of from the command line, by its site identifier. It may be combined with
--.override- path
Taking the folders from a site
With
-- the command builds a frontend environment for the site's
root page and reads the view root paths the site's TypoScript configures for the
extension's plugins -
plugin.,
partial and
layout. Each folder is
compared with the upstream folder of its own kind, so
-- is
not needed there.
vendor/bin/typo3 academic:upgrade:check academic_persons --site=main
A root path is only treated as a project override when it lies outside the
checked extension, outside every extension it depends on and outside the TYPO3
system extensions. The partial root paths of the academic plugins name the
shared partials of
EXT:, and those of
EXT: name the partials of
EXT:; neither is a project override, and reporting
them would bury the findings that matter.
The command exits with
2
and names the site when the site does not
exist, when its frontend environment cannot be built, when its TypoScript
configures no view root path for the extension at all, or when a root path names
a folder that does not exist - the last one together with the TypoScript path
that named it.
For the
page. root paths of a site the command is deliberately
not used: they are shared with the site's theme, so every theme template would
be reported as
missing-. Point
-- at the
page template folder instead.
Impact
Integrators get a check they can run before and after an upgrade of the academic extensions, and in continuous integration. Nothing in TYPO3 reports a template override that no longer resolves, so before this command such an override was found by noticing that the frontend no longer looks the way the project configured it.
EXT: requires fgtclb/ for the
-- mode and declares it in composer. and in
ext_. The dependency came with 2.4.0, for the internal
environment subsystem that 3.0 removed, and 3.0 raises it to version 2, see
Important: fgtclb/environment-state-manager 2 is required. Composer managed installations
update the package on their own. Classic installations update the
environment_ extension to 2.x first.