Skip to content

WIP: gitlab-ci: add commit message checks

Eric Engestrom requested to merge eric/mesa:gitlab-ci-commit-message-check into main

The idea started in MR !1914 (merged) that we should check that Fixes: abcdef1234 ("commit title") should be formatted correctly. I also added commented out code to enforce code style, but I realize that might be an impossible task as we don't have a single coding style across mesa.

So far, the checks are:

  • commit hash exists and is unique
  • commit hash is long enough to reasonably avoid future collisions (10 chars as of today)
  • commit title is included after the hash so that humans can know what commit it is without having to look it up
  • code style matches what clang-format does (most likely won't do that in this MR)

Suggestion for other things to check are welcome :)

Working on this as an active MR because CI_MERGE_REQUEST_SOURCE_BRANCH_NAME and $CI_MERGE_REQUEST_TARGET_BRANCH_NAME are "Available only if only: [merge_requests] is used and the merge request is created.", and I couldn't find any other way to get the list of commits in the MR. Any suggestion welcome 🙏

/cc @daenzer @jasuarez @dbaker

Edited by Jordan Justen

Merge request reports