From 521cd54c1aa30aadf974f1510ad68f6f7923eb69 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sun, 29 Sep 2024 15:51:21 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=E3=81=99=E3=81=B9=E3=81=A6=E3=81=AE?= =?UTF-8?q?=E4=BE=9D=E5=AD=98=E3=82=92Renovate=E3=81=AE=E5=AF=BE=E8=B1=A1?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B=20(#839)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 次の2つの"group"にまとめる形で、あらゆる依存をRenovateの自動PRの対象にす る。 * "major dependencies" (`renovate/major-dependencies`) * "non-major dependencies" (`renovate/non-major-dependencies`) 0.y.zのy(ただしy≧1)、0.0.zのzの変更は"major dependencies"側に分類す る。Rustのバージョンは"non-major"側。 運用としては二つのPRを**普段は保持し続け、更新可能ライブラリを把握する目 的に留める**。そして6週間おきのRustのリリースのタイミングで"non-major"の PRを「収穫」し、"major"の方はしかるべき機会が来たら収穫する。 このリポジトリにおいては懸念が一つあり、Gradle Wrapperのアップデートに失 敗してgradle-wrapper.jarを消し飛ばしたPRが生成されてしまう。ただどういう 感じの現象なのかまだ不明であるし、Gradle Wrapperのバージョンだけ手動で更 新すれば回避可能であると思われることから、このPRでは除外設定はしない。 Resolves #470. Co-authored-by: Hiroshiba --- renovate.json | 41 ----------------------- renovate.json5 | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 41 deletions(-) delete mode 100644 renovate.json create mode 100644 renovate.json5 diff --git a/renovate.json b/renovate.json deleted file mode 100644 index f56767ea0..000000000 --- a/renovate.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ], - "timezone": "Asia/Tokyo", - "packageRules": [ - { - "groupSlug": "rust", - "groupName": "Rust", - "matchPackagePatterns": [ - "^rust-lang/rust$" - ] - }, - { - "groupSlug": "others", - "groupName": "Others", - "matchPackagePatterns": [ - "*" - ], - "excludePackagePatterns": [ - "^rust-lang/rust$" - ], - "dependencyDashboardApproval": true - } - ], - "customManagers": [ - { - "customType": "regex", - "fileMatch": [ - "^rust-toolchain$" - ], - "matchStrings": [ - "(?\\d+\\.\\d+\\.\\d+)" - ], - "depNameTemplate": "Rust", - "packageNameTemplate": "rust-lang/rust", - "datasourceTemplate": "github-tags" - } - ] -} diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 000000000..6fc45ac18 --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,90 @@ +{ + $schema: "https://docs.renovatebot.com/renovate-schema.json", + extends: [ + "config:recommended", + ], + timezone: "Asia/Tokyo", + separateMajorMinor: false, + dependencyDashboardApproval: true, // 万が一`packageRules`の網羅性に穴ができた場合に備え + packageRules: [ + // `separateMajorMinor`を無効化した上で次の二つのgroupにすべてをまとめる。 + // + // * "major dependencies" (`renovate/major-dependencies`) + // * "non-major dependencies" (`renovate/non-major-dependencies`) + // + // バージョン0.y.z (y≧1)のyとバージョン0.0.zのzの変更は"major dependencies"の方に含むようにする。 + + // メジャーバージョンの更新 + { + groupName: "major dependencies", + matchUpdateTypes: [ + "major", + ], + dependencyDashboardApproval: false, + }, + { + groupName: "major dependencies", + matchUpdateTypes: [ + "minor", + ], + matchCurrentVersion: "/^v?0\\./", + dependencyDashboardApproval: false, + }, + { + groupName: "major dependencies", + matchUpdateTypes: [ + "patch", + ], + matchCurrentVersion: "/^v?0\\.0\\./", + dependencyDashboardApproval: false, + }, + + // メジャーバージョン以外の更新 + { + groupName: "non-major dependencies", + matchUpdateTypes: [ + "minor", + ], + matchCurrentVersion: "!/^v?0\\./", + dependencyDashboardApproval: false, + }, + { + groupName: "non-major dependencies", + matchUpdateTypes: [ + "patch", + ], + matchCurrentVersion: "!/^v?0\\.0\\./", + dependencyDashboardApproval: false, + }, + + // GHAのrunnerに対しては無効化する + { + matchDatasources: [ + "github-runners", + ], + matchPackageNames: [ + "windows", + "macos", + "ubuntu", + ], + enabled: false, + }, + ], + cargo: { + rangeStrategy: "bump", + }, + customManagers: [ + { + customType: "regex", + fileMatch: [ + "^rust-toolchain$", + ], + matchStrings: [ + "(?\\d+\\.\\d+\\.\\d+)", + ], + depNameTemplate: "Rust", + packageNameTemplate: "rust-lang/rust", + datasourceTemplate: "github-tags", + }, + ], +}