Skip to content

Commit

Permalink
project.version set when updateProjectVersionAfterRelease flag is ena…
Browse files Browse the repository at this point in the history
…bled | fixes #806
  • Loading branch information
bgalek committed Sep 2, 2024
1 parent ec7fe55 commit ce3ce89
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,20 @@ class BaseIntegrationTest extends RepositoryBasedTest {

BuildResult runGradle(String... arguments) {
def args = []
args.addAll(arguments)
args.add("--stacktrace")
args.add("--configuration-cache")
args.add("--warning-mode=fail")
args.addAll(arguments)
runGradleWithArgs(args)
}

BuildResult runGradleWithArgs(List<String> args) {
try {
return gradle().withArguments(args).build()
}
catch (e) {
throw new RuntimeException("Gradle build failed", e)
}

finally {
def ccDir = new File(temporaryFolder, "build/reports/configuration-cache")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,69 @@ class SimpleIntegrationTest extends BaseIntegrationTest {
cleanup:
environmentVariablesRule.clear("GITHUB_ACTIONS", "GITHUB_OUTPUT")
}
def "should not update project.version after release when updateProjectVersionAfterRelease option is not set"() {
given:
buildFile("""
task assemble {
inputs.property("version", project.version)
doLast {
println("Assembling project: " + version)
}
}
""")
def result = runGradleWithArgs(['currentVersion', 'release', 'assemble', '-Prelease.localOnly', '-Prelease.disableChecks'])
expect:
result.output.contains('Project version: 0.1.0-SNAPSHOT')
result.output.contains('Creating tag: v0.1.0')
result.output.contains('Assembling project: 0.1.0-SNAPSHOT')
result.task(":currentVersion").outcome == TaskOutcome.SUCCESS
result.task(":release").outcome == TaskOutcome.SUCCESS
result.task(":assemble").outcome == TaskOutcome.SUCCESS
}
def "should update project.version after release when updateProjectVersionAfterRelease option is set"() {
given:
buildFile("""
scmVersion {
updateProjectVersionAfterRelease = true
}

task assemble {
inputs.property("version", project.version)
doLast {
println("Assembling project: " + version)
}
}
""")
def result = runGradleWithArgs(['currentVersion', 'release', 'assemble', '-Prelease.localOnly', '-Prelease.disableChecks'])
expect:
result.output.contains('Project version: 0.1.0-SNAPSHOT')
result.output.contains('Creating tag: v0.1.0')
result.output.contains('Project version will be updated after release.')
result.output.contains('Assembling project: 0.1.0')
result.task(":currentVersion").outcome == TaskOutcome.SUCCESS
result.task(":release").outcome == TaskOutcome.SUCCESS
result.task(":assemble").outcome == TaskOutcome.SUCCESS
}
def "should throw error when using updateProjectVersionAfterRelease and configuration cache"() {
given:
buildFile("""
scmVersion {
updateProjectVersionAfterRelease = true
}
""")
when:
runGradle('release', '--stacktrace', '-Prelease.localOnly', '-Prelease.disableChecks')
then:
def e = thrown(RuntimeException)
e.getCause().getMessage().contains('Configuration cache is enabled and `scmVersion.updateProjectVersionAfterRelease` is set to `true`. This is not supported. Set `scmVersion.updateProjectVersionAfterRelease` to `false` and remember to run release task separately.')
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package pl.allegro.tech.build.axion.release

class ConfigurationCacheConfiguration {
boolean updateProjectVersionAfterRelease
boolean configurationCacheEnabled
public Closure<String> updateProjectVersion

ConfigurationCacheConfiguration(boolean updateProjectVersionAfterRelease, boolean configurationCacheEnabled, Closure<String> updateProjectVersion) {
this.updateProjectVersionAfterRelease = updateProjectVersionAfterRelease
this.configurationCacheEnabled = configurationCacheEnabled
this.updateProjectVersion = updateProjectVersion
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
package pl.allegro.tech.build.axion.release

import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import pl.allegro.tech.build.axion.release.domain.Releaser
import pl.allegro.tech.build.axion.release.domain.scm.ScmService
import pl.allegro.tech.build.axion.release.infrastructure.di.VersionResolutionContext

abstract class CreateReleaseTask extends BaseAxionTask {

@Input
boolean configurationCacheEnabled

@TaskAction
void release() {
VersionResolutionContext context = resolutionContext()
Releaser releaser = context.releaser()
ScmService scmService = context.scmService()

Check warning on line 18 in src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy#L18

Added line #L18 was not covered by tests
ReleaseBranchesConfiguration releaseBranchesConfiguration = new ReleaseBranchesConfiguration(
context.scmService().isReleaseOnlyOnReleaseBranches(),
scmService.isReleaseOnlyOnReleaseBranches(),

Check warning on line 20 in src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy#L20

Added line #L20 was not covered by tests
context.repository().currentPosition().getBranch(),
context.scmService().getReleaseBranchNames()
scmService.getReleaseBranchNames()

Check warning on line 22 in src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy#L22

Added line #L22 was not covered by tests
)
ConfigurationCacheConfiguration configurationCacheConfiguration = new ConfigurationCacheConfiguration(
scmService.isUpdateProjectVersionAfterRelease(),

Check warning on line 25 in src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy#L24-L25

Added lines #L24 - L25 were not covered by tests
configurationCacheEnabled,
(version) -> project.setVersion(version)

Check warning on line 27 in src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy#L27

Added line #L27 was not covered by tests
)
releaser.release(context.rules(), releaseBranchesConfiguration)
releaser.release(context.rules(), releaseBranchesConfiguration, configurationCacheConfiguration)

Check warning on line 29 in src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/CreateReleaseTask.groovy#L29

Added line #L29 was not covered by tests
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package pl.allegro.tech.build.axion.release

import com.github.zafarkhaja.semver.Version
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.internal.StartParameterInternal
import pl.allegro.tech.build.axion.release.domain.SnapshotDependenciesChecker
import pl.allegro.tech.build.axion.release.domain.VersionConfig
import pl.allegro.tech.build.axion.release.util.FileLoader
Expand Down Expand Up @@ -41,12 +43,26 @@ abstract class ReleasePlugin implements Plugin<Project> {
group = 'Release'
description = 'Performs release - creates tag and pushes it to remote.'
dependsOn(VERIFY_RELEASE_TASK)
configurationCacheEnabled = isConfigurationCacheEnabled(project)

Check warning on line 46 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L46

Added line #L46 was not covered by tests
if (versionConfig.updateProjectVersionAfterRelease.get() && !project.tasks.matching { it.name == "assemble" }.isEmpty()) {
doLast {
logger.quiet("Project version will be updated after release.")

Check warning on line 49 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L48-L49

Added lines #L48 - L49 were not covered by tests
}
finalizedBy(project.tasks.named("assemble"))
}

Check warning on line 52 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L51-L52

Added lines #L51 - L52 were not covered by tests
}

project.tasks.register(CREATE_RELEASE_TASK, CreateReleaseTask) {
group = 'Release'
description = 'Performs first stage of release - creates tag.'
dependsOn(VERIFY_RELEASE_TASK)
configurationCacheEnabled = isConfigurationCacheEnabled(project)

Check warning on line 59 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L59

Added line #L59 was not covered by tests
if (versionConfig.updateProjectVersionAfterRelease.get() && !project.tasks.matching { it.name == "assemble" }.isEmpty()) {
doLast {
logger.quiet("Project version will be updated after release.")

Check warning on line 62 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L61-L62

Added lines #L61 - L62 were not covered by tests
}
finalizedBy(project.tasks.named("assemble"))
}

Check warning on line 65 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L64-L65

Added lines #L64 - L65 were not covered by tests
}

project.tasks.register(PUSH_RELEASE_TASK, PushReleaseTask) {
Expand All @@ -64,4 +80,27 @@ abstract class ReleasePlugin implements Plugin<Project> {
description = 'Prints current project version extracted from SCM.'
}
}

static boolean isConfigurationCacheEnabled(Project project) {
try {
def gradleVersion = getGradleVersion(project.gradle.gradleVersion)

Check warning on line 86 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L86

Added line #L86 was not covered by tests
if (gradleVersion.greaterThanOrEqualTo(Version.valueOf("7.6.0"))) {
return project.gradle.startParameter.isConfigurationCacheRequested()

Check warning on line 88 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L88

Added line #L88 was not covered by tests
} else if (gradleVersion.greaterThanOrEqualTo(Version.valueOf("7.0.0"))) {
return (project.gradle.startParameter as StartParameterInternal).isConfigurationCache()

Check warning on line 90 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L90

Added line #L90 was not covered by tests
}
} catch (e) {
project.logger.quiet("Cannot determine if configuration cache is enabled. Assuming it is not.", e)
}
return false

Check warning on line 95 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L92-L95

Added lines #L92 - L95 were not covered by tests
}

static Version getGradleVersion(String gradleVersionString) {
def split = gradleVersionString.split("\\.")

Check warning on line 99 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L99

Added line #L99 was not covered by tests
if (split.length >= 2) {
return Version.forIntegers(split[0].toInteger(), split[1].toInteger())
} else {
throw new IllegalStateException("Cannot parse Gradle version: $gradleVersionString")
}

Check warning on line 104 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy#L101-L104

Added lines #L101 - L104 were not covered by tests
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package pl.allegro.tech.build.axion.release

import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import pl.allegro.tech.build.axion.release.domain.Releaser
import pl.allegro.tech.build.axion.release.domain.scm.ScmPushResult
import pl.allegro.tech.build.axion.release.domain.scm.ScmPushResultOutcome
import pl.allegro.tech.build.axion.release.domain.scm.ScmService
import pl.allegro.tech.build.axion.release.infrastructure.di.VersionResolutionContext

import java.nio.file.Files
Expand All @@ -12,17 +14,32 @@ import java.nio.file.StandardOpenOption

abstract class ReleaseTask extends BaseAxionTask {

@Input
boolean configurationCacheEnabled

@TaskAction
void release() {
VersionResolutionContext context = resolutionContext()
Releaser releaser = context.releaser()
ScmService service = context.scmService()

Check warning on line 24 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy#L24

Added line #L24 was not covered by tests

ReleaseBranchesConfiguration releaseBranchesConfiguration = new ReleaseBranchesConfiguration(
context.scmService().isReleaseOnlyOnReleaseBranches(),
service.isReleaseOnlyOnReleaseBranches(),

Check warning on line 27 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy#L27

Added line #L27 was not covered by tests
context.repository().currentPosition().getBranch(),
context.scmService().getReleaseBranchNames()
service.getReleaseBranchNames()

Check warning on line 29 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy#L29

Added line #L29 was not covered by tests
)

ScmPushResult result = releaser.releaseAndPush(context.rules(), releaseBranchesConfiguration)
ConfigurationCacheConfiguration configurationCacheConfiguration = new ConfigurationCacheConfiguration(
service.isUpdateProjectVersionAfterRelease(),

Check warning on line 33 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy#L32-L33

Added lines #L32 - L33 were not covered by tests
configurationCacheEnabled,
(version) -> project.setVersion(version)

Check warning on line 35 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy#L35

Added line #L35 was not covered by tests
)

ScmPushResult result = releaser.releaseAndPush(
context.rules(),

Check warning on line 39 in src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/ReleaseTask.groovy#L38-L39

Added lines #L38 - L39 were not covered by tests
releaseBranchesConfiguration,
configurationCacheConfiguration
)

if (result.outcome === ScmPushResultOutcome.FAILED) {
def status = result.failureStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ abstract class VersionConfig extends BaseExtension {
private static final String IGNORE_UNCOMMITTED_CHANGES_PROPERTY = 'release.ignoreUncommittedChanges'
private static final String FORCE_SNAPSHOT_PROPERTY = 'release.forceSnapshot'
private static final String USE_HIGHEST_VERSION_PROPERTY = 'release.useHighestVersion'
private static final String UPDATE_PROJECT_VERSION_AFTER_RELEASE_PROPERTY = 'release.updateProjectVersionAfterRelease'
private static final String LOCAL_ONLY = "release.localOnly"
private static final String FORCE_VERSION_PROPERTY = 'release.version'
private static final String DEPRECATED_FORCE_VERSION_PROPERTY = 'release.forceVersion'
Expand All @@ -43,6 +44,7 @@ abstract class VersionConfig extends BaseExtension {
getLocalOnly().convention(false)
getIgnoreUncommittedChanges().convention(true)
getUseHighestVersion().convention(false)
getUpdateProjectVersionAfterRelease().convention(false)
getUnshallowRepoOnCI().convention(false)
getIgnoreGlobalGitConfig().convention(false)
getReleaseBranchNames().convention(gradlePropertyAsSet(RELEASE_BRANCH_NAMES_PROPERTY).orElse(['master', 'main'] as Set))
Expand Down Expand Up @@ -127,6 +129,9 @@ abstract class VersionConfig extends BaseExtension {
@Internal
abstract Property<Boolean> getUseHighestVersion();

@Internal
abstract Property<Boolean> getUpdateProjectVersionAfterRelease();

Provider<Boolean> ignoreUncommittedChanges() {
gradlePropertyPresent(IGNORE_UNCOMMITTED_CHANGES_PROPERTY)
.orElse(ignoreUncommittedChanges)
Expand All @@ -140,6 +145,10 @@ abstract class VersionConfig extends BaseExtension {
gradlePropertyPresent(USE_HIGHEST_VERSION_PROPERTY).orElse(useHighestVersion)
}

Provider<Boolean> updateProjectVersionAfterRelease() {
gradlePropertyPresent(UPDATE_PROJECT_VERSION_AFTER_RELEASE_PROPERTY).orElse(updateProjectVersionAfterRelease)

Check warning on line 149 in src/main/groovy/pl/allegro/tech/build/axion/release/domain/VersionConfig.groovy

View check run for this annotation

Codecov / codecov/patch

src/main/groovy/pl/allegro/tech/build/axion/release/domain/VersionConfig.groovy#L149

Added line #L149 was not covered by tests
}

Provider<Boolean> localOnly() {
gradlePropertyPresent(LOCAL_ONLY).orElse(localOnly)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class ScmPropertiesFactory {
config.getUnshallowRepoOnCI().get(),
config.getReleaseBranchNames().get(),
config.getReleaseOnlyOnReleaseBranches().get(),
config.getIgnoreGlobalGitConfig().get()
config.getIgnoreGlobalGitConfig().get(),
config.getUpdateProjectVersionAfterRelease().get(),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.github.zafarkhaja.semver.Version;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
import pl.allegro.tech.build.axion.release.ConfigurationCacheConfiguration;
import pl.allegro.tech.build.axion.release.ReleaseBranchesConfiguration;
import pl.allegro.tech.build.axion.release.domain.hooks.ReleaseHooksRunner;
import pl.allegro.tech.build.axion.release.domain.properties.Properties;
Expand All @@ -25,7 +26,11 @@ public Releaser(VersionService versionService, ScmService repository, ReleaseHoo
this.hooksRunner = hooksRunner;
}

public Optional<String> release(Properties properties, ReleaseBranchesConfiguration releaseBranchesConfiguration) {
public Optional<String> release(
Properties properties,
ReleaseBranchesConfiguration releaseBranchesConfiguration,
ConfigurationCacheConfiguration configurationCacheConfiguration
) {
if (releaseBranchesConfiguration.shouldRelease()) {
String message = String.format(
"Release step skipped since 'releaseOnlyOnReleaseBranches' option is set, and '%s' was not in 'releaseBranchNames' list [%s]",
Expand All @@ -42,6 +47,14 @@ public Optional<String> release(Properties properties, ReleaseBranchesConfigurat

Version version = versionContext.getVersion();

if (configurationCacheConfiguration.isUpdateProjectVersionAfterRelease()) {
if (configurationCacheConfiguration.isConfigurationCacheEnabled()) {
throw new IllegalStateException("Configuration cache is enabled and `scmVersion.updateProjectVersionAfterRelease` is set to `true`. " +

Check warning on line 52 in src/main/java/pl/allegro/tech/build/axion/release/domain/Releaser.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/pl/allegro/tech/build/axion/release/domain/Releaser.java#L52

Added line #L52 was not covered by tests
"This is not supported. Set `scmVersion.updateProjectVersionAfterRelease` to `false` and remember to run release task separately.");
}
configurationCacheConfiguration.updateProjectVersion.call(version.toString());

Check warning on line 55 in src/main/java/pl/allegro/tech/build/axion/release/domain/Releaser.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/pl/allegro/tech/build/axion/release/domain/Releaser.java#L55

Added line #L55 was not covered by tests
}

if (versionContext.isSnapshot()) {
String tagName = properties.getTag().getSerialize().apply(properties.getTag(), version.toString());

Expand All @@ -58,8 +71,12 @@ public Optional<String> release(Properties properties, ReleaseBranchesConfigurat
}
}

public ScmPushResult releaseAndPush(Properties rules, ReleaseBranchesConfiguration releaseBranchesConfiguration) {
Optional<String> releasedTagName = release(rules, releaseBranchesConfiguration);
public ScmPushResult releaseAndPush(
Properties rules,
ReleaseBranchesConfiguration releaseBranchesConfiguration,
ConfigurationCacheConfiguration configurationCacheEnabled
) {
Optional<String> releasedTagName = release(rules, releaseBranchesConfiguration, configurationCacheEnabled);

Check warning on line 79 in src/main/java/pl/allegro/tech/build/axion/release/domain/Releaser.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/pl/allegro/tech/build/axion/release/domain/Releaser.java#L79

Added line #L79 was not covered by tests

if (releasedTagName.isEmpty()) {
return new ScmPushResult(ScmPushResultOutcome.SKIPPED, Optional.empty(), Optional.empty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class ScmProperties {
private final Set<String> releaseBranchNames;
private final boolean releaseOnlyOnReleaseBranches;
private final boolean ignoreGlobalGitConfig;
private final boolean updateProjectVersionAfterRelease;

public ScmProperties(
String type,
Expand All @@ -35,7 +36,8 @@ public ScmProperties(
Boolean unshallowRepoOnCI,
Set<String> releaseBranchNames,
boolean releaseOnlyOnReleaseBranches,
boolean ignoreGlobalGitConfig
boolean ignoreGlobalGitConfig,
boolean updateProjectVersionAfterRelease
) {
this.type = type;
this.directory = directory;
Expand All @@ -51,6 +53,7 @@ public ScmProperties(
this.releaseBranchNames = releaseBranchNames;
this.releaseOnlyOnReleaseBranches = releaseOnlyOnReleaseBranches;
this.ignoreGlobalGitConfig = ignoreGlobalGitConfig;
this.updateProjectVersionAfterRelease = updateProjectVersionAfterRelease;
}

public ScmPushOptions pushOptions() {
Expand Down Expand Up @@ -112,4 +115,8 @@ public boolean isReleaseOnlyOnReleaseBranches() {
public boolean isIgnoreGlobalGitConfig() {
return ignoreGlobalGitConfig;
}

public boolean isUpdateProjectVersionAfterRelease() {
return updateProjectVersionAfterRelease;

Check warning on line 120 in src/main/java/pl/allegro/tech/build/axion/release/domain/scm/ScmProperties.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/pl/allegro/tech/build/axion/release/domain/scm/ScmProperties.java#L120

Added line #L120 was not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@ public Set<String> getReleaseBranchNames() {
public boolean isReleaseOnlyOnReleaseBranches(){
return scmProperties.isReleaseOnlyOnReleaseBranches();
}

public boolean isUpdateProjectVersionAfterRelease() {
return scmProperties.isUpdateProjectVersionAfterRelease();

Check warning on line 83 in src/main/java/pl/allegro/tech/build/axion/release/domain/scm/ScmService.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/pl/allegro/tech/build/axion/release/domain/scm/ScmService.java#L83

Added line #L83 was not covered by tests
}
}
Loading

0 comments on commit ce3ce89

Please sign in to comment.