Skip to content
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

Open
3 tasks
emteknetnz opened this issue Sep 2, 2024 · 1 comment
Open
3 tasks

Nov 2024 - Upgrade third-party composer dependencies #306

emteknetnz opened this issue Sep 2, 2024 · 1 comment

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Sep 2, 2024

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

  • Dependencies that need to be updated for CMS 6 are identified (excluding symfony and phpunit)
  • Dependencies are updated
  • Fixed dependencies page is updated

Notes

  • Symfony 7 has already been done in this card
  • PHPunit 11 has already been done in this card

This bash script can be used to identify dependencies that need to be updated on the base folder of an install of kitchen-sink:

php -r '
    $deps = [];
    $vendors = ["silverstripe","symbiote","tractorcow","colymba","dnadesign","bringyourownideas"];
    foreach ($vendors as $vendor) {
        $files = shell_exec("find vendor/silverstripe/. | grep composer.json");
        $files = explode("\n", $files);
        foreach ($files as $file) {
            if (!$file) continue;
            if (preg_match("#/tests/#", $file)) 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";
    }
'
@emteknetnz emteknetnz changed the title Upgrade third-party composer dependencies Nov 2024 - Upgrade third-party composer dependencies Sep 3, 2024
@GuySartorelli GuySartorelli added this to the Silverstripe CMS 6.0 milestone Sep 13, 2024
@GuySartorelli GuySartorelli self-assigned this Nov 15, 2024
@GuySartorelli
Copy link
Member

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";
  }
}

@GuySartorelli GuySartorelli removed their assignment Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants