PSA: Renovate now supports Julia

Renovate is an alternative to Dependabot or CompatHelper for keeping dependencies up to date. Renovate and Dependabot both support multiple programming language ecosystems, so you can use one tool for multiple ecosystems.

Renovate supports Julia from version 44.221.0, and other registries than General from 44.252.0. Unlike Dependabot, it is not tied to GitHub: it runs on most platforms, including GitHub (e.g. with the Mend Renovate GitHub app), GitLab, Azure DevOps, Bitbucket, Gitea and Forgejo. It can even be run locally (see below for details).

It updates the [compat] entries of every Project.toml (and JuliaProject.toml) in the repository, docs/ and test/ included, against the General registry by default. As CompatHelper and Dependabot do, it widens the range by default: "0.10, 0.11" with 0.12.1 released becomes "0.10, 0.11, 0.12", and "0.12" with 1.9.24 released becomes "0.12, 1". It skips the julia entry and the standard libraries. Update PRs include the package’s release notes and changelog.

Exact pins stay exact, even with the default widen range strategy: "=0.2.304" is updated to the new version’s exact pin. To explicitly pin dependencies, set Renovate’s rangeStrategy to "pin". Other range strategies are listed in Renovate’s Julia versioning documentation.

A renovate.json like the following is sufficient - in combination with a runner such as the Renovate GitHub App:

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

As demonstrated by GitHub - stemann/RenovateExample.jl · GitHub, with Dependency Dashboard · Issue #1 · stemann/RenovateExample.jl · GitHub.

Renovate’s packageRules can match test dependencies, whether they’re in [targets] or in test/Project.toml, for example to group their updates:

{
  "packageRules": [
    {
      "matchManagers": ["julia"],
      "matchDepTypes": ["test"],
      "groupName": "test dependencies"
    },
    {
      "matchManagers": ["julia"],
      "matchFileNames": ["**/test/Project.toml"],
      "groupName": "test dependencies"
    }
  ]
}

With "bumpVersion": "patch", an update also increments the project’s version.

Other registries

To look packages up in other registries too, private ones included, list them in registryUrls: General by name, as in Pkg, and the others by git URL. They are tried in the listed order:

{
  "julia": {
    "registryUrls": ["General", "https://github.com/HolyLab/HolyLabRegistry"]
  }
}

registryUrls also works in packageRules, for some packages or some project files. Registries other than General are cloned, which the Renovate admin must allow with allowCustomJuliaRegistries. For a private registry over HTTPS, add its credentials as a host rule with hostType julia.

Documentation: Automated Dependency Updates for Julia - Mend Renovate CLI Docs and Julia - Mend Renovate CLI Docs

Self-hosting

Running locally, e.g. for self-hosting a Renovate runner for GitLab, can be accomplished with:

RENOVATE_PLATFORM=gitlab \
RENOVATE_TOKEN=secret_token_for_your_gitlab_user \
npx --yes renovate@44.252.0

Also consider env vars, LOG_LEVEL=debug, and, e.g., RENOVATE_DRY_RUN=lookup when testing - and whether to set RENOVATE_AUTODISCOVER=true or list the repositories that Renovate should process with RENOVATE_REPOSITORIES. To allow other registries, set RENOVATE_ALLOW_CUSTOM_JULIA_REGISTRIES=true.

Pending changes

Notable pending enhancements:

@giordano was, to my knowledge, first to move on the new functionality with Switch from Dependabot to Renovate - Pull Request #1224 - NumericalEarth/Breeze.jl - GitHub :tada:

Maybe I’m misunderstanding something, but if I set an exact compat, it’s because I don’t want the dependency to be updated, typically because a later version has critical bugs.

There are at least also use cases where people pin compat to a single version, but would still like information about newer versions being available (e.g. in the form of update PRs).

Renovate has explicit support for disabling updates to a set of packages (setting "enabled": false in a packageRules entry), which might be a preferable route for said case.

Renovate can also cap the versions it proposes rather than disabling updates altogether, with allowedVersions, which takes a Julia version specifier:

{
  "packageRules": [
    {
      "matchManagers": ["julia"],
      "matchDepNames": ["Example"],
      "allowedVersions": "< 0.5.5"
    }
  ]
}

As an alternative to "enabled": false.

Range strategy widen (at least), i.e. the default, preserves your versioning style (e.g. tilde, explicit caret, spaces etc): Examples of its behaviour is in renovate/lib/modules/versioning/julia/index.spec.ts at 44.221.0 · renovatebot/renovate · GitHub

But see also Julia - Renovate Docs

I’ve updated the post for 44.252.0. Changes since 44.221.0:

  • Registries other than General, private ones included, via registryUrls (44.252.0).
  • Release notes and changelogs in update PRs (44.251.0), thanks to GeneralMetadata.jl serving each package’s repository.
  • bumpVersion increments the project’s version (44.250.0).
  • From 1.0 on, widen adds the bare major, as CompatHelper does: "1.2" with 2.3.0 released becomes "1.2, 2", not "1.2, 2.3" (44.235.5).

If you match Julia dependencies by datasource in packageRules, use "matchDatasources": ["julia"], also for packages in General: rules that match julia-general-metadata no longer match them.