Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Oct 29, 2025

Summary

Implements commitizen-based version management for automated versioning and changelog generation using pure Python (no Node.js required).

What's Changed

Core Implementation

  • ✅ Add commitizen>=3.29.0 dependency to pyproject.toml
  • ✅ Configure commitizen in pyproject.toml (PEP 621, semver, incremental changelog)
  • ✅ Create commitizen-check.yml CI workflow to enforce conventional commits
  • ✅ Create release.yml CI workflow for automated version bumps on merge to main
  • ✅ Add .cz-config.md with detailed commit guidelines and examples

Documentation

  • ✅ Comprehensive guide in README.md with conventional commit format
  • ✅ Examples for all commit types (feat, fix, docs, test, chore, etc.)
  • ✅ Breaking change syntax examples
  • ✅ Automated release workflow explained

Cleanup

  • ✅ Remove changesets (Node.js) implementation
  • ✅ Remove package.json, package-lock.json, node_modules
  • ✅ Remove .changeset/ directory
  • ✅ Remove scripts/sync_version.py (no longer needed)

How It Works

For Contributors

Write commits following Conventional Commits format:

# Feature (minor bump: 0.1.0 → 0.2.0)
git commit -m "feat: add OAuth authentication support"
git commit -m "feat(gam): add support for video creatives"

# Bug fix (patch bump: 0.1.0 → 0.1.1)
git commit -m "fix: correct schema validation"
git commit -m "fix(auth): prevent token race condition"

# Breaking change (major bump: 0.1.0 → 1.0.0)
git commit -m "feat!: redesign API response format

BREAKING CHANGE: Response format changed from {data} to {result}"

# No version bump
git commit -m "docs: update README"
git commit -m "test: add integration tests"
git commit -m "chore: update dependencies"

Optional: Use interactive commit helper:

uv run cz commit

For Maintainers

When commits are merged to main:

  1. CI analyzes commits: Looks for feat, fix, BREAKING CHANGE commits since last tag
  2. Determines bump type: major, minor, or patch based on commit types
  3. Bumps version: Updates pyproject.toml automatically
  4. Updates CHANGELOG: Generates changelog from commit messages
  5. Creates tag: Git tag (e.g., v0.2.0)
  6. Creates release: GitHub release with changelog
  7. Pushes to main: All changes committed back

Zero manual steps - it's fully automated!

CI Workflows

commitizen-check.yml

  • Runs on every PR to main
  • Validates all commits follow conventional commit format
  • Fails if any commit doesn't match pattern
  • Uses: cz check --rev-range origin/main..HEAD

release.yml

  • Runs on every push to main
  • Checks if version bump is needed (looks for feat/fix/BREAKING commits)
  • Runs cz bump --yes --changelog if needed
  • Creates git tag and GitHub release
  • Pushes changes back to main

Commit Types & Version Bumps

Type Description Version Bump Example
feat New feature minor (0.1.0 → 0.2.0) feat: add OAuth support
fix Bug fix patch (0.1.0 → 0.1.1) fix: correct validation
perf Performance patch (0.1.0 → 0.1.1) perf: optimize query
BREAKING Breaking change major (0.1.0 → 1.0.0) feat!: redesign API
docs Documentation none docs: update README
test Tests none test: add unit tests
chore Tooling none chore: update deps
refactor Refactoring none refactor: simplify logic

Benefits vs Changesets

Pure Python: No Node.js/npm required
Fully automated: Version bumps from commit messages
Zero extra files: No changeset markdown files to manage
Standard format: Conventional Commits is widely used
Enforced by CI: Can't merge PRs with bad commit messages
Less overhead: One commit command, not two steps

Testing

  • Commitizen installed and configured
  • cz version shows correct project version (0.1.0)
  • Configuration in pyproject.toml validated
  • Documentation complete with examples
  • CI workflows created and tested

Example Workflow

# 1. Make changes
git add .

# 2. Commit with conventional format
git commit -m "feat: add webhook support"

# 3. Push to PR
git push origin feature-branch

# 4. CI validates commit format ✅

# 5. Merge to main

# 6. CI automatically:
#    - Bumps version to 0.2.0
#    - Updates CHANGELOG.md
#    - Creates tag v0.2.0
#    - Creates GitHub release
#    - Pushes to main

Resources

🤖 Generated with Claude Code

bokelley and others added 2 commits October 29, 2025 06:23
Implements changeset-based version management for the project:

- Install @changesets/cli for version management
- Add changeset CI workflow to enforce changeset files on PRs
- Add release CI workflow to automatically create version bump PRs
- Create sync_version.py script to sync versions between package.json and pyproject.toml
- Add comprehensive documentation in README and .changeset/README.md
- Initialize CHANGELOG.md for tracking version history
- Add example changeset for this feature

When PRs are merged to main with changesets, a "Version Packages" PR
is automatically created that combines all changesets, bumps versions,
and updates the changelog. Both package.json and pyproject.toml are
kept in sync automatically.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace changesets (Node.js) with commitizen (pure Python) for version management:

- Add commitizen dependency to pyproject.toml
- Configure commitizen in pyproject.toml with semver and PEP 621
- Create commitizen-check.yml CI workflow to enforce conventional commits
- Create release.yml CI workflow for automated version bumps
- Update README with conventional commit format and examples
- Add .cz-config.md with detailed commit guidelines
- Remove all changesets-related files (package.json, .changeset/)

Benefits:
- Pure Python solution (no Node.js required)
- Fully automated version bumps from commit messages
- Enforces conventional commit format via CI
- Updates CHANGELOG.md automatically
- Creates git tags and GitHub releases automatically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley changed the title feat: Add changeset system for automated version management feat: add commitizen for automated version management Oct 29, 2025
@bokelley bokelley merged commit 4c49051 into main Oct 29, 2025
10 checks passed
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…col#666)

* feat: Add changeset system for automated version management

Implements changeset-based version management for the project:

- Install @changesets/cli for version management
- Add changeset CI workflow to enforce changeset files on PRs
- Add release CI workflow to automatically create version bump PRs
- Create sync_version.py script to sync versions between package.json and pyproject.toml
- Add comprehensive documentation in README and .changeset/README.md
- Initialize CHANGELOG.md for tracking version history
- Add example changeset for this feature

When PRs are merged to main with changesets, a "Version Packages" PR
is automatically created that combines all changesets, bumps versions,
and updates the changelog. Both package.json and pyproject.toml are
kept in sync automatically.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add commitizen for automated version management

Replace changesets (Node.js) with commitizen (pure Python) for version management:

- Add commitizen dependency to pyproject.toml
- Configure commitizen in pyproject.toml with semver and PEP 621
- Create commitizen-check.yml CI workflow to enforce conventional commits
- Create release.yml CI workflow for automated version bumps
- Update README with conventional commit format and examples
- Add .cz-config.md with detailed commit guidelines
- Remove all changesets-related files (package.json, .changeset/)

Benefits:
- Pure Python solution (no Node.js required)
- Fully automated version bumps from commit messages
- Enforces conventional commit format via CI
- Updates CHANGELOG.md automatically
- Creates git tags and GitHub releases automatically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants