From 794f4599c869ddbc641d62474918dff6791796eb Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 8 Aug 2024 19:24:18 -0400 Subject: [PATCH 1/8] ci(renovate): enable hotfix branch patch updates This lets Renovate update patch dependencies on hotfix branches. --- .github/renovate.json5 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 9dcf214..70c6ae4 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -2,19 +2,21 @@ // Configuration file for RenovateBot: https://docs.renovatebot.com/configuration-options extends: ["config:base"], labels: ["dependencies"], // For convenient searching in GitHub + baseBranches: ["$default", "/^hotfix\\/.*/"], pip_requirements: { fileMatch: ["^tox.ini$", "(^|/)requirements([\\w-]*)\\.txt$", "^.pre-commit-config.yaml$"] }, packageRules: [ { // Internal package minor patch updates get top priority, with auto-merging - groupName: "internal package patch releases", + groupName: "internal package minor releases", matchPackagePatterns: ["^craft-.*"], matchUpdateTypes: ["minor", "patch", "pin", "digest"], prPriority: 10, automerge: true, minimumReleaseAge: "0 seconds", schedule: ["at any time"], + matchBaseBranches: ["$default"], // Only do minor releases on main }, { // Same as above, but for hotfix branches, only for patch, and without auto-merging. @@ -40,7 +42,8 @@ groupName: "internal packages", matchDepPatterns: ["craft-.*", "snap-.*"], matchLanguages: ["python"], - prPriority: 2 + prPriority: 2, + matchBaseBranches: ["$default"], // Not for hotfix branches }, { // GitHub Actions are higher priority to update than most dependencies since they don't tend to break things. @@ -75,11 +78,13 @@ matchPackageNames: ["Sphinx", "furo"], matchPackagePatterns: ["[Ss]phinx.*$"], matchDepPatterns: ["docs/.*"], + matchBaseBranches: ["$default"], // Not for hotfix branches }, { // Other major dependencies get deprioritised below minor dev dependencies. matchUpdateTypes: ["major"], - prPriority: -2 + prPriority: -2, + matchBaseBranches: ["$default"], // Not for hotfix branches }, { // Major dev dependencies are stone last, but grouped. @@ -87,13 +92,15 @@ groupSlug: "dev-dependencies", matchDepTypes: ["devDependencies"], matchUpdateTypes: ["major"], - prPriority: -3 + prPriority: -3, + matchBaseBranches: ["$default"], // Not for hotfix branches }, { // Pyright makes regular breaking changes in patch releases, so we separate these // and do them independently. matchPackageNames: ["pyright", "types/pyright"], - prPriority: -4 + prPriority: -4, + matchBaseBranches: ["$default"], // Not for hotfix branches } ], regexManagers: [ From 062e4d8152895639592d4948c687315cd52fc201 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 8 Aug 2024 19:29:39 -0400 Subject: [PATCH 2/8] ci: update renovate checker --- .github/workflows/check-renovate.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-renovate.yaml b/.github/workflows/check-renovate.yaml index 8da9f2b..7d13cfb 100644 --- a/.github/workflows/check-renovate.yaml +++ b/.github/workflows/check-renovate.yaml @@ -20,6 +20,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: 22 - name: Install renovate run: npm install --global renovate - name: Enable ssh access From 734ed64c71978752ae8942b6085cd5b68cd55091 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 8 Aug 2024 19:37:34 -0400 Subject: [PATCH 3/8] ci: update renovate to recommended config base --- .github/renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 70c6ae4..2238909 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,6 +1,6 @@ { // Configuration file for RenovateBot: https://docs.renovatebot.com/configuration-options - extends: ["config:base"], + extends: ["config:recommended"], labels: ["dependencies"], // For convenient searching in GitHub baseBranches: ["$default", "/^hotfix\\/.*/"], pip_requirements: { From 442a24be9274bb81005d57f3a9eef691e7e10d8b Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 8 Aug 2024 19:42:33 -0400 Subject: [PATCH 4/8] ci: update renovate config from validator recommends https://github.com/canonical/starbase/actions/runs/10311070189/job/28543952797?pr=232 --- .github/renovate.json5 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 2238909..16e7b16 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -41,7 +41,7 @@ // Update all internal packages in one higher-priority PR groupName: "internal packages", matchDepPatterns: ["craft-.*", "snap-.*"], - matchLanguages: ["python"], + matchCategories: ["python"], prPriority: 2, matchBaseBranches: ["$default"], // Not for hotfix branches }, @@ -103,10 +103,11 @@ matchBaseBranches: ["$default"], // Not for hotfix branches } ], - regexManagers: [ + customManagers: [ { // tox.ini can get updates too if we specify for each package. fileMatch: ["tox.ini"], + customType: "regex", depTypeTemplate: "devDependencies", matchStrings: [ "# renovate: datasource=(?\\S+)\n\\s+(?.*?)(\\[[\\w]*\\])*[=><]=?(?.*?)\n" @@ -115,6 +116,7 @@ { // .pre-commit-config.yaml version updates fileMatch: [".pre-commit-config.yaml"], + customType: "regex", datasourceTemplate: "pypi", depTypeTemplate: "lint", matchStrings: [ @@ -129,7 +131,7 @@ prCreation: "not-pending", // Wait until status checks have completed before raising the PR prNotPendingHours: 4, // ...unless the status checks have been running for 4+ hours. prHourlyLimit: 1, // No more than 1 PR per hour. - stabilityDays: 2, // Wait 2 days from release before updating. + minimumReleaseAge: "2 days", automergeStrategy: "squash", // Squash & rebase when auto-merging. semanticCommitType: "build" // use `build` as commit header type (i.e. `build(deps): `) } From c48436b2992dce7cb2e23921eaed159f37ffdbd4 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 8 Aug 2024 20:03:47 -0400 Subject: [PATCH 5/8] ci: bring updates from charmcraft --- .github/renovate.json5 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 16e7b16..c9b6cef 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -67,6 +67,23 @@ "lint/.*", "types/.*" ], + matchPackagePatterns: [ + // Brought from charmcraft. May not be complete. + // This helps group dependencies in requirements-dev.txt files. + "^(.*/)?autoflake$", + "^(.*/)?black$", + "^(.*/)?flake8$", + "^(.*/)?hypothesis$", + "^(.*/)?pycodestyle$", + "^(.*/)?pyfakefs$", + "^(.*/)?pyflakes$", + "^(.*/)?pylint$", + "^(.*/)?pytest", + "^(.*/)?responses$", + "^(.*/)?ruff$", + "^(.*/)?twine$", + "^(.*/)?types-" + ], matchUpdateTypes: ["minor", "patch", "pin", "digest"], prPriority: -1, automerge: true From 4beb6014b2fbc716fd58e82da54f59cb416ea1ff Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 9 Aug 2024 11:58:31 -0400 Subject: [PATCH 6/8] chore: semanticCommitTypeAll https://docs.renovatebot.com/semantic-commits/#changing-the-semantic-commit-type Co-authored-by: Callahan --- .github/renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index c9b6cef..db0ea97 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,6 +1,6 @@ { // Configuration file for RenovateBot: https://docs.renovatebot.com/configuration-options - extends: ["config:recommended"], + extends: ["config:recommended", ":semanticCommitTypeAll(build)"], labels: ["dependencies"], // For convenient searching in GitHub baseBranches: ["$default", "/^hotfix\\/.*/"], pip_requirements: { From 10c3ad861c3bf6c572404a60c8fe7367d7c60786 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 8 Aug 2024 20:20:24 -0400 Subject: [PATCH 7/8] ci: update renovate config from craft-parts --- .github/renovate.json5 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index db0ea97..d80e69e 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -72,9 +72,13 @@ // This helps group dependencies in requirements-dev.txt files. "^(.*/)?autoflake$", "^(.*/)?black$", + "^(.*/)?codespell$", + "^(.*/)?coverage$", "^(.*/)?flake8$", "^(.*/)?hypothesis$", + "^(.*/)?mypy$", "^(.*/)?pycodestyle$", + "^(.*/)?docstyle$", "^(.*/)?pyfakefs$", "^(.*/)?pyflakes$", "^(.*/)?pylint$", @@ -82,7 +86,8 @@ "^(.*/)?responses$", "^(.*/)?ruff$", "^(.*/)?twine$", - "^(.*/)?types-" + "^(.*/)?tox$", + "^(.*/)?types-", ], matchUpdateTypes: ["minor", "patch", "pin", "digest"], prPriority: -1, From 82f45661041efc71fc78e3ce01f4c3081840b6c9 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 9 Aug 2024 12:01:10 -0400 Subject: [PATCH 8/8] chore: fix hotfix branch mach --- .github/renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index d80e69e..8342105 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -26,7 +26,7 @@ prPriority: 10, minimumReleaseAge: "0 seconds", schedule: ["at any time"], - matchBaseBranches: ["/^hotfix/.*/"], // All hotfix branches + matchBaseBranches: ["/^hotfix\\/.*/"], // All hotfix branches }, { // Automerge patches, pin changes and digest changes.