Semantic Renovate diffs with `renovate-packagedata-diff`
By using the renovate-packagedata-diff
command, you can get semantic differences between Renovate data exports.
This works for any of the sources of Renovate data that dependency-management-data supports, aside from:
- Renovate's Reports exports - see the tracking issue for more details.
This allows you to replace an awkward diff of JSON exports like:
With a much more human-readable diff, when you wire in renovate-packagedata-diff
:
Notice that we get an actually human-readable TL;DR of what's changed in a given update.
To have this enable by default with your local Git config, add the following to .git/config
:
[diff "renovate-packagedata-diff"]
command = renovate-packagedata-diff
And then add the below to your .gitattributes
, assuming your Renovate data exports are in renovate/
in the repository you have set up:
renovate/*.json diff=renovate-packagedata-diff
Known issues:
- Multiple versions of the same package in a given file can confuse the diffs https://gitlab.com/tanna.dev/dependency-management-data/-/issues/626
JSON Output
Since dependency-management-data v0.113.0, it is possible to produce JSON output from renovate-packagedata-diff
, for instance:
{
"notes": [],
"additions": [
{
"packageName": "croner",
"packageType": "npm",
"version": "9.0.0",
"currentVersion": "9.0.0",
"digest": null,
"depTypes": [
"dependencies"
],
"packageFilePath": "package.json"
}
],
"modification": [
{
"previousDependency": {
"packageName": "ghcr.io/renovatebot/base-image",
"packageType": "docker",
"version": "9.9.2-full",
"currentVersion": "9.9.2-full",
"digest": "sha256:73e6778a296f738f3319ae21493b8d09d85cc5d96d584dc1f8131ed697b5a375",
"depTypes": [
"stage"
],
"packageFilePath": "tools/docker/Dockerfile"
},
"diffs": {
"version": "9.14.1-full",
"currentVersion": "9.14.1-full",
"digest": "sha256:677fb390a315a28a517394f4ee34cc9827da17bd4a854461c293b94a521f8f10"
}
},
{
"previousDependency": {
"packageName": "ghcr.io/renovatebot/base-image",
"packageType": "docker",
"version": "9.9.2-full",
"currentVersion": "9.9.2-full",
"digest": "sha256:73e6778a296f738f3319ae21493b8d09d85cc5d96d584dc1f8131ed697b5a375",
"depTypes": [
"stage"
],
"packageFilePath": "tools/docker/Dockerfile"
},
"diffs": {
"version": "9.14.1",
"currentVersion": "9.14.1",
"digest": "sha256:681641f310b63c5f1187df97b94bb6ddde280a00667624e0364b92dface942c1"
}
},
{
"previousDependency": {
"packageName": "ghcr.io/renovatebot/base-image",
"packageType": "docker",
"version": "9.9.2",
"currentVersion": "9.9.2",
"digest": "sha256:bda9fce19989b0286e796f8eb89d20f776fe7826de3009b6820ec61003cc4ca3",
"depTypes": [
"final"
],
"packageFilePath": "tools/docker/Dockerfile"
},
"diffs": {
"version": "9.14.1",
"currentVersion": "9.14.1",
"digest": "sha256:681641f310b63c5f1187df97b94bb6ddde280a00667624e0364b92dface942c1"
}
},
{
"previousDependency": {
"packageName": "ghcr.io/renovatebot/base-image",
"packageType": "docker",
"version": "9.9.2",
"currentVersion": "9.9.2",
"digest": "sha256:bda9fce19989b0286e796f8eb89d20f776fe7826de3009b6820ec61003cc4ca3",
"depTypes": [
"stage"
],
"packageFilePath": "tools/docker/Dockerfile"
},
"diffs": {
"version": "9.14.1-full",
"currentVersion": "9.14.1-full",
"digest": "sha256:677fb390a315a28a517394f4ee34cc9827da17bd4a854461c293b94a521f8f10"
}
},
{
"previousDependency": {
"packageName": "ghcr.io/renovatebot/base-image",
"packageType": "docker",
"version": "9.9.2",
"currentVersion": "9.9.2",
"digest": "sha256:bda9fce19989b0286e796f8eb89d20f776fe7826de3009b6820ec61003cc4ca3",
"depTypes": [
"stage"
],
"packageFilePath": "tools/docker/Dockerfile"
},
"diffs": {
"version": "9.14.1",
"currentVersion": "9.14.1",
"digest": "sha256:681641f310b63c5f1187df97b94bb6ddde280a00667624e0364b92dface942c1"
}
},
{
"previousDependency": {
"packageName": "pnpm",
"packageType": "npm",
"version": "9.13.0",
"currentVersion": "9.13.0",
"digest": null,
"depTypes": [
"packageManager"
],
"packageFilePath": "package.json"
},
"diffs": {
"version": "9.14.2",
"currentVersion": "9.14.2"
}
},
{
"previousDependency": {
"packageName": "pnpm",
"packageType": "npm",
"version": "9.13.0",
"currentVersion": "9.13.0",
"digest": null,
"depTypes": [
"volta"
],
"packageFilePath": "package.json"
},
"diffs": {
"version": "9.14.2",
"currentVersion": "9.14.2"
}
},
{
"previousDependency": {
"packageName": "pnpm",
"packageType": "npm",
"version": "^9.0.0",
"currentVersion": "9.14.2",
"digest": null,
"depTypes": [
"engines"
],
"packageFilePath": "package.json"
},
"diffs": {
"currentVersion": "9.14.4"
}
},
{
"previousDependency": {
"packageName": "renovate/renovate",
"packageType": "docker",
"version": "39.19.1",
"currentVersion": "39.19.1",
"digest": null,
"depTypes": [],
"packageFilePath": "docs/usage/examples/self-hosting.md"
},
"diffs": {
"version": "39.42.4",
"currentVersion": "39.42.4"
}
},
{
"previousDependency": {
"packageName": "renovate/renovate",
"packageType": "docker",
"version": "39.19.1",
"currentVersion": "39.19.1",
"digest": null,
"depTypes": [],
"packageFilePath": "docs/usage/examples/self-hosting.md"
},
"diffs": {
"version": "39.42",
"currentVersion": "39.42"
}
},
{
"previousDependency": {
"packageName": "renovate/renovate",
"packageType": "docker",
"version": "39.19",
"currentVersion": "39.19",
"digest": null,
"depTypes": [],
"packageFilePath": "docs/usage/examples/self-hosting.md"
},
"diffs": {
"version": "39.42.4",
"currentVersion": "39.42.4"
}
},
{
"previousDependency": {
"packageName": "renovate/renovate",
"packageType": "docker",
"version": "39.19",
"currentVersion": "39.19",
"digest": null,
"depTypes": [],
"packageFilePath": "docs/usage/examples/self-hosting.md"
},
"diffs": {
"version": "39.42",
"currentVersion": "39.42"
}
},
{
"previousDependency": {
"packageName": "renovate/renovate",
"packageType": "docker",
"version": "39",
"currentVersion": "39",
"digest": null,
"depTypes": [],
"packageFilePath": "docs/usage/examples/self-hosting.md"
},
"diffs": {
"version": "39.42",
"currentVersion": "39.42"
}
}
],
"deletion": [
{
"packageName": "cron-parser",
"packageType": "npm",
"version": "4.9.0",
"currentVersion": "4.9.0",
"digest": null,
"depTypes": [
"dependencies"
],
"packageFilePath": "package.json"
}
],
"isNew": false,
"isDeletion": false
}
This JSON output is generated in the format defined by the JSON Schema in renovate-packagedata-diff-schema.json
.