allegro / allegro/axion-release-plugin

`VersionConfig#releaseBranchPattern` doesn't update release branch pattern when used together with `incrementMinorIfNotOnRelease` incrementer

Đang mở
#396 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug hacktoberfest help wanted
Ngôn ngữ chính
Groovy
Star
641
Fork
165
Merge trung bình
49 phút
Pull request đã merge (30 ngày)
9

Mô tả

Originally reported in: https://github.com/allegro/axion-release-plugin/issues/391#issuecomment-811393047

Given following config
```groovy
scmVersion {

versionIncrementer = PredefinedVersionIncrementer.versionIncrementerFor('incrementMinorIfNotOnRelease')
releaseBranchPattern = Pattern.compile('^random(/.*)?$')
}
```

and according to the documentation

>If incrementMinorIfNotOnRelease rule is activated then the property ``releaseBranchPattern`` is used to match the release
branch. By default it's set to 'v/.+'.

the plugin should increment patch version when on `random/x.y.z` branch, minor in all other cases.

It seems like is was broken since at least `1.11.0`.

### Sample repository
https://github.com/mateuszkwiecinski/axion_playground

### Expected result
when on `release/7.8.9` the plugin returns `7.9.0-SNAPSHOT` version
when on `master` the plugin reports `7.9.0-SNAPSHOT`
when on `random/7.8.9` the plugin prints `7.8.10-SNAPSHOT`
when on `v/7.8.9` the plugin prints `7.9.0-SNAPSHOT`

### Actual result
(tested on `1.13.1`)
when on `release/7.8.9` the plugin returns `7.9.0-SNAPSHOT` version
when on `master` the plugin reports `7.9.0-SNAPSHOT`
when on `random/7.8.9` the plugin prints `7.9.0-SNAPSHOT` ❌
when on `v/7.8.9` the plugin prints `7.8.10-SNAPSHOT`❌

### Known workaround
use `versionIncrementer` overload
```groovy
scmVersion {
versionIncrementer 'incrementMinorIfNotOnRelease', [releaseBranchPattern: 'random/.*']
}
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.