How to configure Renovate to use composer plugins

174 views Asked by At

I'm trying to configure Renovate on a Symfony project that uses Flex to check conflicting versions. In my repo Renovate should do an update for symfony/monolog-bundle 3.8.0 -> 3.10.0 but it also updates e.g. symfony/error-handler from 5.4.29 -> 6.3.5. This update should be avoided by Flex

In a first step I set the allowPlugins option to true and ignorePlugins to false like suggested here https://github.com/renovatebot/renovate/pull/11990

That resulted in no update cause Renovate groups Symfony updates so that symfony/maker-bundle should also be updated which then resulted in a conflict. So I broke down the config:recommended preset to remove the Symfony grouping. I then get an faulty update for symfony/monolog-bundle but non for symfony/maker-bundle.

composer.json

{
  "require": {
    "symfony/flex": "^2.3",
    ...
    "symfony/monolog-bundle": "^3.7.1",
      
  },
  "require-dev": {
    "symfony/maker-bundle": "^1.23",
    ...
  },
  "conflict": {
    "symfony/symfony": "*"
  },
  "extra": {
    "symfony": {
      "allow-contrib": false,
      "require": "5.4.*"
    }
  },
  "config": {
    "allow-plugins": {
      "composer/package-versions-deprecated": true,
      "ocramius/package-versions": true,
      "phpstan/extension-installer": true,
      "symfony/flex": true
    },
    "platform": {
      "php": "8.2.11"
    }
  }
}

renovate.json

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    ":dependencyDashboard",
    ":semanticPrefixFixDepsChoreOthers",
    ":ignoreModulesAndTests",
    "group:monorepos",
    "replacements:all",
    "workarounds:all",

    "group:nodeJs",
    "group:kubernetes",
    "group:phpstan",
    "group:react"
  ],
  "major": {
    "packageRules": [
      {
        "groupName": "symfony packages",
        "groupSlug": "symfony",
        "matchPackagePrefixes": [
          "symfony/"
        ]
      }
    ]
  },
  "allowPlugins": true,
  "ignorePlugins": false
}

composer.lock diff by Renovate

        {
            "name": "monolog/monolog",
            "version": "2.9.1",
            "version": "2.9.2",
            ...
        },
        {
            "name": "symfony/error-handler",
            "version": "v5.4.29",
            "version": "v6.3.5",
            ...
        },
        {
            "name": "symfony/event-dispatcher",
            "version": "v5.4.26",
            "version": "v6.3.2",
        },
        ...

correct composer.lock diff


        {
            "name": "symfony/monolog-bundle",
            "version": "v3.10.0",
            ...
        },
0

There are 0 answers