Skip to content

Latest commit

 

History

History
293 lines (174 loc) · 5.92 KB

slides.md

File metadata and controls

293 lines (174 loc) · 5.92 KB
title theme revealOptions
Commitizen | Automating release cycles
black
transition
convex

Commitizen

Automating release cycles

github logo


About me

Santiago

origin: Argentina 🇦🇷

current: Amsterdam 🇳🇱 @ KPN

🐍 python, web, js, stuff


Agenda

  1. History
  2. Release workflow
  3. Commitizen
  4. Customization

History 📜

Born as a prompt to avoid remembering commit conventions

Based on the js cz-cli

conventional commits, work conventions, etc

In the Beginning

  • Extendable: build your own rules
  • Automatic version inference planned
  • Wait, I can also generate the changelog 🤔

Evolution

Built prompt

Built auto bump version

@Lee-W starting contributing more and more

@Lee-W created first autochangelog MVP

I found motivation again and finished the auto-changelog feature


Release workflow

🧑 Merge PR

⬇️

🤖 Bump version and generate changelog

⬇️

🤖 Push back to your branch

⬇️

🤖 Trigger deploy/release for new tag


Example GH actions

.
├── bump-version.yml
├── publish-docs.yaml
├── pr-checks.yml
└── publish-package.yaml

PR checks

on: [pull_request]

Bump version

on:
  push:
    branches:
      - trunk

Publish package + Documentation

on:
  push:
    tags:
      - 'v*'

Commitizen


Version ⬆️ + changelog 📂

Key elements of a release

  • Relevant version
  • What has been introduced?

Commands

Aim for intuitiveness and sane defaults


cz init

Assists in the creation of the toml file, with some automatic detections.

[tool.commitizen]
name = "cz_conventional_commits"
version = "0.15.3"
version_files = [
  "VERSION"
]

🧪 project setup


cz commit or cz c

🐕‍🦺 Assist in the creation of a commit by matching the defined rules.

Defaults: conventional commitis

🧪 development


cz changelog

Creates changelog file 📂, can target a different file name

🧪 optional


cz bump --changelog

Bumps version ⬆️ including the changelog generation 📂

🧪 CI


And more

cz ls ➡️ list installed commit rules

cz check ➡️ validate the commit (useful for git hooks)

cz schema ➡️ show the schema of the commit rule

cz example ➡️ show an example

cz info ➡️ explain rationale behind the commit rule


Version bump

  • Follows SEMVER
  • Calculates new tag based on the commit rules and last tag
  • Has the ability to create the changelog

Fear SEMVER no more

  • Let commitizen handle it for you
  • Contains information

MAJOR

⬇️

BREAKING CHANGES ⚠️


MINOR

⬇️

New stuff 🎉


PATCH

⬇️

Secuuurity 🔒 and bug fixes 🐛


MAJOR.MINOR.PATCH

2.23.3


Customization

  • We have a template for custom rules
  • 2 regexs for bump (find change_type and map it to semver)
  • Changelog should work by default, best if a regex is provided

Read the documentation


Future

  • Support for other config format files: json
  • Github action
  • Sprint on next europython

Recap

# on an initialized git repo
cz init
git add <file>
cz c
cz bump --changelog

Demo


Questions 🙋🙋‍♀️


thanks

twitter: @santiwilly

github: woile