From 512434d9a8c332a7a1dfbafad09b34c1954179a9 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 12 Dec 2024 09:48:24 -0500 Subject: [PATCH] ci: use starflow renovate config (#260) * ci: use starflow renovate config * ci: print renovate config in renovate job * ci: iterate * fix: better renovate dry-run --- .github/renovate.json5 | 219 +------------------------- .github/workflows/check-renovate.yaml | 4 +- 2 files changed, 3 insertions(+), 220 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index f588fef..205663f 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,220 +1,3 @@ { - extends: [ - 'config:recommended', - ':semanticCommitTypeAll(build)', - ':enablePreCommit', - ], - labels: [ - 'dependencies', - ], - baseBranches: [ - '$default', - '/^hotfix\\/.*/', - ], - pip_requirements: { - fileMatch: [ - '^tox.ini$', - '(^|/)requirements([\\w-]*)\\.txt$', - ], - }, - packageRules: [ - { - groupName: 'internal package minor releases', - matchUpdateTypes: [ - 'minor', - 'patch', - 'pin', - 'digest', - ], - prPriority: 10, - automerge: true, - minimumReleaseAge: '0 seconds', - schedule: [ - 'at any time', - ], - matchBaseBranches: [ - '$default', - ], - matchPackageNames: [ - '/^craft-.*/', - ], - }, - { - groupName: 'internal package patch releases (hotfix)', - matchUpdateTypes: [ - 'patch', - 'pin', - 'digest', - ], - prPriority: 10, - minimumReleaseAge: '0 seconds', - schedule: [ - 'at any time', - ], - matchBaseBranches: [ - '/^hotfix\\/.*/', - ], - matchPackageNames: [ - '/^craft-.*/', - ], - }, - { - groupName: 'bugfixes', - matchUpdateTypes: [ - 'patch', - 'pin', - 'digest', - ], - prPriority: 3, - automerge: true, - matchDepNames: [ - '!/lint/.*/', - '!/types/.*/', - '!/pyright/', - ], - }, - { - groupName: 'internal packages', - matchCategories: [ - 'python', - ], - prPriority: 2, - matchBaseBranches: [ - '$default', - ], - matchDepNames: [ - '/craft-.*/', - '/snap-.*/', - ], - }, - { - groupName: 'GitHub Actions', - matchManagers: [ - 'github-actions', - ], - prPriority: 1, - automerge: true, - }, - { - groupName: 'pydantic etc.', - matchBaseBranches: [ - '$default', - ], - matchPackageNames: [ - '/^pydantic/', - ], - }, - { - groupName: 'development dependencies (non-major)', - groupSlug: 'dev-dependencies', - matchUpdateTypes: [ - 'minor', - 'patch', - 'pin', - 'digest', - ], - prPriority: -1, - automerge: true, - matchBaseBranches: [ - '$default', - ], - matchDepNames: [ - '/dev/.*/', - '/lint/.*/', - '/types/.*/', - ], - matchPackageNames: [ - '/^(.*/)?autoflake$/', - '/^(.*/)?black$/', - '/^(.*/)?codespell$/', - '/^(.*/)?coverage$/', - '/^(.*/)?flake8$/', - '/^(.*/)?hypothesis$/', - '/^(.*/)?mypy$/', - '/^(.*/)?pycodestyle$/', - '/^(.*/)?docstyle$/', - '/^(.*/)?pyfakefs$/', - '/^(.*/)?pyflakes$/', - '/^(.*/)?pylint$/', - '/^(.*/)?pytest/', - '/^(.*/)?responses$/', - '/^(.*/)?ruff$/', - '/^(.*/)?twine$/', - '/^(.*/)?tox$/', - '/^(.*/)?types-/', - ], - }, - { - groupName: 'documentation dependencies', - groupSlug: 'doc-dependencies', - matchPackageNames: [ - 'Sphinx', - 'furo', - '/[Ss]phinx.*$/', - ], - matchBaseBranches: [ - '$default', - ], - matchDepNames: [ - '/docs/.*/', - ], - }, - { - matchUpdateTypes: [ - 'major', - ], - prPriority: -2, - matchBaseBranches: [ - '$default', - ], - }, - { - groupName: 'development dependencies (major versions)', - groupSlug: 'dev-dependencies', - matchDepTypes: [ - 'devDependencies', - ], - matchUpdateTypes: [ - 'major', - ], - prPriority: -3, - matchBaseBranches: [ - '$default', - ], - }, - { - matchPackageNames: [ - 'pyright', - 'types/pyright', - ], - prPriority: -4, - matchBaseBranches: [ - '$default', - ], - }, - ], - customManagers: [ - { - fileMatch: [ - 'tox.ini', - ], - customType: 'regex', - depTypeTemplate: 'devDependencies', - matchStrings: [ - '# renovate: datasource=(?\\S+)\n\\s+(?.*?)(\\[[\\w]*\\])*[=><]=?(?.*?)\n', - ], - }, - ], - timezone: 'Etc/UTC', - schedule: [ - 'every weekend', - ], - prConcurrentLimit: 2, - branchConcurrentLimit: 20, - prCreation: 'not-pending', - prNotPendingHours: 4, - prHourlyLimit: 1, - minimumReleaseAge: '2 days', - automergeStrategy: 'squash', - semanticCommitType: 'build', + extends: ["github>canonical/starflow:renovate-base.json5"], } diff --git a/.github/workflows/check-renovate.yaml b/.github/workflows/check-renovate.yaml index 7d13cfb..efbe384 100644 --- a/.github/workflows/check-renovate.yaml +++ b/.github/workflows/check-renovate.yaml @@ -25,7 +25,7 @@ jobs: with: node-version: 22 - name: Install renovate - run: npm install --global renovate + run: npm install --global re2 renovate - name: Enable ssh access uses: mxschmitt/action-tmate@v3 if: ${{ inputs.enable_ssh_access }} @@ -34,7 +34,7 @@ jobs: - name: Check renovate config run: renovate-config-validator .github/renovate.json5 - name: Renovate dry-run - run: renovate --dry-run --autodiscover + run: renovate --dry-run=full --autodiscover --print-config env: RENOVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }} RENOVATE_USE_BASE_BRANCH_CONFIG: ${{ github.ref }}