From 28336bc2f42786ff71a2189eb8020402eedd437e Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 21 Jun 2023 20:23:56 -0400 Subject: [PATCH] Merge upstream/renovate/renovatebot-github-action-38.x --- .github/renovate-config.js | 81 +---------------------------- .github/renovate.json5 | 94 +++++++++++++++++++++++++++++++++- .github/workflows/renovate.yml | 3 +- 3 files changed, 97 insertions(+), 81 deletions(-) diff --git a/.github/renovate-config.js b/.github/renovate-config.js index 9a481beed88a6..4bbc8466bb652 100644 --- a/.github/renovate-config.js +++ b/.github/renovate-config.js @@ -38,10 +38,6 @@ module.exports = { platform: 'github', repositories: [ 'Automattic/jetpack' ], - // We're including configuration in this file. - onboarding: false, - requireConfig: 'optional', - // Extra code to run before creating a commit. allowPostUpgradeCommandTemplating: true, allowedPostUpgradeCommands: [ monorepoBase + '.github/files/renovate-post-upgrade-run.sh' ], @@ -53,15 +49,8 @@ module.exports = { }, postUpdateOptions: [ 'pnpmDedupe' ], - // This is the renovate configuration. - extends: [ 'config:base', 'group:definitelyTyped' ], - labels: [ '[Type] Janitorial', '[Status] Needs Review' ], - prHourlyLimit: 1, - timezone: 'UTC', - schedule: [ 'before 3am on the first day of the month' ], - updateNotScheduled: false, - semanticCommits: 'disabled', - osvVulnerabilityAlerts: true, + // Most of the actual renovate configuration is in renovate.json5, except for a few things + // where we want to read part of it from somewhere else. constraints: { php: `~${ versions.PHP_VERSION }.0`, }, @@ -95,71 +84,5 @@ module.exports = { } )(), enabled: false, }, - - // We need to keep a wide version range to support PHP 5.6. - // Note for libraries used in plugins this will only work right for require-dev deps, not require. - { - matchPackageNames: [ - 'johnkary/phpunit-speedtrap', - 'symfony/console', - 'symfony/process', - 'wikimedia/at-ease', - 'wikimedia/testing-access-wrapper', - ], - rangeStrategy: 'widen', - }, - - // Various other monorepos and package groupings. - { - extends: [ 'monorepo:wordpress' ], - separateMajorMinor: false, - prPriority: 1, - }, - { - extends: [ 'monorepo:react' ], - }, - { - extends: [ 'packages:eslint' ], - groupName: 'Eslint packages', - }, - { - extends: [ 'packages:jsUnitTest' ], - groupName: 'JS unit testing packages', - }, - { - groupName: 'Size-limit', - matchPackageNames: [ 'size-limit', '@size-limit/preset-app' ], - }, - // These aren't a monorepo, but we may as well do them all together anyway. - { - groupName: 'GitHub API packages', - matchPackagePatterns: [ '^@actions/', '^@octokit/' ], - }, - - // 🤷 - { - groupName: 'Instant Search Dependency Updates', - matchPackageNames: [ - 'cache', - 'preact', - 'progress-event', - 'q-flat', - 'qss', - 'strip', - 'uuid', - '@testing-library/preact', - ], - reviewers: [ 'team:jetpack-search' ], - addLabels: [ 'Search', 'Instant Search' ], - }, ], - lockFileMaintenance: { - enabled: true, - schedule: [ 'before 3:00 am on Monday on the 7th through 13th day of the month' ], - }, - dependencyDashboard: true, - dependencyDashboardTitle: 'Renovate Dependency Updates', - dependencyDashboardLabels: [ 'Primary Issue', '[Type] Janitorial' ], - dependencyDashboardFooter: - 'The bot runs every two hours, and may be monitored or triggered ahead of schedule [here](https://github.com/Automattic/jetpack/actions/workflows/renovate.yml).', }; diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 20af4313f4399..9a140a048b0fa 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,7 +1,16 @@ { + extends: [ 'config:base', 'group:definitelyTyped' ], + labels: [ '[Type] Janitorial', '[Status] Needs Review' ], + prHourlyLimit: 1, + timezone: 'UTC', + schedule: [ 'before 3am on the first day of the month' ], + updateNotScheduled: false, + semanticCommits: 'disabled', + osvVulnerabilityAlerts: true, + // Note: constraints.php is set in renovate-config.js where we can read it in code. + // Paths and files for renovate to ignore. // We have to override this because the default from config:base catches projects/plugins/*/tests/e2e/package.json which we do want processed. - // We have to do it here rather than renovate-config.js because `extends` and `globalExtends` both somehow overwrite it when defined there, even with `ignorePresets`. ignorePresets: [ ':ignoreModulesAndTests' ], ignorePaths: [ '**/node_modules/**', @@ -12,4 +21,87 @@ '**/tests/!(e2e)/**', '**/__fixtures__/**', ], + + packageRules: [ + // Monorepo packages are excluded in renovate-config.js, where we can read + // the list of them in code. + + // We need to keep a wide version range to support PHP 5.6. + // Note for libraries used in plugins this will only work right for require-dev deps, not require. + { + matchPackageNames: [ + 'johnkary/phpunit-speedtrap', + 'symfony/console', + 'symfony/process', + 'wikimedia/at-ease', + 'wikimedia/testing-access-wrapper', + ], + rangeStrategy: 'widen', + }, + + // Various other monorepos and package groupings. + { + extends: [ 'monorepo:wordpress' ], + separateMajorMinor: false, + prPriority: 1, + }, + { + extends: [ 'monorepo:react' ], + }, + { + extends: [ 'packages:eslint' ], + groupName: 'Eslint packages', + }, + { + extends: [ 'packages:jsUnitTest' ], + groupName: 'JS unit testing packages', + }, + { + groupName: 'Size-limit', + matchPackageNames: [ 'size-limit', '@size-limit/preset-app' ], + }, + // These aren't a monorepo, but we may as well do them all together anyway. + { + groupName: 'GitHub API packages', + matchPackagePatterns: [ '^@actions/', '^@octokit/' ], + }, + + // 🤷 + { + groupName: 'Instant Search Dependency Updates', + matchPackageNames: [ + 'cache', + 'preact', + 'progress-event', + 'q-flat', + 'qss', + 'strip', + 'uuid', + '@testing-library/preact', + ], + reviewers: [ 'team:jetpack-search' ], + addLabels: [ 'Search', 'Instant Search' ], + }, + ], + + regexManagers: [ + // Update the renovate-version in the action itself. + // See also https://github.com/renovatebot/github-action/issues/756 + { + fileMatch: [ '^\\.github/workflows/renovate\\.yml$' ], + matchStrings: [ 'renovate-version: (?[^\\s]+)' ], + datasourceTemplate: 'docker', + depNameTemplate: 'renovate', + packageNameTemplate: 'ghcr.io/renovatebot/renovate', + }, + ], + + lockFileMaintenance: { + enabled: true, + schedule: [ 'before 3:00 am on Monday on the 7th through 13th day of the month' ], + }, + dependencyDashboard: true, + dependencyDashboardTitle: 'Renovate Dependency Updates', + dependencyDashboardLabels: [ 'Primary Issue', '[Type] Janitorial' ], + dependencyDashboardFooter: 'The bot runs every two hours, and may be monitored or triggered ahead of schedule [here](https://github.com/Automattic/jetpack/actions/workflows/renovate.yml).', } diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index ca9461caf97aa..b76a810d5a94d 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -35,10 +35,11 @@ jobs: TOKEN: ${{ secrets.RENOVATE_TOKEN }} run: | curl --no-progress-meter --header "Authorization: Bearer $TOKEN" https://api.github.com/rate_limit - - uses: renovatebot/github-action@v34.154.2 + - uses: renovatebot/github-action@v38.1.7 with: configurationFile: /tmp/monorepo/.github/renovate-config.js token: ${{ secrets.RENOVATE_TOKEN }} + renovate-version: 35.140.0 env: LOG_LEVEL: ${{ github.event.inputs.logLevel || 'debug' }} RENOVATE_DRY_RUN: ${{ github.event.inputs.dryRun == 'no' && 'null' || github.event.inputs.dryRun || 'null' }}