Summarising the skipReasons for Renovate data exports

Featured image for sharing metadata for article

When working with package data dumps from Renovate - regardless of the source - it can be interesting to see which packages haven't found updates.

This can be worked out using the skipReason JSON field, for instance with the below renovate-graph output:

{
  "metadata": {
    "renovate": {
      "major": 38,
      "platform": "github",
      "version": "38.130.2"
    }
  },
  "organisation": "renovatebot",
  "packageData": {
    "github-actions": [
      {
        "deps": [
          {
            "autoReplaceStringTemplate": "{{depName}}-{{newValue}}",
            "currentValue": "latest",
            "datasource": "github-runners",
            "depName": "ubuntu",
            "depType": "github-runner",
            "packageName": "ubuntu",
            "replaceString": "ubuntu-latest",
            "skipReason": "invalid-version",
            "updates": [
            ]
          }
        ],
        "packageFile": ".github/workflows/build.yml"
      }
    ]
  }
}

It can be useful to view at-a-glance which of your dependencies are not being updated, for whatever reason.

To do this, we could use the following JQ script:

.packageData |
    to_entries[] |
    .key as $k |
    .value[] |
    .packageFile as $pf |
    .deps[] |
    select(.skipReason != null) |
    "\(.skipReason): \($pf) \($k)/\(.packageName)@\(.currentValue)"

I'm not particularly jq-savvy, so this was a fun one to try and work out. Recommendations for improvements are very welcome!

This outputs:

# against https://gitlab.com/tanna.dev/dependency-management-data-example/-/blob/main/renovate/github-renovatebot-renovate.json
jq -r '.packageData | to_entries[] | .key as $k | .value[] | .packageFile as $pf | .deps[] | select(.skipReason != null) | "\(.skipReason): \($pf) \($k)/\(.packageName)@\(.currentValue)" ' renovate/github-renovatebot-renovate.json
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/build.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/codeql-analysis.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/dependency-review.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/devcontainer.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/label-actions.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/lock.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/mend-slack.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/scorecard.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/trivy.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/undesirable-test-additions.yaml github-actions/ubuntu@latest
invalid-version: .github/workflows/update-data.yml github-actions/ubuntu@latest
invalid-version: .github/workflows/ws_scan.yaml github-actions/ubuntu@latest
file: package.json npm/@renovate/eslint-plugin@file:tools/eslint
invalid-value: package.json npm/ignoredOptionalDependencies@null
invalid-value: docs/usage/examples/opentelemetry.md regex/renovate/renovate@latest
invalid-value: docs/usage/release-notes-for-major-versions.md regex/renovate/renovate@latest

This is something that I may end up constructing into a separate CLI, renovate-packagedump-summary, when finished with renovate-packagedump-diff, as this - and other key metadata - can be useful to know.

I'll also want to report this in a slightly nicer way, as well as group duplicate entries by file or by package name.

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #renovate #dependency-management-data.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.