Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class VersionUtils {

result = versionFromTags
} else {
if(version.bump || version.newPreRelease || version.promoteToRelease) {
if(version.bump || version.newPreRelease) {
throw new BuildException('Cannot bump the version, create a new pre-release version, or promote a pre-release version because HEAD is currently pointing to a tag that identifies an existing version. To be able to create a new version, you must make changes', null)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ class VersionUtilsSpecification extends Specification {
[[false, false, false, null, false],
[false, false, false, null, true],
[false, false, true, null, false],
[false, false, true, null, true]]).findAll {
[false, false, true, null, true],
[false, true, false, null, true],
[false, true, false, null, false],
[false, true, true, null, true],
[false, true, true, null, false]]).findAll {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're basically ignoring promoteToRelease here, you can update this test to remove that flag entirely.

It would be useful to add a test for the happy path -- basically making sure that you are able to promote to pre-release without making any commits.

Additionally, it would be useful to add a test to see how it handles having a pre-release and release tag on a commit. I think getLatestTagOnReference in VersionUtils takes care it by sorting and pulling out the latest version even if there are multiple tags on them. But since this plugin has never explicitly dealt with that case I think it would be useful to add a test.

Something that is potentially confusing with this change is that even if someone checks out a pre-release tag, it will use the release version. However, inspecting the tags should show them pointing to the same commit. Additionally, this could be easily detected and a message could be printed out to inform the user.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not completely comfortable altering this test signature, as it's confusing with all the bitwise-shifting, etc. Would you mind fixing it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can look at it.

There's still the issue of failing tests that I need to figure out.

I need to re-learn the testing framework again -- another contributor wrote it and so I am not super familiar with it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I've been busy with my PhD and haven't had a chance to look at this at all. I'm not sure when I will be able to.

// exclude the 12 cases that fail due to another reason
!(it[1] && (it[0] || it[3]))
}
Expand Down