Skip to content

Pagemachine-specific configuration for Renovate (GitLab mirror)

Notifications You must be signed in to change notification settings

pagemachine/renovate-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 

Repository files navigation

Pagemachine Renovate Config

Organization level presets configuration for Renovate.

See the Renovate docs about Configuration Options and Default Presets for all features and tweaks.

Default preset

Usage in renovate.json:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["local>pagemachine/renovate-config"]
}

The default.json:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "config:recommended",
    ":separatePatchReleases"
  ],
  "commitMessagePrefix": "[TASK] ",
  "commitMessageTopic": "{{depName}}",
  "commitMessageExtra": " ({{{displayFrom}}} => {{{displayTo}}})",
  "platformAutomerge": true,
  "rangeStrategy": "update-lockfile",
  "packageRules": [
    // See below
  ]
}

The various parts explained:

  • config:recommended is the default configuration for all languages.

  • :separatePatchReleases separates minor (x.Y.z) and patch (x.y.Z) updates. Patch updates are usually safe to apply right away. Minor updates provide new features and should be reviewed more thoroughly.

  • commitMessagePrefix, commitMessageTopic, commitMessageExtra slightly reformat the Renovate commit messages:

    [TASK] Update <package> (<old-version> => <new-version>)
    
  • platformAutomerge enables the platform-native auto-merge capabilities so that update PRs can be merged automatically without interaction.

  • rangeStrategy prefers lockfile updates (e.g. composer.lock), otherwise updates version constraints (e.g. ^1.0 to ^2.0)

  • packageRules:

    {
      "matchDepTypes": [
        "devDependencies",
        "require-dev"
      ],
      "automerge": true
    }

This rule enables automerge for all kind of development dependencies, namely for NPM/Yarn (devDependencies) and Composer (require-dev).

    {
      "matchDepTypes": [
        "require"
      ],
      "matchPackageNames": [
        // ...
      ],
      "matchUpdateTypes": [
        "minor",
        "patch"
      ],
      "automerge": true
    }

This rule enables automerge for a selected list of reqular Composer dependencies.

    {
      "matchPackageNames": [
        // ...
      ],
      "minimumReleaseAge": "1 day"
    },

This rule enforces a delay of 1 day for update processing like automerge for a selected list of packages.

    {
      "matchDatasources": ["docker"],
      "matchPackageNames": [
        // ...
      ],
      "enabled": false
    },

This rule disables update suggestions for a selected list of Docker images. Usually these updates could not be completed without further changes.

    {
      "matchDatasources": ["docker"],
      "matchPackageNames": [
        // ...
      ],
      "matchUpdateTypes": [
        "patch"
      ],
      "automerge": true
    },

This rule enables automerge for patch updates of a selected list of Docker images.

    {
      "matchDepNames": ["php"],
      "enabled": false
    }

This rule disables all PHP update suggestions. Updating the PHP version or widening the range of supported PHP versions is almost always accompanied by further changes like Docker image updates and CI adjustments. Thus it currently does not make much sense to have Renovate suggest such updates.

    {
      "matchPackagePrefixes": [
        // ...
      ],
      "matchPackageNames": [
        // ...
      ],
      "groupName": "PHPStan",
      "separateMajorMinor": false
    }

This rule groups all PHPStan-related packages into a single update. This avoids broken update PRs caused by major version bumps.

    {
      "matchPackagePrefixes": [
        "typo3/cms-"
      ],
      "excludePackageNames": [
        "typo3/cms-cli",
        "typo3/cms-composer-installers"
      ],
      "groupName": "TYPO3 CMS",
      "labels": [
        "typo3"
      ],
      "prPriority": 5,
      "extends": [
        ":disableMajorUpdates"
      ]
    }

This rule groups all TYPO3 packages into a single update. Technically all TYPO3 packages must be updated at once since all depend on each other with the same version.

A label is added to update PRs for easier identification across projects.

The priority is raised over other updates to 5 (arbitrary, higher than the default 0).

Major TYPO3 updates (e.g. from v9 to v10) will not be suggested. These basically always need proper preparation and migration as well as other package updates.

TYPO3 Extension preset

Usage in renovate.json:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["local>pagemachine/renovate-config:typo3-cms-extension"]
}

The typo3-cms-extension.json:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["local>pagemachine/renovate-config"],
  "packageRules": [
    // See below
  ]
}

The various parts explained:

    {
      "matchDepTypes": [
        "require"
      ],
      "rangeStrategy": "widen"
    }

This rule overrides the rangeStrategy for Composer dependencies via require. By default new major version updates of dependencies would lead to a replaced version constraint:

-"typo3/cms-core": "^10.4",
+"typo3/cms-core": "^11.5",

With widen, the new major version is added instead:

-"typo3/cms-core": "^10.4",
+"typo3/cms-core": "^10.4 || ^11.5",

This is a good practice for TYPO3 extensions to support at least 2 consecutive TYPO3 major versions for smooth upgrades.

About

Pagemachine-specific configuration for Renovate (GitLab mirror)

Resources

Stars

Watchers

Forks