feat: add dependabot/renovate as default allowed branch type - #442
Conversation
✅ Deploy Preview for commit-check ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughDependabot 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. ChangesDependabot branch type update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
tests/engine_test.py (1)
320-323: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTie this test to the generated default regex instead of a hand-written one.
Right now this still passes if
dependabotdisappears fromDEFAULT_BRANCH_TYPES, because the regex is hard-coded in the test itself. Building the rule throughRuleBuilder(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 winAvoid copying the full default branch-type list here.
Because TOML overrides the built-in defaults, keeping a full copy of
allow_branch_typesin this repo config means future additions toDEFAULT_BRANCH_TYPESwill not flow through automatically. Now thatdependabotis incommit_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
📒 Files selected for processing (6)
cchk.tomlcommit_check/__init__.pydocs/configuration.rstdocs/what-is-new.rsttests/engine_test.pytests/rule_builder_test.py
| - 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. |
There was a problem hiding this comment.
📐 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.
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
02c865a to
bce603f
Compare
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
bce603f to
9c4485d
Compare
|



Summary
GitHub Dependabot creates branches like
dependabot/go_modules/go-deps-c57c3fe1e0, which follow the<type>/<description>pattern from the Conventional Branch specification. However,dependabotwas not included inDEFAULT_BRANCH_TYPES, causing branch checks to fail unless users manually added it toallow_branch_types.Changes
commit_check/__init__.py: Added"dependabot"toDEFAULT_BRANCH_TYPEStests/rule_builder_test.py: Updated test to verifydependabot/branches pass validationtests/engine_test.py: Addedtest_branch_validator_dependabot_branch_allowedtest casecchk.toml: Updated project's own config to includedependabotinallow_branch_typesdocs/configuration.rst: Updated default value descriptiondocs/what-is-new.rst: Added changelog entry for v2.8.0Motivation
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
dependabot/...branches to the default conventional branch type allowlist.Documentation
branch.allow_branch_typesdefaults when conventional branch checking is enabled.Tests
dependabot/...branches pass validation under default rules.