Skip to content

feat: add dependabot/renovate as default allowed branch type - #442

Merged
shenxianpeng merged 1 commit into
mainfrom
feature/add-dependabot-default-branch-type
Jun 26, 2026
Merged

feat: add dependabot/renovate as default allowed branch type#442
shenxianpeng merged 1 commit into
mainfrom
feature/add-dependabot-default-branch-type

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

GitHub Dependabot creates branches like dependabot/go_modules/go-deps-c57c3fe1e0, which follow the <type>/<description> pattern from the Conventional Branch specification. However, dependabot was not included in DEFAULT_BRANCH_TYPES, causing branch checks to fail unless users manually added it to allow_branch_types.

Changes

  • commit_check/__init__.py: Added "dependabot" to DEFAULT_BRANCH_TYPES
  • tests/rule_builder_test.py: Updated test to verify dependabot/ branches pass validation
  • tests/engine_test.py: Added test_branch_validator_dependabot_branch_allowed test case
  • cchk.toml: Updated project's own config to include dependabot in allow_branch_types
  • docs/configuration.rst: Updated default value description
  • docs/what-is-new.rst: Added changelog entry for v2.8.0

Motivation

Dependabot is an official GitHub automation tool used by millions of repositories. It's as common as the AI agent prefixes we already support (ai/, claude/, copilot/, etc.), and arguably more fundamental since it's built into GitHub. Making it a default branch type improves the out-of-box experience for all users who rely on Dependabot.

Related discussion: the current project config already uses ignore_authors = ["dependabot[bot]", ...] to bypass commit checks, which shows this is a common use case.

Summary by CodeRabbit

  • New Features

    • Added automatic support for dependabot/... branches to the default conventional branch type allowlist.
    • Updated branch validation behavior so these branches are accepted without additional manual configuration.
  • Documentation

    • Clarified the branch.allow_branch_types defaults when conventional branch checking is enabled.
    • Added a release note entry for the new default inclusion of Dependabot branches.
  • Tests

    • Added coverage to ensure dependabot/... branches pass validation under default rules.

@shenxianpeng
shenxianpeng requested a review from a team as a code owner June 26, 2026 15:58
@netlify

netlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploy Preview for commit-check ready!

Name Link
🔨 Latest commit 9c4485d
🔍 Latest deploy log https://app.netlify.com/projects/commit-check/deploys/6a3eb99c8791c70008a4023a
😎 Deploy Preview https://deploy-preview-442--commit-check.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Dependabot branch prefixes are added to the default allowed branch types in config and code. Tests now cover Dependabot branch validation and the default branch-type list, and the configuration reference plus release notes describe the expanded defaults.

Changes

Dependabot branch type update

Layer / File(s) Summary
Default branch prefixes
cchk.toml, commit_check/__init__.py
dependabot is added to the default allowed branch types in the config and module constant, and the explicit config allowlist is removed.
Validator tests
tests/rule_builder_test.py, tests/engine_test.py
The branch-type test suite and branch validator test now include dependabot branch patterns.
Docs updates
docs/configuration.rst, docs/what-is-new.rst
The configuration reference and release note describe dependabot/ as part of the default allowed branch prefixes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

minor

Poem

🐰 I hopped through branches, swift and keen,
and found a dependabot/ path serene.
With tests and docs now in the light,
the carrot trail looks neat and right.
🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title matches the branch-type change, but it incorrectly claims Renovate support, which is not part of this changeset. Revise the title to mention only the actual change, e.g. "feat: add dependabot as a default allowed branch type".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-dependabot-default-branch-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.97%. Comparing base (2f47a48) to head (9c4485d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #442   +/-   ##
=======================================
  Coverage   95.97%   95.97%           
=======================================
  Files          10       10           
  Lines        1167     1167           
=======================================
  Hits         1120     1120           
  Misses         47       47           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
tests/engine_test.py (1)

320-323: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Tie this test to the generated default regex instead of a hand-written one.

Right now this still passes if dependabot disappears from DEFAULT_BRANCH_TYPES, because the regex is hard-coded in the test itself. Building the rule through RuleBuilder (or deriving the regex from the defaults) would actually cover the default-branch contract end to end.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/engine_test.py` around lines 320 - 323, The branch validation test is
still hard-coding the allowed branch regex, so it won’t fail if
DEFAULT_BRANCH_TYPES changes. Update the test around ValidationRule and
RuleBuilder to derive the regex from the shared default branch types instead of
embedding it directly, so the test exercises the same contract as the production
default branch logic end to end.
cchk.toml (1)

22-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid copying the full default branch-type list here.

Because TOML overrides the built-in defaults, keeping a full copy of allow_branch_types in this repo config means future additions to DEFAULT_BRANCH_TYPES will not flow through automatically. Now that dependabot is in commit_check/__init__.py, consider dropping this key unless the repo intentionally wants to pin its own branch-type set.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cchk.toml` at line 22, Remove the repo-level allow_branch_types override from
cchk.toml unless this project intentionally wants to pin its own branch-type
list. The comment points to the branch-type configuration that currently
duplicates the built-in defaults; update the config so it relies on
DEFAULT_BRANCH_TYPES from commit_check/__init__.py instead of maintaining a full
local copy, which will keep future default additions flowing through
automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/configuration.rst`:
- Line 410: Update the configuration table entry for the conventional_branch
setting so the Default column matches the expanded description; the current
default value still reflects only the legacy branch types, so revise that
default in the table to include the AI-agent prefixes and dependabot/ alongside
the existing branch types. Use the conventional_branch row in
docs/configuration.rst to locate the mismatch and keep the default text
consistent with the description.

---

Nitpick comments:
In `@cchk.toml`:
- Line 22: Remove the repo-level allow_branch_types override from cchk.toml
unless this project intentionally wants to pin its own branch-type list. The
comment points to the branch-type configuration that currently duplicates the
built-in defaults; update the config so it relies on DEFAULT_BRANCH_TYPES from
commit_check/__init__.py instead of maintaining a full local copy, which will
keep future default additions flowing through automatically.

In `@tests/engine_test.py`:
- Around line 320-323: The branch validation test is still hard-coding the
allowed branch regex, so it won’t fail if DEFAULT_BRANCH_TYPES changes. Update
the test around ValidationRule and RuleBuilder to derive the regex from the
shared default branch types instead of embedding it directly, so the test
exercises the same contract as the production default branch logic end to end.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e2576d41-6772-45d1-bf1b-8a3ec97f0f38

📥 Commits

Reviewing files that changed from the base of the PR and between 2f47a48 and 8d595f0.

📒 Files selected for processing (6)
  • cchk.toml
  • commit_check/__init__.py
  • docs/configuration.rst
  • docs/what-is-new.rst
  • tests/engine_test.py
  • tests/rule_builder_test.py

Comment thread docs/configuration.rst
- list[str]
- ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix"]
- Allowed branch types when conventional_branch is true.
- Allowed branch types when conventional_branch is true. AI agent prefixes (``ai/``, ``claude/``, ``codex/``, ``copilot/``, ``cursor/``) and bot prefixes (``dependabot/``) are also included by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the documented default value in sync with this description.

This row now says AI-agent and dependabot/ prefixes are included by default, but the Default column on Line 409 still lists only the legacy branch types. Please update that value too so the table does not contradict itself.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/configuration.rst` at line 410, Update the configuration table entry for
the conventional_branch setting so the Default column matches the expanded
description; the current default value still reflects only the legacy branch
types, so revise that default in the table to include the AI-agent prefixes and
dependabot/ alongside the existing branch types. Use the conventional_branch row
in docs/configuration.rst to locate the mismatch and keep the default text
consistent with the description.

@codspeed-hq

codspeed-hq Bot commented Jun 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 309 untouched benchmarks
🆕 3 new benchmarks
⏩ 109 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_branch_validator_dependabot_branch_allowed N/A 1.2 ms N/A
🆕 test_ai_agent_and_bot_branch_types_in_default N/A 198.4 µs N/A
🆕 test_branch_validator_renovate_branch_allowed N/A 1.2 ms N/A

Comparing feature/add-dependabot-default-branch-type (9c4485d) with main (2f47a48)

Open in CodSpeed

Footnotes

  1. 109 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@shenxianpeng
shenxianpeng force-pushed the feature/add-dependabot-default-branch-type branch 4 times, most recently from 02c865a to bce603f Compare June 26, 2026 17:38
dependabot/ branches (e.g., dependabot/go_modules/go-deps-c57c3fe1e0)
and renovate/ branches (e.g., renovate/lodash-5.x) are commonly created
by GitHub Dependabot and Renovate bot respectively, and follow the
<type>/<description> pattern from Conventional Branch spec.

Adding both to DEFAULT_BRANCH_TYPES so users don't need to manually
configure allow_branch_types for these popular automation tools.

Changes:
- Add 'dependabot' and 'renovate' to DEFAULT_BRANCH_TYPES in __init__.py
- Remove explicit allow_branch_types from cchk.toml (all covered by defaults)
- Update rule_builder_test to verify both branch types pass
- Add engine tests for dependabot and renovate branch validation
- Update docs/configuration.rst default value description
- Add what-is-new entries for v2.9.0 and v2.9.1
@shenxianpeng
shenxianpeng force-pushed the feature/add-dependabot-default-branch-type branch from bce603f to 9c4485d Compare June 26, 2026 17:40
@shenxianpeng shenxianpeng changed the title feat: add dependabot as default allowed branch type feat: add dependabot/renovate as default allowed branch type Jun 26, 2026
@shenxianpeng
shenxianpeng merged commit 9a88aac into main Jun 26, 2026
33 checks passed
@shenxianpeng
shenxianpeng deleted the feature/add-dependabot-default-branch-type branch June 26, 2026 19:20
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor A minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant