This document compares two approaches for configuring Renovate: centralized configuration and per-repository configuration. Both approaches have distinct advantages and drawbacks, and the best choice depends on your team’s needs and the structure of your repositories.
Centralized configuration allows you to define Renovate settings in one place, which applies across multiple repositories. This method is ideal for teams that need consistent behavior across repositories, reducing the need for repeated configuration and simplifying maintenance.
{
"packageRules": [
{
"matchDatasources": [
"terraform-provider"
],
"registryUrls": [
"https://registry.opentofu.org"
],
"postUpgradeTasks": {
"commands": [
"./scripts/update-terraform-docs.sh"
],
"fileFilters": [
"modules/**/*"
],
"executionMode": "update"
}
}
]
}
modules/**/*
), which might not always be the case.Per-repository configuration allows each repository to have its own renovate.json
file with custom settings. This approach is beneficial when individual repositories require unique tasks, scripts, or behaviors that can’t be generalized.
{
"packageRules": [
{
"matchDatasources": [
"terraform-provider"
],
"registryUrls": [
"https://registry.opentofu.org"
],
"postUpgradeTasks": {
"commands": [
"./scripts/update-terraform-docs.sh"
],
"fileFilters": [
"modules/**/*"
],
"executionMode": "update"
}
}
]
}
Aspect | Centralized Configuration | Per-Repository Configuration |
---|---|---|
Maintenance | Easier to maintain due to a single configuration. | Requires maintaining separate files for each repository. |
Flexibility | Less flexible, as all repositories share the same behavior. | Highly flexible, allowing for tailored behavior per repository. |
Consistency | Ensures consistent behavior across repositories. | Potential for inconsistencies across repositories. |
Scalability | Scales well for repositories with similar requirements. | More difficult to scale due to the need for individual configurations. |
Carefully consider the structure of your repositories and your team’s workflows to decide which configuration approach aligns best with your needs.