diff --git a/renovate-presets/default.json5 b/renovate-presets/default.json5 new file mode 100644 index 000000000..8aebdfb01 --- /dev/null +++ b/renovate-presets/default.json5 @@ -0,0 +1,148 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["group:monorepos"], + "dependencyDashboard": true, + "rangeStrategy": "replace", + + // Schedule Renovate to run during off-peak hours + "schedule": [ + "after 10:00pm every weekday", + "before 5:00am every weekday", + "every weekend" + ], + "prConcurrentLimit": 8, + "prHourlyLimit": 4, + "timezone": "America/Tijuana", + + // Commit and PR customization + "commitBody": "See associated pull request for more information.", + "semanticCommits": "enabled", + "semanticCommitScope": "", + "semanticCommitType": "build", + "labels": ["area: build & ci", "action: review"], + + "lockFileMaintenance": { + "enabled": true + }, + + // Ignored dependencies in all repositories + "ignoreDeps": [ + "build_bazel_rules_nodejs", + "rules_pkg" + ], + + "packageRules": [ + // ============================================================================ + // GENERAL GROUPING & UPDATE BEHAVIOR + // ============================================================================ + + // Group all non-major updates (minor and patch) together + { + "groupName": "all non-major dependencies", + "matchPackageNames": [ + "*", + "!node", + "!pnpm", + "!npm", + "!yarn" + ], + "matchUpdateTypes": ["digest", "patch", "minor"] + }, + + // ============================================================================ + // ECOSYSTEM-SPECIFIC GROUPING + // ============================================================================ + + // Group Bazel updates + { + "groupName": "bazel dependencies", + "matchManagers": ["bazel"] + }, + + // ============================================================================ + // DEPENDENCY-SPECIFIC UPDATE CONTROLS + // ============================================================================ + + // Group updates related to Angular ecosystem across repositories + { + "groupName": "cross-repo angular dependencies", + "followTag": "next", + "separateMajorMinor": false, + "schedule": ["at any time"], + "matchPackageNames": [ + "@angular-devkit/**", + "@angular/**", + "@schematics/**", + "angular/**", + "ng-packagr" + ] + }, + + // Disable 'next' tag tracking on non-main branches + { + "matchBaseBranches": ["!main"], + "followTag": null + }, + + // Keep minor and patch updates separate for TypeScript + { + "matchPackageNames": ["typescript"], + "separateMinorPatch": true + }, + + // Group TypeScript-related packages + { + "groupName": "typescript dependencies", + "matchPackageNames": ["typescript", "tslib"] + }, + + // Limit how many times these packages get updated (They deploy each merged PR) + { + "matchPackageNames": ["renovate", "quicktype-core"], + "schedule": ["on sunday and wednesday"] + }, + + // ============================================================================ + // WORKFLOW-SPECIFIC UPDATE RULES + // ============================================================================ + + // Group dependencies in the scorecard GitHub Actions workflow + { + "groupName": "scorecard action dependencies", + "matchFileNames": [".github/workflows/scorecard.yml"], + "matchPackageNames": ["*"] + }, + + // ============================================================================ + // EXCLUSION RULES + // ============================================================================ + + // Disable updates for placeholder or 0.0.0-style versions + { + "enabled": false, + "matchCurrentVersion": "/^[~^]?0\\.0\\.0-/" + }, + + // Disable major updates for specified dependencies + { + "enabled": false, + "matchPackageNames": [ + "@types/node", + "node", + "npm", + "pnpm", + "rxjs", + "tslib", + "yarn" + ], + "matchUpdateTypes": ["major"] + }, + + // Disable TypeScript major and minor updates + { + "enabled": false, + "matchPackageNames": ["typescript"], + "matchUpdateTypes": ["major", "minor"] + } + ] +} diff --git a/renovate.json b/renovate.json index bc6acb897..2540e5c20 100644 --- a/renovate.json +++ b/renovate.json @@ -1,82 +1,23 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "semanticCommits": "enabled", - "semanticCommitType": "build", - "semanticCommitScope": "", - "dependencyDashboard": true, - "automerge": false, - "separateMajorMinor": false, - "timezone": "America/Tijuana", - "labels": ["comp: build", "renovate managed", "action: merge"], - "keepUpdatedLabel": "renovate managed", - "rebaseWhen": "conflicted", - "lockFileMaintenance": { - "enabled": true - }, - "ignorePaths": ["bazel/integration/tests/**"], - "ignoreDeps": ["rules_pkg", "@angular-devkit/build-angular"], - "baseBranches": ["main"], + "extends": ["github>angular/dev-infra//renovate-presets/default.json5"], + "postUpgradeTasks": { "commands": [ - "git restore bazel/pnpm-lock.yaml", - "yarn install", + "git restore bazel/pnpm-lock.yaml .npmrc", + "yarn install --immutable", "yarn bazel sync --only=repo || true", "yarn update-generated-files" ], - "executionMode": "update" + "executionMode": "branch" }, + + "ignorePaths": ["bazel/integration/tests/**"], "packageRules": [ { - "matchDepNames": ["node"], - "matchUpdateTypes": ["minor", "patch"] - }, - { - "enabled": false, - "matchDepNames": ["node"], - "matchUpdateTypes": ["major"] - }, - { - "matchUpdateTypes": ["minor", "patch"], - "groupName": "all non-major dependencies", - "schedule": ["at any time"], - "matchPackageNames": ["*"] - }, - { - "groupName": "bazel setup", - "matchPackageNames": ["/^@bazel/.*/", "/^build_bazel.*/"] - }, - { - "groupName": "yarn", - "matchPackageNames": ["/yarn.*/"] - }, - { - "groupName": "octokit dependencies", - "matchPackageNames": ["@octokit/{/,}**"] - }, - { - "followTag": "next", - "groupName": "angular dependencies", - "matchPackageNames": ["@angular/{/,}**", "@angular-devkit{/,}**", "@schematics/{/,}**"] - }, - { - "matchPackageNames": "renovate", - "schedule": ["after 10:00pm", "before 5:00am"] - }, - { + "enabled": true, "matchPackageNames": ["typescript"], - "matchUpdateTypes": ["major"], - "enabled": false - }, - { - "matchPackageNames": ["@types/node"], - "matchUpdateTypes": ["major"], - "enabled": false - }, - { - "matchFileNames": [".github/workflows/scorecard.yml"], - "groupName": "scorecard action dependencies", - "groupSlug": "scorecard-action", - "matchPackageNames": ["*"] + "matchUpdateTypes": ["minor"] } ] }