-
Notifications
You must be signed in to change notification settings - Fork 2
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
Nov 2024 - Upgrade third-party composer dependencies #306
Comments
Got a printout of all the dependencies per repo, then realised this isn't actually worth my time until we've got the list of supported modules. Used this script, modified from above: $deps = [];
$vendors = ["silverstripe","symbiote","tractorcow","colymba","dnadesign","bringyourownideas"];
foreach ($vendors as $vendor) {
$files = shell_exec("find vendor/$vendor/. | grep composer.json");
$files = explode("\n", $files);
foreach ($files as $file) {
if (!$file) continue;
if (preg_match("#/tests/#", $file)) continue;
preg_match("#vendor/(?<repo>.*)/composer\.json$#", $file, $matches);
$repo = $matches["repo"];
$json = json_decode(file_get_contents($file), true);
foreach (["require", "require-dev"] as $attr) {
if (!isset($json[$attr])) continue;
foreach ($json[$attr] as $dep => $constraint) {
if ($dep === "php") continue;
if (str_starts_with($dep, "silverstripe/")) continue;
if (str_starts_with($dep, "phpunit/")) continue;
if (str_starts_with($dep, "bringyourownideas/")) continue;
if (str_starts_with($dep, "colymba/")) continue;
if (str_starts_with($dep, "dnadesign/")) continue;
if (str_starts_with($dep, "symbiote/")) continue;
if (str_starts_with($dep, "symfony/")) continue;
if (str_starts_with($dep, "ext-")) continue;
$repoDeps[$repo][] = "$dep:$constraint";
}
}
}
}
ksort($repoDeps);
foreach ($repoDeps as $repo => $deps) {
ksort($deps);
echo "\n---------------\n";
echo "REPO: $repo\n---------------\n";
foreach ($deps as $dep) {
echo "$dep\n";
}
} |
Made minor to script and ran, and manually got the latest version from each repo (script was originally in issue description, have copied to here) php -r '
$deps = [];
$vendors = ["silverstripe","symbiote","tractorcow","colymba","dnadesign"];
foreach ($vendors as $vendor) {
$files = shell_exec("find vendor/$vendor/. | grep composer.json");
$files = explode("\n", $files);
foreach ($files as $file) {
if (!$file) continue;
if (preg_match("#/tests/#", $file)) continue;
if (str_contains($file, "webauthn-authenticator")) continue;
$c = file_get_contents($file);
$j = json_decode($c, true);
foreach (["require", "require-dev"] as $r) {
if (!isset($j[$r])) continue;
foreach ($j[$r] as $k => $v) {
if (str_starts_with($k, "silverstripe/")) continue;
if (str_starts_with($k, "bringyourownideas/")) continue;
if (str_starts_with($k, "colymba/")) continue;
if (str_starts_with($k, "dnadesign/")) continue;
if (str_starts_with($k, "symbiote/")) continue;
if (str_starts_with($k, "symfony/")) continue;
if (str_starts_with($k, "ext-")) continue;
$deps["$k:$v"] = true;
}
}
}
}
ksort($deps);
foreach ($deps as $dep => $b) {
echo "$dep\n";
}
' Only 3 things are not on the latest major:
|
@GuySartorelli 3 options: Option A
Option B
Option C
RecommendationI'm personally not a fan of the "widest compatibility" idea with option A, where it does make the upgrade to CMS 6 easier if there is something other third-party dep that only works with some old version of the dep, but at the cost of not getting potentially important bugfixes / security fixes, and it also widens our maintenance surface. We are probably not doing any favors in that scenario Option C is probably overkill as no one installs with --prefer lowest in the real world and patch versions are unlikely to cause compatibility issues My preference is we go with option B - do you have any objection to that? |
Definitely not C. Tl;dr either A or B is fine 👍 |
Cool with go with B |
@emteknetnz I'm getting this when trying to build CMS 5 now:
I think the wrong branch may have been used for recipe testing, behat extension, or the mink one. |
Likely mink-facebook webdriver - have made pr silverstripe/MinkFacebookWebDriver#32 |
PRs merged - reassigned to Steve for next steps |
PRs merged |
The CMS 6 beta will be released around mid Jan 2025. Upgrading the composer dependencies should be done fairly close to this cut-off to allow as much time for third party new major versions to be released, though still allow some time to ensure we have adequate time to upgrade everything.
Acceptance criteria
Notes
This bash script can be used to identify dependencies that need to be updated on the base folder of an install of kitchen-sink:
The following script was used to update deps - https://github.com/emteknetnz/cms6-update-deps
Update minor deps
Kitchen sink CI
^ Unit test failure is existing
PRs
After merging assign back to Steve
Update major deps
Did not update any phpunit deps as they were all for repos that are used for both CMS 5 and CMS 6 e.g. silverstripe/supported-modules
Kitchen sink CI
^ Unit test failure is existing
PRs
The text was updated successfully, but these errors were encountered: