Skip to content

refactor(ci): check commit and PR titles with commitizen #8045

Description

@dan-petty

Problem

Custom code and several separate lists define the form of a commit message and of a pull request title. No hook checks a commit message.

Evidence (2026-12-01)

  • src/devops_cli/roadmap/commit_title.py parses the Conventional Commit form, and about 19 modules import it. Its docstring says that no maintained Python package parses the form.
  • title_problems of src/devops_cli/roadmap/pull_form.py checks the type, the scope, the ! mark and the summary for devops pr create, devops pr edit and the roadmap jobs.
  • The types are in CONST_BRANCH_TYPES, in the branch name pattern of .pre-commit-config.yaml and in release-please-config.json.
  • .github/workflows/pr-checks.yml (amannn/action-semantic-pull-request) and .github/workflows/pr-title.yml (the template workflow) each check the title with a scope list of their own.

Existing tool

commitizen (MIT, release 4.20.1 on 2026-12-01) publishes the pre-commit hooks commitizen (commit-msg) and commitizen-branch (pre-push). cz check reads a message (--message), a file or a revision range, and --message-length-limit limits the first line. A cz_customize configuration sets a pattern of its own. Its documents say that cz_customize can change in the next major release, so check the supported way before the build.

Acceptance criteria

  • One commitizen configuration holds the allowed types and scopes.
  • .pre-commit-config.yaml runs the hooks commitizen and commitizen-branch, and one pre-commit install installs the commit-msg hook.
  • One CI check reads the pull request title with cz check and the same configuration. The other title check and its scope list are deleted.
  • The change deletes the custom title form rules and the custom commit parsing, with their tests, messages and specs. Code that only formats or checks a title uses commitizen or relies on the hooks and CI.
  • The pull request lists each rule that commitizen cannot express, such as the closing keyword guard, and keeps or drops it with a reason.
  • commitizen only checks messages. release-please stays the release tool.
  • The summary limit does not become weaker.

Related

Proposed design

Problem statement

Custom code and three lists define the form of a commit message and of a pull request title. No hook checks a commit message. commitizen checks a message with one configuration and two hooks. This change deletes the custom form code and uses commitizen for the commit message and for the pull request title. release-please stays the release tool.

Acceptance criteria

Requirement: The commitizen configuration accepts the default types and any scope

The repository SHALL hold one commitizen configuration that sets the cz_conventional_commits types and accepts any scope.

Scenario: A default type with any scope passes

  • WHEN uv run cz check --message "feat(any-scope): add the commitizen check" runs
  • THEN the command exits 0 and prints no error.

Requirement: A type outside the commitizen defaults fails

The commitizen configuration MUST refuse a type that cz_conventional_commits does not list.

Scenario: An unlisted type fails

  • WHEN uv run cz check --message "nope(any-scope): add the commitizen check" runs
  • THEN the command exits non-zero and prints the commitizen refusal of the type.

Requirement: A breaking change mark passes

The commitizen configuration MUST accept a ! before the colon.

Scenario: A title with a ! passes

  • WHEN uv run cz check --message "feat!: drop the custom title check" runs
  • THEN the command exits 0 and prints no error.

Requirement: The first line of a commit message has at most 72 characters

The repository MUST refuse a commit message whose first line has more than 72 characters.

Scenario: A long first line fails

  • WHEN uv run cz check --message "feat: add the commitizen check to the commit message and the pull request title of this repository" --message-length-limit 72 runs
  • THEN the command exits non-zero and prints the commitizen length refusal.

Requirement: The commitizen hooks run on commit-msg and pre-push

The repository SHALL run the commitizen hooks commitizen on commit-msg and commitizen-branch on pre-push from .pre-commit-config.yaml.

Scenario: A bad commit message is refused

  • WHEN pre-commit validate-config and pre-commit install-hooks pass, and pre-commit run commitizen --hook-stage commit-msg --files <a file that holds "nope: add the check"> runs
  • THEN the run exits non-zero and prints the commitizen refusal.

Requirement: One pre-commit install installs the commit-msg hook

The repository MUST install the commit-msg hook from one pre-commit install.

Scenario: A commit with a bad message is refused

  • WHEN pre-commit install runs in a fresh clone and git commit -m "nope: add the check" runs
  • THEN git refuses the commit and prints the commitizen refusal.

Requirement: The repository holds one pull request title check

The repository SHALL check a pull request title with cz check and the commitizen configuration, and SHALL hold no second title check.

Scenario: The workflow set passes actionlint and zizmor

  • WHEN uv run devops ci --check --only actionlint,zizmor runs
  • THEN the command exits 0 and reports no error in the workflows of .github/workflows/.

Requirement: The custom title form rules are deleted

The repository SHALL delete the custom title form rules of src/devops_cli/roadmap/pull_form.py with their tests, messages and spec requirements.

Scenario: The module holds no title form rule

  • WHEN uv run python -c "from devops_cli.roadmap.pull_form import title_problems, build_title" runs
  • THEN the command exits non-zero with ImportError.

Requirement: The custom pull request body form rules are deleted

The repository SHALL delete the custom form rules for a pull request body from src/devops_cli/roadmap/pull_form.py with their tests, messages and spec requirements.

Scenario: The module holds no body form rule

  • WHEN uv run python -c "from devops_cli.roadmap.pull_form import body_problems, plan_body_problems" runs
  • THEN the command exits non-zero with ImportError.

Requirement: The remaining title paths rely on the hooks and the CI check

The repository SHALL pass its tests with no caller of title_problems or build_title.

Scenario: The roadmap and command tests pass

  • WHEN uv run pytest tests/roadmap tests/commands -q runs
  • THEN the command exits 0 and reports no failed test.

Requirement: Pending a person after the merge

A person MUST prove after the merge that the required check refuses a pull request title that breaks the commitizen form.

Scenario: A bad pull request title fails the required check

  • WHEN dan-petty/github-workflows#70 ships the cz check step and a pull request into main has the title nope: add the check
  • THEN the required check PR title / Semantic PR title fails and the pull request cannot merge.

Existing Tool Considered

No alternatives check has run. commitizen 4.20.1 (MIT) covers the need: it publishes the hooks commitizen (commit-msg) and commitizen-branch (pre-push), and cz check reads a message with --message, a file or a revision range. It lacks a check of a pull request body and a reader of the type and the scope of a message. A short pull request template guides the body, and the deferred issue keeps the reader of the type until a maintained package parses the form.

Key questions

  • Which open, maintained tool checks a commit message and a pull request title?: commitizen 4.20.1 (MIT) is the open, maintained Python tool. It checks a message with cz check. cz check reads a message with --message, a file or a revision range, and --message-length-limit limits the first line. It publishes the hooks commitizen (commit-msg) and commitizen-branch (pre-push). The repository runs the same cz check on the pull request title in CI. [sources: https://hub.docker.com/r/commitizen/commitizen, tests/fixtures/roadmap_eval/implement/4782-pr-edit-title/issue.md:17, docs/adr/0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md:372]
  • Which types and scopes does the commitizen configuration allow?: The cz_conventional_commits defaults: build, chore, ci, docs, feat, fix, perf, refactor, revert, style and test. Any scope is allowed. A ! before the colon is allowed. The first line has at most 72 characters. (best practice) [sources: src/devops_cli/config/constants.py:801, .pre-commit-config.yaml, release-please-config.json]
    • Rejected: Keep the CONST_BRANCH_TYPES list. Three lists define the types today, and the owner direction replaces them with the commitizen defaults.
    • Chosen: The cz_conventional_commits defaults. The owner direction of 2026-12-01 names the defaults, and commitizen checks them with no custom pattern.
    • Rejected: A cz_customize pattern. The documents of commitizen say that cz_customize can change in the next major release, and the defaults need no custom pattern.
  • Which workflow checks the pull request title?: The library workflow that .github/workflows/pr-title.yml calls keeps the check name PR title / Semantic PR title. It runs cz check with the same configuration. The change deletes the title check of .github/workflows/pr-checks.yml and its scope list. dan-petty/github-workflows#70 changes the library workflow. (best practice) [sources: .github/workflows/pr-checks.yml, .github/workflows/pr-title.yml]
    • Rejected: Keep amannn/action-semantic-pull-request in pr-checks.yml. It holds a second scope list and a summary pattern of its own, and the owner wants one configuration.
    • Chosen: The library workflow with cz check. It keeps the required check name of the ruleset after chore(github): require the library title check on main #7954, and one configuration holds the rules.
  • Does the summary limit become weaker?: Yes. The limit changes from 60 to 72 characters, by the owner direction of 2026-12-01. The owner direction replaces the stricter rule of the issue. The 72 characters match commitizen and the industry default. (best practice) [sources: src/devops_cli/roadmap/pull_form.py]
    • Rejected: Keep 60 characters. The owner direction sets 72 and replaces the stricter rule.
    • Chosen: 72 characters. The owner direction of 2026-12-01 names 72, and it is the industry default.
  • Which rule that commitizen cannot express stays?: None of the body rules stays. commitizen checks a message only. The change drops the Closes line rule, the Change: line rule, the body length limit, the closing keyword guard, the placeholder rule, the summary repeat rule and the scope list. A short pull request template holds the Closes line. (best practice) [sources: src/devops_cli/roadmap/pull_form.py]
    • Rejected: Keep the closing keyword guard and the other body rules. The owner direction says that no custom form rule checks the pull request body.
    • Chosen: Drop each rule that commitizen cannot express. commitizen checks the message form, and the short template guides the body.
  • Does release-please stay the release tool?: Yes. commitizen checks messages only. release-please keeps the release flow (ADR 0013), and the change does not touch the release configuration. (best practice) [sources: docs/adr/0013-releases-use-release-please-as-it-ships-and-agents-stay-out.md, release-please-config.json]
    • Rejected: Replace release-please with commitizen. ADR 0013 keeps release-please, and commitizen has no release flow for this repository.
    • Chosen: Keep release-please. ADR 0013 keeps release-please as it ships.

Fit

Fits in one pull request.

Suspected block

dan-petty/github-workflows#70 must make the library pr-title workflow run cz check with the same configuration before this repository deletes the check in .github/workflows/pr-checks.yml.

Dependencies

#7954

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • .github/workflows/pr-checks.yml

Alternatives check of 2026-12-01: not-applicable.
Class: refactor, no model call.
Tool: none found.

Activity

  1. added
    type/refactor
    scope/ci
    source/agent
    status/new
    value/medium
    effort/high
    on Dec 1, 2026
  2. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Dec 1, 2026
  4. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor

    Related work: #7954 moves the ruleset of main to the library check PR title / Semantic PR title. So keep that check name, change the library workflow in dan-petty/github-workflows (#70 there) to run cz check, and delete the check of pr-checks.yml. Then no further ruleset change is necessary after #7954. Only a person changes a ruleset.

  5. added
    owner/agent
    on Dec 1, 2026
  6. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor

    Owner direction (2026-12-01): match commitizen and the industry defaults, and use best practice where there is a gap. The rules: the default types of cz_conventional_commits; any scope; ! and BREAKING CHANGE allowed; a first line of at most 72 characters; the commitizen hooks for commit messages; no custom form rule for the pull request body, which uses a short pull request template. These rules replace each stricter or different rule in this item. The work is in progress on the branch refactor/8045-commitizen-validation.

  7. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  8. added
    status/in-progress
    and removed
    status/new
    on Dec 1, 2026
  9. added
    status/in-review
    and removed
    status/in-progress
    on Dec 1, 2026
  10. removed
    status/in-review
    owner/agent
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/highpriority/p2-mediumscope/cisource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions