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.