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

feat(presets): improve grouping of symfony packages #34653

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Mar 6, 2025

Changes

Only applies the group to the packagist datasource and avoids grouping the most popular packages from the same vendor which are not released together with the core framework packages.

After this non-complete / best-effort change the list of irrelevant packages is down from ~83 to ~12 which should improve symfony-grouped PRs already quite a bit, especially if people are either slow with updates or just started using renovate and are catching up.

Context

There are a couple of popular symfony/* packages which are not released together with the core framework / monorepo. And it often can happen that some of those have updates as well, which leads to undesired behaviour (e.g. update includes non-relevant package, mix of target versions in the PR, PR is immortal, ..)

I grabbed all non-abandoned symfony packages from packagist.org, excluded the ones that have releases for the latest framework and tried to find a couple of simple, non-complete, patterns which would improve the situation.

php script to grab packages
<?php

declare(strict_types=1);

$packageNames = json_decode(file_get_contents('https://packagist.org/packages/list.json?vendor=symfony'), true, 512, JSON_THROW_ON_ERROR)['packageNames'] ?? null;
assert($packageNames !== null);

$packageLatestVersions = [];
foreach ($packageNames as $packageName) {
    $latestReleases = json_decode(file_get_contents("https://repo.packagist.org/p2/{$packageName}.json"), true, 512, JSON_THROW_ON_ERROR)['packages'][$packageName];
    assert($latestReleases !== null);

    if ([] === $latestReleases) {
        continue;
    }

    if (isset($latestReleases[0]['abandoned'])) {
        continue;
    }

    $latestVersion = $latestReleases[0]['version'] ?? null;
    assert($latestVersion !== null);

    if (str_starts_with($latestVersion, 'v7.2')) {
        continue;
    }

    $packageLatestVersions[$packageName] = $latestVersion;
}

var_dump($packageLatestVersions);
results
array(83) {
  ["symfony/acl-bundle"]=>
  string(6) "v2.4.0"
  ["symfony/amphp-http-client-meta"]=>
  string(6) "v2.0.0"
  ["symfony/amqp-pack"]=>
  string(7) "v1.0.13"
  ["symfony/apache-pack"]=>
  string(6) "v1.0.1"
  ["symfony/cache-contracts"]=>
  string(6) "v3.5.1"
  ["symfony/contracts"]=>
  string(6) "v3.5.2"
  ["symfony/debug-pack"]=>
  string(7) "v1.0.10"
  ["symfony/deprecation-contracts"]=>
  string(6) "v3.5.1"
  ["symfony/event-dispatcher-contracts"]=>
  string(6) "v3.5.1"
  ["symfony/flex"]=>
  string(6) "v2.5.0"
  ["symfony/http-client-contracts"]=>
  string(6) "v3.5.2"
  ["symfony/maker-bundle"]=>
  string(7) "v1.62.1"
  ["symfony/mercure"]=>
  string(6) "v0.6.5"
  ["symfony/mercure-bundle"]=>
  string(6) "v0.3.9"
  ["symfony/monolog-bundle"]=>
  string(7) "v3.10.0"
  ["symfony/orm-pack"]=>
  string(6) "v2.4.1"
  ["symfony/panther"]=>
  string(6) "v2.2.0"
  ["symfony/polyfill"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-apcu"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-ctype"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-iconv"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-intl-grapheme"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-intl-icu"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-intl-idn"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-intl-messageformatter"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-intl-normalizer"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-mbstring"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php54"]=>
  string(7) "v1.20.0"
  ["symfony/polyfill-php55"]=>
  string(7) "v1.20.0"
  ["symfony/polyfill-php56"]=>
  string(7) "v1.20.0"
  ["symfony/polyfill-php70"]=>
  string(7) "v1.20.0"
  ["symfony/polyfill-php71"]=>
  string(7) "v1.20.0"
  ["symfony/polyfill-php72"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php73"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php74"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php80"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php81"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php82"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php83"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-php84"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-util"]=>
  string(7) "v1.31.0"
  ["symfony/polyfill-uuid"]=>
  string(7) "v1.31.0"
  ["symfony/profiler-pack"]=>
  string(6) "v1.0.6"
  ["symfony/proxy-manager-bridge"]=>
  string(7) "v6.4.13"
  ["symfony/psr7-meta"]=>
  string(6) "v1.0.0"
  ["symfony/psr7-pack"]=>
  string(6) "v1.3.0"
  ["symfony/requirements-checker"]=>
  string(6) "v2.0.3"
  ["symfony/security-acl"]=>
  string(6) "v3.3.4"
  ["symfony/security-guard"]=>
  string(7) "v5.4.45"
  ["symfony/sendinblue-mailer"]=>
  string(7) "v6.4.13"
  ["symfony/sendinblue-notifier"]=>
  string(7) "v6.4.13"
  ["symfony/serializer-pack"]=>
  string(6) "v1.3.0"
  ["symfony/service-contracts"]=>
  string(6) "v3.5.1"
  ["symfony/stimulus-bundle"]=>
  string(7) "v2.23.0"
  ["symfony/symfony-demo"]=>
  string(6) "v2.6.0"
  ["symfony/symfony1"]=>
  string(6) "1.4.28"
  ["symfony/templating"]=>
  string(7) "v6.4.13"
  ["symfony/test-pack"]=>
  string(6) "v1.1.0"
  ["symfony/thanks"]=>
  string(6) "v1.4.0"
  ["symfony/translation-contracts"]=>
  string(6) "v3.5.1"
  ["symfony/twig-pack"]=>
  string(6) "v1.0.1"
  ["symfony/ux-autocomplete"]=>
  string(7) "v2.23.0"
  ["symfony/ux-chartjs"]=>
  string(7) "v2.23.0"
  ["symfony/ux-cropperjs"]=>
  string(7) "v2.23.0"
  ["symfony/ux-dropzone"]=>
  string(7) "v2.23.0"
  ["symfony/ux-google-map"]=>
  string(7) "v2.23.0"
  ["symfony/ux-icons"]=>
  string(7) "v2.23.0"
  ["symfony/ux-lazy-image"]=>
  string(7) "v2.23.0"
  ["symfony/ux-leaflet-map"]=>
  string(7) "v2.23.0"
  ["symfony/ux-live-component"]=>
  string(7) "v2.23.0"
  ["symfony/ux-map"]=>
  string(7) "v2.23.0"
  ["symfony/ux-notify"]=>
  string(7) "v2.23.0"
  ["symfony/ux-react"]=>
  string(7) "v2.23.0"
  ["symfony/ux-svelte"]=>
  string(7) "v2.23.0"
  ["symfony/ux-swup"]=>
  string(7) "v2.23.0"
  ["symfony/ux-toggle-password"]=>
  string(7) "v2.23.0"
  ["symfony/ux-translator"]=>
  string(7) "v2.23.0"
  ["symfony/ux-turbo"]=>
  string(7) "v2.23.0"
  ["symfony/ux-twig-component"]=>
  string(7) "v2.23.0"
  ["symfony/ux-typed"]=>
  string(7) "v2.23.0"
  ["symfony/ux-vue"]=>
  string(7) "v2.23.0"
  ["symfony/webapp-pack"]=>
  string(6) "v1.3.0"
  ["symfony/webpack-encore-bundle"]=>
  string(6) "v2.2.0"
}

Additionally, I added some of the most popular packages which are also used in the demo symfony app: https://github.com/symfony/demo/blob/v2.6.0/composer.json

And as last step I also removed the packages which showed up on the first 5 pages of https://packagist.org/packages/symfony/debug?query=symfony%2F manually.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@herndlm herndlm marked this pull request as draft March 6, 2025 09:55
@herndlm herndlm marked this pull request as ready for review March 6, 2025 10:00
@herndlm herndlm marked this pull request as draft March 6, 2025 10:04
@herndlm herndlm marked this pull request as ready for review March 6, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants