From 51acaf49ca1e14df6dd08424cb918545e0109818 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 29 Apr 2026 13:25:32 -0400 Subject: [PATCH 1/2] gitlint: add a .gitlint config file This will be later used to check commit messages. Signed-off-by: John Mulligan --- .gitlint | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .gitlint diff --git a/.gitlint b/.gitlint new file mode 100644 index 000000000..d9dda781d --- /dev/null +++ b/.gitlint @@ -0,0 +1,24 @@ +[general] +verbosity=3 +regex-style-search=true +contrib=contrib-body-requires-signed-off-by + +[title-max-length] +line-length=72 + +[title-must-not-contain-word] +# Comma-separated list of words that should not occur in the title. Matching is case +# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING" +# will not cause a violation, but "WIP: my title" will). +words=wip,WIP + +[title-match-regex] +# python-style regex that the commit-msg title must match +# Note that the regex can contradict with other rules if not used correctly +# (e.g. title-must-not-contain-word). +regex=^.{2,32}: .* + +[ignore-body-lines] +# do not enforce the default body line length checks on lines that appear to be +# HTTP(S) URLs. +regex=https?:// From 1943faf3b888120dc13cc12a228289a40354ff48 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 29 Apr 2026 13:38:47 -0400 Subject: [PATCH 2/2] workflows: add a check-commits CI rule This uses the gitlint tool to check for basic formatting of commit messages. In particular we want to require the Signed-off-by on all commits. We were kinda-sorta requiring it but not always enforcing it. ceph/ceph has been requiring it for a long time. I also think it's even more important now that people declare they have the right to contribute change now that more and more tools are being used to generate code. Signed-off-by: John Mulligan --- .github/workflows/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ce242d66..2cc6b5378 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,6 +57,25 @@ jobs: - name: Run checks run: make check + # Check commit messages (in particular enforce Signed-off-by) + check-commits: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + with: + python-version: '3.13' + - name: Install gitlint + run: | + python3 -m venv venv.gitlint + ./venv.gitlint/bin/pip install gitlint==0.19.1 + - name: Run gitlint + run: ./venv.gitlint/bin/gitlint -C .gitlint --commits origin/master.. lint + # Run the test suite in a container per-ceph-codename test-suite: name: test-suite (${{ matrix.ceph_version }}${{ matrix.go_version != needs.go-versions.outputs.latest && format(', go{0}', matrix.go_version) || '' }})