きっかけ

ふと気づいたら最近 AndroidX などのライブラリのバージョン更新 PR が Renovate から来ていないな?となったので調査してみました。

調査

バージョン更新 PR が来ているライブラリと来ていないライブラリの違いは何か?

AndroidX のライブラリは来ていないけど、他のライブラリは来ていました。すべてのライブラリではないということがわかりましたが、具体的な違いはまだわかりませんでした。

Renovate のログを確認できないか?

Renovate は GitHub Apps で導入していたのでログは確認できないんですが、Self-hosting や GitHub Actions ではログを確認することができます。

GitHub - renovatebot/github-action at v32.0.6

Private リポジトリに GitHub Actions で Renovate を導入して debug ログを実行してみました。

name: Renovate

on:
  issue_comment:
    types: [ created ]

jobs:
  renovate:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Self-hosted Renovate
        uses: renovatebot/[email protected]
        with:
          configurationFile: renovate-config.js
          token: ${{ secrets.RENOVATE_TOKEN }}
        env:
          LOG_LEVEL: 'debug'
module.exports = {
  branchPrefix: 'test-renovate/',
  dryRun: false,
  username: 'renovate-release',
  gitAuthor: 'Renovate Bot <[email protected]>',
  onboarding: false,
  platform: 'github',
  includeForks: true,
  repositories: [
    'wada811/Android-App-Template'
  ],
  packageRules: [
  ],
};

そして debug ログを確認してみると以下のようなログがありました。

{
  "packageFile": "gradle/script/android-base/dependencies/androidx.annotation.gradle",
  "datasource": "maven",
  "deps": [
    {
      "depName": "androidx.annotation:annotation",
      "currentValue": "1.3.0",
      "managerData": {
        "fileReplacePosition": 66,
        "packageFile": "gradle/script/android-base/dependencies/androidx.annotation.gradle"
      },
      "fileReplacePosition": 66,
      "registryUrls": [
        "<https://repo.maven.apache.org/maven2>",
        "<https://plugins.gradle.org/m2/>",
        "<https://jitpack.io>"
      ],
      "depIndex": 0,
      "updates": [],
      "warnings": [
        {
          "topic": "androidx.annotation:annotation",
          "message": "Failed to look up dependency androidx.annotation:annotation"
        }
      ],
      "versioning": "gradle"
    }
  ]
},

Failed to look up dependency androidx.annotation:annotation あやしいですね。

そして registryUrls を見ると google() の URL がないですね。

これが原因のような気がします。

registryUrlsgoogle() の URL があれば動くのか?

本当にこれが原因か確かめるために registryUrlsgoogle() の URL を追加できないかと調べてみると、Renovate の config に registryUrls がありました。

Configuration Options - Renovate Docs

Powered by Fruition