By default, Dependabot opens a new pull request to update each dependency. When you enable security updates, new pull requests are opened when a vulnerable dependency is found. When you configure version updates for one or more ecosystems, new pull requests are opened when new versions of dependencies are available, with the frequency defined in the dependabot.yml file.
If your project has many dependencies, you might find that you have a very large number of Dependabot pull requests to review and merge, which can quickly become difficult to manage.
There are a couple of customization options you can implement to optimize Dependabot update pull requests to align with your processes, such as:
- Controlling the frequency with which Dependabot checks for newer versions of your dependencies with
schedule. - Prioritize meaningful updates with
groups.
Controlling the frequency and timings of dependency updates
Dependabot runs its checks for version updates at a frequency set by you in the configuration file, where the required field, schedule.interval, must be set to daily, weekly, monthly, quarterly, semiannually, yearly, or cron (see cronjob).
By default, Dependabot balances its workload by assigning a random time to check and raise pull requests for dependency updates.
However, to reduce distraction, or to better organize time and resources for reviewing and addressing version updates, you might find it useful to modify the frequency and timings. For example, you may prefer Dependabot to run weekly rather than daily checks for updates, and at a time that ensures pull requests are raised before for your team's triage session.
Modifying the frequency and timings for dependency updates
You can use schedule with a combination of options to modify the frequency and timings of when Dependabot checks for version updates.
The example dependabot.yml file below changes the npm configuration to specify that Dependabot should check for version updates to npm dependencies every Tuesday at 02:00 Japanese Standard Time (UTC +09:00).
# `dependabot.yml` file with
# customized schedule for version updates
version: 2
updates:
# Keep npm dependencies up to date
- package-ecosystem: "npm"
directory: "/"
# Check the npm registry every week on Tuesday at 02:00 Japan Standard Time (UTC +09:00)
schedule:
interval: "weekly"
day: "tuesday"
time: "02:00"
timezone: "Asia/Tokyo"
# `dependabot.yml` file with
# customized schedule for version updates
version: 2
updates:
# Keep npm dependencies up to date
- package-ecosystem: "npm"
directory: "/"
# Check the npm registry every week on Tuesday at 02:00 Japan Standard Time (UTC +09:00)
schedule:
interval: "weekly"
day: "tuesday"
time: "02:00"
timezone: "Asia/Tokyo"
See also schedule.
Setting up a cooldown period for dependency updates
You can use cooldown with a combination of options to control when Dependabot creates pull requests for version updates.
The example dependabot.yml file below shows a cooldown period being applied to the dependencies requests, numpy, and those prefixed with pandas or django, but not to the dependency called pandas (exact match), which is excluded via the exclude list.
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 5
semver-major-days: 30
semver-minor-days: 7
semver-patch-days: 3
include:
- "requests"
- "numpy"
- "pandas*"
- "django"
exclude:
- "pandas"
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 5
semver-major-days: 30
semver-minor-days: 7
semver-patch-days: 3
include:
- "requests"
- "numpy"
- "pandas*"
- "django"
exclude:
- "pandas"
- The number of cooldown days must be between 1 and 90.
- The maximum allowed items limit in
includeandexcludelists, which can be used withcooldown, is 150 each.
참고 항목
To consider all dependencies for a cooldown period, you can:
- Omit the
includeoption which applies cooldown to all dependencies. - Use
"*"inincludeto apply the cooldown settings to everything. We recommend the use ofexcludeto only exclude specific dependencies from cooldown settings.
SemVer is supported for most package managers. Updates to new versions for dependencies in cooldown are deferred as follows:
- Major updates: Delayed by 30 days (
semver-major-days: 30). - Minor updates: Delayed by 7 days (
semver-minor-days: 7). - Patch updates: Delayed by 3 days (
semver-patch-days: 3).
See also cooldown.
Prioritizing meaningful updates
You can use groups to consolidate updates for multiple dependencies into a single pull request. This helps you focus your review time on higher risk updates, and minimize the time spent reviewing minor version updates. For example, you can combine updates for minor or patch updates for development dependencies into a single pull request, and have a dedicated group for security or version updates that impact a key area of your codebase.
You must configure groups per individual package ecosystem, then you can create multiple groups per package ecosystem using a combination of criteria:
- Dependabot update type:
applies-to - Type of dependency:
dependency-type. - Dependency name:
patternsandexclude-patterns - Semantic versioning levels:
update-types
To see all supported values for each criterion, see groups.
The below examples present several different methods to create groups of dependencies using the criteria.
예제 1: 세 가지 버전 업데이트 그룹
이 예제에서 dependabot.yml 파일은 다음과 같습니다.
- "
production-dependencies", "development-dependencies", "rubocop"라는 세 개의 그룹을 만듭니다. patterns및dependency-type을(를) 사용하여 그룹의 종속성을 포함합니다.exclude-patterns을(를) 사용하여 그룹에서 종속성(또는 여러 종속성)을 제외합니다.
version: 2
updates:
# Keep bundler dependencies up to date
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "weekly"
groups:
production-dependencies:
dependency-type: "production"
development-dependencies:
dependency-type: "development"
exclude-patterns:
- "rubocop*"
rubocop:
patterns:
- "rubocop*"
결과적으로 다음이 수행됩니다.
- 버전 업데이트는 종속성 유형별로 그룹화됩니다.
- 패턴
rubocop*과(와) 일치하는 개발 종속성은development-dependencies그룹에서 제외됩니다. - 대신
rubocop*과(와) 일치하는 개발 종속성은rubocop그룹에 포함됩니다. 순서 지정으로 인해rubocop*과 일치하는 프로덕션 종속성이production-dependencies그룹에 포함됩니다. - 또한
applies-to키가 없기 때문에 모든 그룹은 기본적으로 버전 업데이트에만 적용됩니다.
예제 2: 제외된 종속성이 있는 그룹화된 업데이트
이 예제에서 dependabot.yml 파일은 다음과 같습니다.
- 사용자 지정된 번들러 구성의 일부로 "
support-dependencies" 라는 그룹을 만듭니다. - 종속성(하나 이상의 종속성)의 이름과 일치하는
patterns을(를) 사용하여 그룹에 종속성을 포함합니다. - 종속성(하나 이상의 종속성)의 이름과 일치하는
exclude-patterns을(를) 사용하여 그룹에서 종속성을 제외합니다. applies-to: version-updates가 사용되므로 그룹화를 버전 업데이트에만 적용합니다.
version: 2
updates:
# Keep bundler dependencies up to date
- package-ecosystem: "bundler"
directories:
- "/frontend"
- "/backend"
- "/admin"
schedule:
interval: "weekly"
# Create a group of dependencies to be updated together in one pull request
groups:
# Specify a name for the group, which will be used in pull request titles
# and branch names
support-dependencies:
# Define patterns to include dependencies in the group (based on
# dependency name)
applies-to: version-updates # Applies the group rule to version updates
patterns:
- "rubocop" # A single dependency name
- "rspec*" # A wildcard string that matches multiple dependency names
- "*" # A wildcard that matches all dependencies in the package
# ecosystem. Note: using "*" may open a large pull request
# Define patterns to exclude dependencies from the group (based on
# dependency name)
exclude-patterns:
- "gc_ruboconfig"
- "gocardless-*"
결과적으로 다음이 수행됩니다.
- 와일드카드("*") 패턴으로 인해 번들러에 대한 대부분의 종속성은
support-dependencies그룹으로 통합됩니다. gc_ruboconfig및gocardless-*와 일치하는 종속성은 그룹에서 제외되고, Dependabot은 이러한 종속성에 대한 단일 끌어오기 요청을 계속 발생시킵니다. 이러한 종속성에 대한 업데이트를 자세히 검토해야 하는 경우 이 기능이 유용할 수 있습니다.support-dependencies의 경우, Dependabot은 버전 업데이트에 대한 끌어오기 요청만 발생시킵니다.
예제 3: 주요 업데이트에 대한 개별 끌어오기 요청 및 부/패치 업데이트에 대한 그룹화
이 예제에서 dependabot.yml 파일은 다음과 같습니다.
- "
angular"라는 그룹을 만듭니다. - 종속성 이름과 일치하는
patterns을(를) 사용하여 그룹에 종속성을 포함합니다. update-type을 사용하여minor또는patch업데이트만 그룹에 포함합니다.applies-to: version-updates가 사용되므로 그룹화를 버전 업데이트에만 적용합니다.
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
# Specify a name for the group, which will be used in pull request titles
# and branch names
angular:
applies-to: version-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
결과적으로 다음이 수행됩니다.
- Dependabot은 부 또는 패치 업데이트가 있는 모든 Angular 종속성에 대해 그룹화된 끌어오기 요청을 만듭니다.
- 모든 주요 업데이트는 개별 끌어오기 요청을 통해 계속 발생합니다.
예제 4: 부/패치 업데이트에 대한 그룹화된 끌어오기 요청 및 주요 업데이트에 대한 끌어오기 요청 없음
이 예제에서 dependabot.yml 파일은 다음과 같습니다.
- "
angular" 및 "minor-and-patch"라는 두 개의 그룹을 만듭니다. applies-to를 사용하면 첫 번째 그룹은 버전 업데이트에만 적용되고 두 번째 그룹은 보안 업데이트에만 적용됩니다.update-type을(를) 사용하여 두 그룹 모두에 대해minor또는patch업데이트만 포함합니다.ignore조건을 사용하여@angular*패키지의major버전에 대한 업데이트를 제외합니다.
version: 2
updates:
# Keep npm dependencies up to date
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
angular:
applies-to: version-updates
patterns:
- "@angular*"
update-types:
- "minor"
- "patch"
minor-and-patch:
applies-to: security-updates
patterns:
- "@angular*"
update-types:
- "patch"
- "minor"
ignore:
- dependency-name: "@angular*"
update-types: ["version-update:semver-major"]
결과적으로 다음이 수행됩니다.
- Angular 종속성에 대한 부 버전 및 패치 버전 업데이트는 단일 끌어오기 요청으로 그룹화됩니다.
- Angular 종속성에 대한 부 및 패치 보안 업데이트도 단일 끌어오기 요청으로 그룹화됩니다.
- Dependabot은 Angular에 대한 주 업데이트에 대한 끌어오기 요청을 자동으로 열지 않습니다.