From 156b9d32857b2f69c5f09c94d6ee1a872c6d1463 Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Fri, 27 Feb 2026 12:43:55 -0500 Subject: [PATCH] ci: add PR size and title checks, configure commitizen Add two new GitHub Actions workflows: - pr-size.yml: auto-labels PRs by size and fails CI on PRs over 500 lines - pr-title.yml: enforces conventional commit format on PR titles Configure commitizen in pyproject.toml with strict schema pattern matching for conventional commits. --- .github/workflows/pr-size.yml | 37 +++++++++++++++++++++++++++++++++ .github/workflows/pr-title.yml | 38 ++++++++++++++++++++++++++++++++++ pyproject.toml | 16 ++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 .github/workflows/pr-size.yml create mode 100644 .github/workflows/pr-title.yml diff --git a/.github/workflows/pr-size.yml b/.github/workflows/pr-size.yml new file mode 100644 index 000000000..60d127272 --- /dev/null +++ b/.github/workflows/pr-size.yml @@ -0,0 +1,37 @@ +name: PR Size Check + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + pr-size: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: codelytv/pr-size-labeler@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + xs_label: "size/XS" + xs_max_size: 25 + s_label: "size/S" + s_max_size: 100 + m_label: "size/M" + m_max_size: 250 + l_label: "size/L" + l_max_size: 500 + xl_label: "size/XL" + fail_if_xl: true + message_if_xl: > + This PR exceeds 500 lines changed and has been labeled `size/XL`. + PRs of this size require release manager approval to merge. + Please consider splitting into smaller PRs, or add a justification + in the PR description for why this cannot be broken up. + files_to_ignore: | + uv.lock + *.lock + lib/crewai/src/crewai/cli/templates/** + **/*.json + **/test_durations/** + **/cassettes/** \ No newline at end of file diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 000000000..a83527c93 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,38 @@ +name: PR Title Check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + pr-title: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + refactor + perf + test + docs + chore + ci + style + revert + requireScope: false + subjectPattern: ^[a-z].+[^.]$ + subjectPatternError: > + The PR title "{title}" does not follow conventional commit format. + + Expected: (): + + Examples: + feat(memory): add lancedb storage backend + fix(agents): resolve deadlock in concurrent execution + chore(deps): bump pydantic to 2.11.9 + + See RELEASE_PROCESS.md for the full commit message convention. diff --git a/pyproject.toml b/pyproject.toml index 657c15eaa..e91fe1321 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,6 +142,22 @@ python_files = "test_*.py" python_classes = "Test*" python_functions = "test_*" +[tool.commitizen] +name = "cz_conventional_commits" +version_provider = "scm" +tag_format = "$version" +allowed_prefixes = ["Merge", "Revert"] +changelog_incremental = true +update_changelog_on_bump = false + +[tool.commitizen.customize] +schema = "(): " +schema_pattern = "^(feat|fix|refactor|perf|test|docs|chore|ci|style|revert)(\\(.+\\))?!?: .{1,72}" +bump_pattern = "^(feat|fix|perf|refactor|revert)" +bump_map = { feat = "MINOR", fix = "PATCH", perf = "PATCH", refactor = "PATCH", revert = "PATCH" } +info = "Commits must follow Conventional Commits 1.0.0. See RELEASE_PROCESS.md for details." + + [tool.uv] # composio-core pins rich<14 but textual requires rich>=14.