↓ Skip to main content

Onboarding a project to Renovate

·542 words·3 mins
Table of Contents
Renovate - This article is part of a series.
Part 2: This Article

Renovate checks a repository continuously as soon as it has a config of its own. It contains the reference to the shared preset, versions outside the usual managers, and rules for major versions. The example here is vegane-brezn.de , a SvelteKit application with PostgreSQL and PostGIS, a dev container and a Woodpecker pipeline. All snippets in this part come from two files in that repository:

Nothing changes in the central renovate-config repository.

Config in the project
#

The project needs a one-line renovate.json on its default branch:

{
  "extends": ["local><owner>/renovate-config"]
}

local> resolves the preset from renovate-config/default.json on whatever platform Renovate is currently running on. If there are several config files (renovate.json5, .github/renovate.json, .renovaterc* or a renovate key in package.json), Renovate uses the first one it finds.

Autodiscover ignores mirrors and repositories with pull requests disabled. It also skips forks, even when they have a config; setting "forkProcessing": "enabled" in the fork’s renovate.json turns processing on.

Versions in the dev container
#

Images referenced only by digest are not updated; they need a tag or tag@sha256:.... For pre-commit hooks, rev has to be a release tag. No manager understands versions in shell scripts, Makefiles or dev container fields.

In this project, postCreateCommand installs several tools at pinned versions. In .devcontainer/devcontainer.json, a comment above each of these lines names the datasource and the package:

{
  "postCreateCommand": {
    // renovate: datasource=github-releases depName=gitleaks/gitleaks
    "Install gitleaks": "${containerWorkspaceFolder}/.devcontainer/gitleaks.sh v8.30.1"
  }
}

A regex manager in renovate.json reads the comment and the version:

{
  "customManagers": [
    {
      "customType": "regex",
      "managerFilePatterns": ["/^\\.devcontainer/devcontainer\\.json$/"],
      "matchStrings": [
        "//\\s*renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\\s*\\n[^\\n]*?(?<currentValue>v?\\d+\\.\\d+\\.\\d+)"
      ]
    }
  ]
}

Unversioned installs such as npm install -g tool or pip install tool are invisible to Renovate until they are pinned. The dev container manager updates the features in devcontainer.json, but not devcontainer-lock.json.

Blocking major versions
#

The hosting provider dictates Node and PostgreSQL: Node 18, 20 and 22 and PostgreSQL 14 and 15 for vegane-brezn.de. A packageRule in renovate.json blocks newer major versions everywhere these versions appear:

{
  "packageRules": [
    {
      "matchPackageNames": [
        "node",
        "@types/node",
        "mcr.microsoft.com/devcontainers/typescript-node",
        "postgis/postgis"
      ],
      "matchUpdateTypes": ["major"],
      "enabled": false
    }
  ]
}

For Docker tags like postgis/postgis:15-3.5, Renovate treats 3.5 as a fixed suffix, so it never proposes PostGIS minor updates.

Grouping major versions
#

@sveltejs/adapter-node@6 requires @sveltejs/kit@^3 as a peer dependency and doesn’t build as a separate PR. A second packageRule in renovate.json bundles the major versions of both packages into one PR:

{
  "packageRules": [
    {
      "matchPackageNames": ["@sveltejs/kit", "@sveltejs/adapter-node"],
      "matchUpdateTypes": ["major"],
      "groupName": "sveltekit major"
    }
  ]
}

Moving to SvelteKit 3 still needed a migration with npx sv migrate sveltekit-3. It happened on a separate branch; once that was merged, Renovate closed its own PR.

Not every conflict can be solved by grouping. SvelteKit 3.2.0 requires typescript@^6.0.0, so the PR for TypeScript 7 stays red until SvelteKit catches up, and stays open as a reminder.

Validating the config
#

renovate-config-validator checks renovate.json before committing. Renovate 44 requires Node ^24.11.0 || ^26.13.0; in a dev container with Node 22, the validator runs from the Renovate image:

docker run --rm -v "$PWD/renovate.json:/tmp/cfg/renovate.json:ro" -w /tmp/cfg \
  renovate/renovate:44 renovate-config-validator --strict

Without a file argument, the validator checks the file as a repository config.


Found this helpful?
Consider supporting via:

Renovate - This article is part of a series.
Part 2: This Article