Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nebula.release should not enforce precedence for immutable snapshots #200

Merged
merged 1 commit into from Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1252,6 +1252,31 @@ class ReleasePluginIntegrationSpec extends GitVersioningIntegrationSpec {
result.standardOutput.contains('Pushing changes in [v0.1.0] to origin')
}

def 'Can create devSnapshot with scope patch if candidate for next minor is present'() {
git.tag.add(name: 'v3.1.2')
git.tag.add(name: 'v3.2.0-rc.1')
git.tag.add(name: 'v3.2.0-rc.2')

when:
def version = inferredVersionForTask('devSnapshot', '-Prelease.scope=patch')

then:
version == dev('3.1.3-dev.0+')
}

def 'Can create devSnapshot with scope patch if candidate for next minor is present - immutable snapshot'() {
replaceDevWithImmutableSnapshot()
git.tag.add(name: 'v3.1.2')
git.tag.add(name: 'v3.2.0-rc.1')
git.tag.add(name: 'v3.2.0-rc.2')

when:
def version = inferredVersionForTask('devSnapshot', '-Prelease.scope=patch')

then:
version.toString().startsWith("3.1.3-snapshot." + getUtcDateForComparison())
}

private void replaceDevWithImmutableSnapshot() {
new File(buildFile.parentFile, "gradle.properties").text = """
nebula.release.features.replaceDevWithImmutableSnapshot=true
Expand Down
Expand Up @@ -343,7 +343,8 @@ final class Strategies {
allowDirtyRepo: true,
preReleaseStrategy: all(PreRelease.STAGE_FLOAT, PreRelease.TIMESTAMP, PreRelease.SHOW_UNCOMMITTED),
buildMetadataStrategy: BuildMetadata.COMMIT_ABBREVIATED_ID,
createTag: false
createTag: false,
enforcePrecedence: false
)

/**
Expand Down