SOP(Standard Operating Procedure) for Handling Dependabot PRs

2025-02-03 hit count image

Learn about risk classification criteria and handling methods for efficiently processing Dependabot-generated PRs in a Monorepo environment.

github_actions

Overview

When developing in a Monorepo environment, you need to manage many dependency libraries. By using GitHub’s Dependabot, you can automatically detect dependency library updates and create PRs.

However, as the number of PRs generated by Dependabot increases, it becomes difficult to determine which PRs should be processed first and which tests should be performed.

In this blog post, we will learn about the Standard Operating Procedure (SOP) for efficiently processing Dependabot-generated PRs.

PR Classification

Basic Classification Criteria

To handle Dependabot PRs, you first need to understand the risk level of each library. You can use the following table to classify the risk level of libraries.

CriteriaHigh RiskMedium RiskLow Risk
Production RuntimeO (Runtime)△ (Partial Runtime)X (devDependency)
Scope of ImpactAll AppsSpecific Features/AppsDevelopment Only
Issue DetectionManual Test NeededPartially CI DetectableFully CI Detectable
User ImpactDirectIndirectNone

Risk Adjustment by Version

You can adjust the risk based on the library category and the type of version being updated.

Library CategoryMajorMinorPatch
High Risk (react, etc.)🔴 High🟡 Med🟡 Med
Medium Risk Runtime (axios)🟡 Med🟡 Med🟢 Low
Medium Risk CI Detectable (vite)🟡 Med🟢 Low🟢 Low
Low Risk Runtime (lodash)🟡 Med🟢 Low🟢 Low
Low Risk Dev Tools (@types)🟢 Low🟢 Low🟢 Low

Classification Flowchart

Using the basic classification criteria and version-based risk adjustment, you can create the following flowchart. This flowchart makes it easy to classify when adding new libraries or reviewing Dependabot PRs.

Adding a New Library


┌───────────────────────────────────┐
│ 1. Used in Production (Runtime)?  │
└───────────────────────────────────┘

    ┌───┴───┐
    │       │
   Yes      No → Low Risk (Dev Tool)


┌───────────────────────────────────┐
│ 2. Affects All Apps?              │
└───────────────────────────────────┘

    ┌───┴───┐
    │       │
   Yes      No → Check Scope
    │            │
    │            ▼
    │       Specific App → Medium Risk (Runtime)
    │                      or
    │                      Low Risk (Runtime)

┌───────────────────────────────────┐
│ 3. CI Detectable?                 │
└───────────────────────────────────┘

    ┌───┴───┐
    │       │
   Yes      No → High Risk


Medium Risk (CI Detectable)

High Risk

High-risk libraries have the following characteristics:

  • Direct impact on production (runtime)
  • Affects all apps
  • Manual testing required

Target Libraries

LibraryVersionDescriptionImpact
reactMajorUI Framework CoreAffects All Apps
react-domMajorReact DOM RendererAffects All Apps
@reduxjs/toolkitMajorState Management CoreAffects All Apps on API Change
react-reduxMajorRedux BindingAffects State Management
react-router-domMajorRouting SystemAffects Navigation

Handling Method

  1. Verify CI passes (run all tests)
  2. Check CHANGELOG and Breaking Changes
  3. Check migration guide (if applicable)
  4. Test all apps and team member review

Medium Risk

Medium-risk libraries have the following characteristics:

  • Partial impact on production (runtime)
  • Detectable in build (CI)

Target Libraries

Minor, Patch Updates of High-Risk Libraries

LibraryVersionDescriptionImpact
reactMinor, PatchUI Framework CoreAffects All Apps
react-domMinor, PatchReact DOM RendererAffects All Apps
@reduxjs/toolkitMinor, PatchState Management CoreAffects All Apps on API Change
react-reduxMinor, PatchRedux BindingAffects State Management
react-router-domMinor, PatchRouting SystemAffects Navigation

Major Updates of CI Detectable (Build/Test/Lint)

LibraryVersionDescriptionImpact
viteMajorBuild ToolAll App Build
typescriptMajorType SystemAll App Build
@vitejs/plugin-reactMajorVite React PluginAll App Build
turboMajorMonorepo Build ToolCI/CD
jestMajorTest FrameworkAll App Tests
vitestMajorTest FrameworkAll App Tests
@playwright/testMajorE2E TestingE2E Tests
eslintMajorLinterCode Quality
@typescript-eslint/*MajorTypeScript ESLintCode Quality
storybookMajorComponent Docscomponents Package
@storybook/*MajorStorybook Relatedcomponents Package

Major, Minor Updates with Runtime Impact

LibraryVersionDescriptionImpact
axiosMajor, MinorHTTP ClientAll App API Calls
i18nextMajor, Minori18n SupportAll App i18n Parts
react-i18nextMajor, MinorReact i18n BindingAll App i18n Parts
konvaMajor, MinorCanvas LibrarySpecific Apps Only
react-konvaMajor, MinorKonva React BindingSpecific Apps Only
rechartsMajor, MinorChart LibrarySpecific Apps Only

Major Updates of Low-Risk Runtime Utilities

LibraryVersionDescriptionImpact
lodashMajorUtilityUsed in Production
js-cookieMajorCookie UtilityUsed in Production
date-fnsMajorDate UtilityUsed in Production
clsxMajorClassName UtilityUsed in Production
react-ga4MajorGoogle AnalyticsSome Apps Only
qrcode.reactMajorQR Code GenerationSpecific Apps Only
react-hotkeys-hookMajorKeyboard ShortcutsSpecific Apps Only
papaparseMajorCSV Parsingcomponents Only

Handling Method

  1. Verify CI passes (run all tests / specific app tests)
  2. Check CHANGELOG
  3. Test affected apps and team member review

You can check affected apps with the yarn why <package> command.

Low Risk

Low-risk libraries have the following characteristics:

  • Development tools
  • Directly detectable in CI
  • No impact on users

Target Libraries

Minor, Patch Updates of CI Detectable (Build/Test/Lint)

LibraryVersionDescriptionImpact
viteMinor, PatchBuild ToolAll App Build
typescriptMinor, PatchType SystemAll App Build
@vitejs/plugin-reactMinor, PatchVite React PluginAll App Build
turboMinor, PatchMonorepo Build ToolCI/CD
jestMinor, PatchTest FrameworkAll App Tests
vitestMinor, PatchTest FrameworkAll App Tests
@playwright/testMinor, PatchE2E TestingE2E Tests
eslintMinor, PatchLinterCode Quality
@typescript-eslint/*Minor, PatchTypeScript ESLintCode Quality
storybookMinor, PatchComponent Docscomponents Package
@storybook/*Minor, PatchStorybook Relatedcomponents Package

Patch Updates with Runtime Impact

LibraryVersionDescriptionImpact
axiosPatchHTTP ClientAll App API Calls
i18nextPatchi18n SupportAll App i18n Parts
react-i18nextPatchReact i18n BindingAll App i18n Parts
konvaPatchCanvas LibrarySpecific Apps Only
react-konvaPatchKonva React BindingSpecific Apps Only
rechartsPatchChart LibrarySpecific Apps Only

Pure Development Tools (All Versions)

LibraryVersionDescriptionImpact
@types/*Major, Minor, PatchType DefinitionsDev Only
prettierMajor, Minor, PatchCode FormatterDev Only
stylelintMajor, Minor, PatchStyle LinterDev Only
eslint-config-*Major, Minor, PatchESLint ConfigDev Only
eslint-plugin-*Major, Minor, PatchESLint PluginsDev Only
@testing-library/*Major, Minor, PatchTest UtilitiesTest Only
ts-jestMajor, Minor, PatchJest TypeScriptTest Only
@vitest/uiMajor, Minor, PatchVitest UITest Only
sassMajor, Minor, PatchSCSS CompilerBuild Only
huskyMajor, Minor, PatchGit HooksDev Only
lint-stagedMajor, Minor, PatchStaged File LintDev Only
remark-*Major, Minor, PatchMarkdown LintDev Only
cspellMajor, Minor, PatchSpell CheckDev Only
chromaticMajor, Minor, PatchVisual Testingcomponents Only

Minor, Patch Updates of Low-Risk Runtime Utilities

LibraryVersionDescriptionImpact
lodashMinor, PatchUtilityUsed in Production
js-cookieMinor, PatchCookie UtilityUsed in Production
date-fnsMinor, PatchDate UtilityUsed in Production
clsxMinor, PatchClassName UtilityUsed in Production
react-ga4Minor, PatchGoogle AnalyticsSome Apps Only
qrcode.reactMinor, PatchQR Code GenerationSpecific Apps Only
react-hotkeys-hookMinor, PatchKeyboard ShortcutsSpecific Apps Only
papaparseMinor, PatchCSV Parsingcomponents Only

Handling Method

  1. Verify CI passes
  2. Review by auto-assigned member

Processing Schedule

To efficiently process PRs for the classified library version updates, you can create the following weekly schedule.

DayTask
MondayCheck Dependabot PRs, Assign Reviewers
Tuesday~WednesdayMerge Low/Medium Risk PRs
Thursday~FridayReview and Test High Risk PRs

This schedule can be adjusted according to your team’s situation.

Priority Guidelines

While it’s ideal to process all PRs quickly, when resources are limited, you need to set priorities. For example, you can use the following guidelines:

  • Patch: Process when 5 or more accumulate (handle security vulnerabilities immediately)
  • Minor: Process when 2 or more accumulate (handle security vulnerabilities immediately)
  • Major: Process after team discussion

Conclusion

This concludes our look at risk classification criteria for efficiently processing Dependabot PRs.

In the next post, we will learn about Dependabot configuration and automation methods using GitHub Actions based on these classification criteria.

Was my blog helpful? Please leave a comment at the bottom. it will be a great help to me!

App promotion

You can use the applications that are created by this blog writer Deku.
Deku created the applications with Flutter.

If you have interested, please try to download them for free.



SHARE
Twitter Facebook RSS