-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add php version requirements file for future-proofing upgrades #14127
Conversation
for fetching before upgrades, to check major prereqs -- mainly php -- before pulling down new, possibly breaking, code.
…w and MVP, dammit
… sounds ridiculous
the latter mostly for testing and san checking.. but it doesn't really matter because it's just json.. if we don't use it we don't use it
PR Summary
|
quoted from #14127 There is a race condition in the upgrade.php file where it can't currently know the hard requirements for the version it's upgrading to until it does a git pull. By that time, it will have pulled new source code that possibly relies on an incompatible version of php, leaving you with a broken installation. Example: You're running v6.2.x on PHP 7.4, which is fine. v7 requires PHP 8.1 or 8.2, but we couldn't know that when we released v6. or v5 for that matter. We could change the requirements in the most-recent v6 version of upgrade.php, but that doesn't help anyone who doesn't upgrade first to the most recent v6. With this change, we implement fetching and incorporating the requirements data from the remote file. It's just fetching/decoding a couple of json values that replace the hard-coded version requirements. We move the branch checking higher than the php version checking so that we can use the defined/overridden $branch to decide what branch to pull the requirements from.
Do we also maybe want this on master? |
Add php version requirements file for future-proofing upgrades
There is a race condition in the upgrade.php file where it can't
currently know the hard requirements for the version it's upgrading to
until it does a git pull. By that time, it will have pulled new source
code that possibly relies on an incompatible version of php, leaving you
with a broken installation.
Example: You're running v6.2.x on PHP 7.4, which is fine. v7 requires
PHP 8.1 or 8.2, but we couldn't know that when we released v6. or v5 for
that matter. We could change the requirements in the most-recent v6
version of upgrade.php, but that doesn't help anyone who doesn't upgrade
first to the most recent v6.
With this change we'll keep a requirements file,
.upgrade_requirements.json, up to date in the root of the default
branch as the requirements to upgrade to HEAD change.
The upgrade.php file will query this file from Github at runtime, to
see if it's safe to pull down the rest of the repo, and warn you if not.
tl;dr, instead of hard-coding the php version requirements into
upgrade.php, we'll fetch the current ones from the live repo at runtime
This file is being added in a separate PR from the upgrade.php changes
so that testing of the script can be done against the live repo. Cart
and horse, and all that.