Major Version Update: PHP 8.5, Symfony 7.4, etc.#1146
Major Version Update: PHP 8.5, Symfony 7.4, etc.#1146mbusch3 wants to merge 17 commits intoucfopen:devfrom
Conversation
Moving change to main that will tackle batching issue
|
Changing the PHP version used in the CICD pipeline config files from 8.4 to 8.5 solved the previous issue: However, there seems to be a new issue when we get to the Postgres step of the CICD pipeline:
It seems like something is causing Postgres to no longer work, I'll try to look into it as well. |
…ut postgres in cicd since it's failing and we don't use it
…atabase in cicd, update node to LTS ver
|
After testing (Danny and I tested recreating UDOIT from scratch) it seems like the change in I think we should revert back from |
…to remove-phpally
…n the pull request)
Major Dependencies Update
The primary concern is that older, outdated versions of required libraries may present security vulnerabilities. To test, delete all caches and builds (like
var/cache/prod) and rebuild from scratch.package.jsonRequired Build Packages"php": "^7.4.0 || ^8.1 || ^8.2 || ^8.4"
PHP 8.2 is no longer receiving active support, and security support is only offered until December 2026. I jumped straight to PHP 8.5, which is security supported until December 2029 (full support through December 2027).
"symfony/*": "^6.4"
There are a LOT of core symfony packages that update together. We have been using Symfony 6.4, which is two major versions behind. Some individual packages are not core components, like
symfony/flex, and are on a different versioning cadence. While there IS a version 8.0 available, I opted for version 7.4, which is the latest long-term supported version (through the end of 2028).phpAlly
This PR also removes phpAlly as a dependency and all the code that refers to it, including phpAlly-specific classes for issues and reports.
PHP Packages updated
It is very likely that one or more of the
symfony/*packages that were updated is no longer used, and further cleanup may be done in the near future.PHP Packages Removed
The following packages are no longer used in the project and have been removed as dependencies.
The removal of a few of these packages also affected
config/bundles.php.Additional Changes Required for the Update
A LOT of small things broke, which required additional minor changes to correct. They are all listed here to make reviewing easier.
PHP Upgrade
To move to PHP 8.5, I needed to update the Dockerfiles to grab the right base image, including in
Dockerfile.composer, where I updated to a newer version of Composer that is compatible with PHP 8.5.Files affected:
Routing
In the newer version of Symfony, Routes are handled in the
Routing\Attributecomponent instead of theRouting\Annotationcomponent. I just needed to change the import in some of the main failes with Routes.Additionally, in the newer version of Symfony, the
/udoit3route prefix was making it through, so our software was trying to find/udoit3/lti/authorize(for instance) instead or/lti/authorize. I needed to tweak the nginx configurations to fix that.Files affected:
Table Auto-Naming
The older versions of
doctrine/ormtook PascalCase variables and automatically created table names in snake_case. It no longer does that, and so table names need to be manually declared. The single-word ones don't necessarily, but I included them for consistency.Files affected:
Deprecated Code
With the update to the
firebase/php-jwtpackage, calling theJWT:decodefunction only accepts two parameters, not three (the encoding is now passed as part of the second parameter). Updated the function call.Deprecated
Messenger/Handler/MessageHandlerInterfacereplaced withMessenger/Attribute/AsMessageHandler. It's a bit of a weird fix, but seems to be working cleanly.The CreateQueryBuilder function no longer supports
setParameterswith an array, justsetParameter. Luckily, that particular construction was only used once. I updated it to match thesetParameterpattern.Removed an unused reference to a now-deprecated library (PassportInterface).
There are a few parameters that are no longer supported in the config files. For instance,
enable_authentication_manageris now always enabled insecurity.yaml.Initial Scans
Running
composer auditreturned the following:Running
composer outdatedreturned the following:Concluding Scans
Running
composer auditreturned the following:Running
composer outdatedreturned the following: