#573  Allow more flexible ways to match fixed issues in commit messages
Released
nex opened 2 years ago

From: https://code.onedev.io/projects/162/blob/main/pages/fix-issues-via-commit-message.md

I hope I can put this in the middle of the message, not neccessarily the beggining: [fix|fixing|fixed|resolve|resolving|resolved] issue #[issue number] [:optional issue description]

I'm using conventional commit practice so commit messages fixing bugs will always start with: fix: xxx or fix(something): xxx

bufferUnderrun commented 2 years ago

a regexp config would be the best... but @robin already reject that proposal https://code.onedev.io/projects/160/issues/166

jbauer commented 2 years ago

Currently the full regex used is

(^|[\W|/]+)(fix|fixed|fixes|fixing|resolve|resolved|resolves|resolving|close|closed|closes|closing)\s+issue\s+(\w([\w-/\.]*\w)?)?#(\d+)(?=$|[\W|/]+)

You can go to https://regex101.com then choose Java8 flavor on the left and paste the regex. Then you can play with the Test string.

For example it matches commit messages like:

Short commit title

Maecenas sed diam eget risus varius blandit sit amet non magna. Vestibulum id ligula porta felis euismod semper. Nullam id dolor id nibh ultricies vehicula ut id elit. Maecenas faucibus mollis interdum.

fixes issue project-name#123
OneDev changed state to 'Closed' 12 months ago
Previous Value Current Value
Open
Closed
OneDev commented 12 months ago

State changed as code fixing the issue is committed (33df8011)

OneDev changed state to 'Released' 12 months ago
Previous Value Current Value
Closed
Released
OneDev commented 12 months ago

State changed as build #3627 is successful

Robin Shen commented 12 months ago

This can now be customized via commit message fix patterns in issue setting

issue 1 of 1
Type
Improvement
Priority
Normal
Assignee
Issue Votes (0)
Watchers (5)
Reference
onedev/server#573
Please wait...
Page is in error, reload to recover