GEOS icon indicating copy to clipboard operation
GEOS copied to clipboard

ci: Check that PR title follows conventional commit prefix

Open untereiner opened this issue 11 months ago • 15 comments

The main objective is to be able to release easily. It is easier to compute version numbers based on conventional commits. But constraining every commit message may be too much. To make this process easy I propose to only constrain the merge commit message. It can be easily check via this github action.

The allowed prefixes are:

  • feat: A new feature
  • fix: A bug fix,
  • docs: Documentation only changes,
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc),
  • refactor: A code change that neither fixes a bug nor adds a feature,
  • perf: A code change that improves performance,
  • test: Adding missing tests or correcting existing tests,
  • build: Changes that affect the build system or external dependencies (example scopes: cmake),
  • ci: Changes to our CI configuration files and scripts (example scopes: github),
  • chore: Other changes that don't modify src or test files,
  • revert: Reverts a previous commit,

It is also possible to add your own prefixes…

In case of wrong prefix this stage of the ci will fail and print out the a list of allowed prefixes

https://www.conventionalcommits.org/en/v1.0.0/

untereiner avatar Mar 15 '24 17:03 untereiner

@rrsettgast @castelletto1 Could you please review this?

TotoGaz avatar Mar 18 '24 15:03 TotoGaz

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 53.19%. Comparing base (f78d162) to head (bd217df). Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3043   +/-   ##
========================================
  Coverage    53.18%   53.19%           
========================================
  Files          981      981           
  Lines        83437    83437           
========================================
+ Hits         44380    44382    +2     
+ Misses       39057    39055    -2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 18 '24 15:03 codecov[bot]

Won't this skip the builds on develop?

rrsettgast avatar Mar 18 '24 15:03 rrsettgast

I added an if to ensure this action runs only at PR state

untereiner avatar Mar 18 '24 16:03 untereiner

Hi @untereiner . Can you explain what situation we are trying to avoid with this change? For instance, you have a check on the PR title prefix, so now every pr must have a prefix from some set of prefixes? What is the set of allowed prefixes?

rrsettgast avatar Mar 18 '24 17:03 rrsettgast

@rrsettgast I updated the PR text

untereiner avatar Mar 18 '24 22:03 untereiner

perhaps we should have a new prefix: crappy_chore 😬

rrsettgast avatar Mar 18 '24 23:03 rrsettgast

What do we do then ? I really think it’s a light way to introduce order. We can also try to add an action to check changes in the xml or rst tables and request the breaking changes symbol in the title.

untereiner avatar Mar 19 '24 17:03 untereiner

@rrsettgast can we give it a try ?

untereiner avatar Mar 24 '24 20:03 untereiner