Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,083
    • Issues 3,083
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1,019
    • Merge requests 1,019
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • MesaMesa
  • mesamesa
  • Merge requests
  • !1954

WIP: gitlab-ci: add commit message checks

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Eric Engestrom requested to merge eric/mesa:gitlab-ci-commit-message-check into main Sep 12, 2019
  • Overview 9
  • Commits 3
  • Pipelines 15
  • Changes 3

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 May 05, 2021 by Jordan Justen
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gitlab-ci-commit-message-check