wunderio / drupal-project

Wunder's template for Drupal projects designed to work automatically with Lando, CircleCI and Helm.
GNU General Public License v2.0
35 stars 6 forks source link

WD-253: Introduce JIRA ticket number validation in commit messages. #398

Closed tormi closed 6 months ago

tormi commented 6 months ago

Ticket: WD-253

Changes

This PR introduces JIRA ticket number validation in GIT commit messages via GrumPHP git_commit_message task.

General JIRA ticket code regex is implemented as a default rule: /^[A-Z][A-Z0-9_]+-[1-9][0-9]*: /.

When implementing in a specific project, the name of the JIRA project should be specified. For example, the regex for a project called WD would be: /^WD-[1-9][0-9]*: /.

Testing

tormi commented 6 months ago

Thanks, @misterjoonas! I updated the regex according to the link you provided. I also updated the testing section in the PR description.

Screenshot 2024-04-18 at 11 33 07

badrange commented 6 months ago

Please consider how this change will affect possible outside contributors who don't have access to your internal JIRA

tormi commented 6 months ago

@badrange, good point when considering this particular template project!

tormi commented 6 months ago

Please consider how this change will affect possible outside contributors who don't have access to your internal JIRA

@badrange - It looks like we can use the GH-<issue number> syntax for this, similar to issue numbers in JIRA, see Issues and Pull Requests:

GH- and issue or pull request number    GH-26   [GH-26](https://github.com/jlord/sheetsee.js/issues/26)

The same regex applies as for JIRA issues. I'll include some instructions on this in the readme.

tormi commented 6 months ago

Thanks, @misterjoonas & @badrange!

badrange commented 6 months ago

That was a clever solution!