Updates for new sagain api, s-c-build 3.1 and boot 2.6 (#243)

Updates releaser to use spring cloud build 3.1.0

Transitively uses boot 2.6

Updates releaser to use new Sagan API

Fixes gh-196
Fixes gh-194
This commit is contained in:
Spencer Gibb
2022-02-18 14:29:17 -05:00
committed by GitHub
parent 2e7d318f13
commit e83cda4fed
195 changed files with 2914 additions and 4881 deletions

View File

@@ -27,8 +27,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ReleaserApplication extends ReleaserCommandLineRunner {
public ReleaserApplication(SpringReleaser releaser,
ExecutionResultHandler executionResultHandler, Parser parser) {
public ReleaserApplication(SpringReleaser releaser, ExecutionResultHandler executionResultHandler, Parser parser) {
super(releaser, executionResultHandler, parser);
}

View File

@@ -24,8 +24,7 @@ final class SpringCloudBomConstants {
// boot
static final String SPRING_BOOT = "spring-boot";
static final String BOOT_STARTER_ARTIFACT_ID = "spring-boot-starter";
static final String BOOT_STARTER_PARENT_ARTIFACT_ID = BOOT_STARTER_ARTIFACT_ID
+ "-parent";
static final String BOOT_STARTER_PARENT_ARTIFACT_ID = BOOT_STARTER_ARTIFACT_ID + "-parent";
static final String BOOT_DEPENDENCIES_ARTIFACT_ID = "spring-boot-dependencies";
// sc-build

View File

@@ -52,17 +52,15 @@ import static releaser.cloud.buildsystem.SpringCloudBomConstants.STREAM_STARTER_
class SpringCloudMavenBomParser implements CustomBomParser {
private static final Logger log = LoggerFactory
.getLogger(SpringCloudMavenBomParser.class);
private static final Logger log = LoggerFactory.getLogger(SpringCloudMavenBomParser.class);
@Override
public VersionsFromBom parseBom(File root, ReleaserProperties properties) {
VersionsFromBom springCloudBuild = springCloudBuild(root, properties);
VersionsFromBom boot = bootVersion(root, properties);
log.debug("Added Spring Cloud Build [{}] and boot versions [{}]",
springCloudBuild, boot);
return new VersionsFromBomBuilder().thisProjectRoot(root)
.releaserProperties(properties).projects(springCloudBuild, boot).merged();
log.debug("Added Spring Cloud Build [{}] and boot versions [{}]", springCloudBuild, boot);
return new VersionsFromBomBuilder().thisProjectRoot(root).releaserProperties(properties)
.projects(springCloudBuild, boot).merged();
}
private VersionsFromBom springCloudBuild(File root, ReleaserProperties properties) {
@@ -70,8 +68,8 @@ class SpringCloudMavenBomParser implements CustomBomParser {
if (StringUtils.isEmpty(buildVersion)) {
return VersionsFromBom.EMPTY_VERSION;
}
VersionsFromBom scBuild = new VersionsFromBomBuilder().thisProjectRoot(root)
.releaserProperties(properties).merged();
VersionsFromBom scBuild = new VersionsFromBomBuilder().thisProjectRoot(root).releaserProperties(properties)
.merged();
scBuild.add(BUILD_ARTIFACT_ID, buildVersion);
scBuild.add(CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID, buildVersion);
return scBuild;
@@ -88,11 +86,9 @@ class SpringCloudMavenBomParser implements CustomBomParser {
}
Model model = PomReader.pom(root, properties.getPom().getThisTrainBom());
String buildArtifact = model.getParent().getArtifactId();
log.debug("[{}] artifact id is equal to [{}]",
CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID, buildArtifact);
log.debug("[{}] artifact id is equal to [{}]", CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID, buildArtifact);
if (!CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID.equals(buildArtifact)) {
throw new IllegalStateException(
"The pom doesn't have a [spring-cloud-dependencies-parent] artifact id");
throw new IllegalStateException("The pom doesn't have a [spring-cloud-dependencies-parent] artifact id");
}
buildVersion = model.getParent().getVersion();
log.debug("Spring Cloud Build version is equal to [{}]", buildVersion);
@@ -104,8 +100,7 @@ class SpringCloudMavenBomParser implements CustomBomParser {
if (StringUtils.hasText(bootVersion)) {
return bootVersion;
}
String pomWithBootStarterParent = properties.getPom()
.getPomWithBootStarterParent();
String pomWithBootStarterParent = properties.getPom().getPomWithBootStarterParent();
File pom = new File(root, pomWithBootStarterParent);
if (!pom.exists()) {
return "";
@@ -118,8 +113,8 @@ class SpringCloudMavenBomParser implements CustomBomParser {
log.debug("Boot artifact id is equal to [{}]", bootArtifactId);
if (!BOOT_STARTER_PARENT_ARTIFACT_ID.equals(bootArtifactId)) {
if (log.isDebugEnabled()) {
throw new IllegalStateException("The pom doesn't have a ["
+ BOOT_STARTER_PARENT_ARTIFACT_ID + "] artifact id");
throw new IllegalStateException(
"The pom doesn't have a [" + BOOT_STARTER_PARENT_ARTIFACT_ID + "] artifact id");
}
return "";
}
@@ -132,8 +127,8 @@ class SpringCloudMavenBomParser implements CustomBomParser {
return VersionsFromBom.EMPTY_VERSION;
}
log.debug("Boot version is equal to [{}]", bootVersion);
VersionsFromBom versionsFromBom = new VersionsFromBomBuilder()
.thisProjectRoot(root).releaserProperties(properties).merged();
VersionsFromBom versionsFromBom = new VersionsFromBomBuilder().thisProjectRoot(root)
.releaserProperties(properties).merged();
versionsFromBom.add(SPRING_BOOT, bootVersion);
versionsFromBom.add(BOOT_STARTER_PARENT_ARTIFACT_ID, bootVersion);
versionsFromBom.add(BOOT_DEPENDENCIES_ARTIFACT_ID, bootVersion);
@@ -141,8 +136,7 @@ class SpringCloudMavenBomParser implements CustomBomParser {
}
@Override
public Set<Project> setVersion(Set<Project> projects, String projectName,
String version) {
public Set<Project> setVersion(Set<Project> projects, String projectName, String version) {
Set<Project> newProjects = new LinkedHashSet<>(projects);
switch (projectName) {
case SPRING_BOOT:

View File

@@ -35,18 +35,15 @@ import org.springframework.util.StringUtils;
/**
* @author Marcin Grzejszczak
*/
class SpringCloudCustomProjectDocumentationUpdater
implements CustomProjectDocumentationUpdater {
class SpringCloudCustomProjectDocumentationUpdater implements CustomProjectDocumentationUpdater {
private static final Logger log = LoggerFactory
.getLogger(SpringCloudCustomProjectDocumentationUpdater.class);
private static final Logger log = LoggerFactory.getLogger(SpringCloudCustomProjectDocumentationUpdater.class);
private final ProjectGitHandler gitHandler;
private final ReleaserProperties releaserProperties;
SpringCloudCustomProjectDocumentationUpdater(ProjectGitHandler gitHandler,
ReleaserProperties releaserProperties) {
SpringCloudCustomProjectDocumentationUpdater(ProjectGitHandler gitHandler, ReleaserProperties releaserProperties) {
this.gitHandler = gitHandler;
this.releaserProperties = releaserProperties;
}
@@ -60,11 +57,10 @@ class SpringCloudCustomProjectDocumentationUpdater
* used
*/
@Override
public File updateDocsRepoForReleaseTrain(File clonedDocumentationProject,
ProjectVersion currentProject, Projects projects, String bomBranch) {
public File updateDocsRepoForReleaseTrain(File clonedDocumentationProject, ProjectVersion currentProject,
Projects projects, String bomBranch) {
if (!currentProject.projectName.startsWith("spring-cloud")) {
log.info(
"Skipping updating docs for project [{}] that does not start with spring-cloud prefix",
log.info("Skipping updating docs for project [{}] that does not start with spring-cloud prefix",
currentProject.projectName);
return clonedDocumentationProject;
}
@@ -72,12 +68,10 @@ class SpringCloudCustomProjectDocumentationUpdater
ProjectVersion releaseTrainProject = new ProjectVersion(
this.releaserProperties.getMetaRelease().getReleaseTrainProjectName(),
branchToReleaseVersion(bomBranch));
File currentReleaseFolder = new File(clonedDocumentationProject,
currentFolder(releaseTrainProject));
File currentReleaseFolder = new File(clonedDocumentationProject, currentFolder(releaseTrainProject));
// remove the old way
removeAFolderWithRedirection(currentReleaseFolder);
File docsRepo = updateTheDocsRepo(releaseTrainProject, clonedDocumentationProject,
currentReleaseFolder);
File docsRepo = updateTheDocsRepo(releaseTrainProject, clonedDocumentationProject, currentReleaseFolder);
return pushChanges(docsRepo);
}
@@ -89,8 +83,8 @@ class SpringCloudCustomProjectDocumentationUpdater
* used
*/
@Override
public File updateDocsRepoForSingleProject(File clonedDocumentationProject,
ProjectVersion currentProject, Projects projects) {
public File updateDocsRepoForSingleProject(File clonedDocumentationProject, ProjectVersion currentProject,
Projects projects) {
if (!projects.containsProject(currentProject.projectName)) {
log.warn(
"Can't update the documentation repo for project [{}] cause it's not present on the projects list {}",
@@ -98,23 +92,18 @@ class SpringCloudCustomProjectDocumentationUpdater
return clonedDocumentationProject;
}
if (!currentProject.projectName.startsWith("spring-cloud")) {
log.info(
"Skipping updating docs for project [{}] that does not start with spring-cloud prefix",
log.info("Skipping updating docs for project [{}] that does not start with spring-cloud prefix",
currentProject.projectName);
return clonedDocumentationProject;
}
log.info("Updating link to documentation for project [{}]",
currentProject.projectName);
ProjectVersion currentProjectVersion = projects
.forName(currentProject.projectName);
File currentProjectReleaseFolder = new File(clonedDocumentationProject,
currentFolder(currentProjectVersion));
log.info("Updating link to documentation for project [{}]", currentProject.projectName);
ProjectVersion currentProjectVersion = projects.forName(currentProject.projectName);
File currentProjectReleaseFolder = new File(clonedDocumentationProject, currentFolder(currentProjectVersion));
removeAFolderWithRedirection(currentProjectReleaseFolder);
try {
updateTheDocsRepo(currentProjectVersion, clonedDocumentationProject,
currentProjectReleaseFolder);
log.info("Processed [{}] for project with name [{}]",
currentProjectReleaseFolder, currentProjectVersion.projectName);
updateTheDocsRepo(currentProjectVersion, clonedDocumentationProject, currentProjectReleaseFolder);
log.info("Processed [{}] for project with name [{}]", currentProjectReleaseFolder,
currentProjectVersion.projectName);
}
catch (Exception ex) {
log.warn("Exception occurred while trying o update the symlink of a project ["
@@ -140,14 +129,13 @@ class SpringCloudCustomProjectDocumentationUpdater
releaseTrain = currentProjectVersion.isReleaseTrain();
}
catch (IllegalStateException ex) {
log.warn("Exception occurred while trying to resolve if version ["
+ currentProjectVersion + "] is a release train", ex);
log.warn("Exception occurred while trying to resolve if version [" + currentProjectVersion
+ "] is a release train", ex);
releaseTrain = false;
}
// release train -> static/current
// project -> static/spring-cloud-sleuth/current
return releaseTrain ? "current"
: (StringUtils.hasText(projectName) ? projectName : "") + "/current";
return releaseTrain ? "current" : (StringUtils.hasText(projectName) ? projectName : "") + "/current";
}
String linkToVersion(File file) {
@@ -176,33 +164,28 @@ class SpringCloudCustomProjectDocumentationUpdater
return docsRepo;
}
private File updateTheDocsRepo(ProjectVersion projectVersion,
File documentationProject, File currentVersionFolder) {
private File updateTheDocsRepo(ProjectVersion projectVersion, File documentationProject,
File currentVersionFolder) {
try {
String storedVersion = linkToVersion(currentVersionFolder);
String currentVersion = projectVersion.version;
boolean newerVersion = StringUtils.isEmpty(storedVersion)
|| isMoreMature(storedVersion, currentVersion);
boolean newerVersion = StringUtils.isEmpty(storedVersion) || isMoreMature(storedVersion, currentVersion);
if (!newerVersion) {
log.info("Current version [{}] is not newer than the stored one [{}]",
currentVersion, storedVersion);
log.info("Current version [{}] is not newer than the stored one [{}]", currentVersion, storedVersion);
return documentationProject;
}
boolean deleted = Files.deleteIfExists(currentVersionFolder.toPath())
|| FileSystemUtils.deleteRecursively(currentVersionFolder.toPath());
if (deleted) {
log.info("Deleted current version folder link at [{}]",
currentVersionFolder);
log.info("Deleted current version folder link at [{}]", currentVersionFolder);
}
boolean creatingParentDirs = currentVersionFolder.getParentFile().mkdirs();
if (!creatingParentDirs) {
log.warn("Failed to create parent directory of [{}]",
currentVersionFolder);
log.warn("Failed to create parent directory of [{}]", currentVersionFolder);
}
File newTarget = new File(projectVersion.version);
Files.createSymbolicLink(currentVersionFolder.toPath(), newTarget.toPath());
log.info("Updated the link [{}] to point to [{}]",
currentVersionFolder.toPath(),
log.info("Updated the link [{}] to point to [{}]", currentVersionFolder.toPath(),
Files.readSymbolicLink(currentVersionFolder.toPath()));
return commitChanges(currentVersion, documentationProject);
}
@@ -212,8 +195,7 @@ class SpringCloudCustomProjectDocumentationUpdater
}
private boolean isMoreMature(String storedVersion, String currentVersion) {
return new ProjectVersion("project", currentVersion)
.isMoreMature(new ProjectVersion("project", storedVersion));
return new ProjectVersion("project", currentVersion).isMoreMature(new ProjectVersion("project", storedVersion));
}
private String branchToReleaseVersion(String branch) {
@@ -223,8 +205,7 @@ class SpringCloudCustomProjectDocumentationUpdater
return branch;
}
private File commitChanges(String currentVersion, File documentationProject)
throws IOException {
private File commitChanges(String currentVersion, File documentationProject) throws IOException {
log.info("Updated the symbolic links");
this.gitHandler.commit(documentationProject,
"Updating the link to the current version to [" + currentVersion + "]");

View File

@@ -26,10 +26,9 @@ import org.springframework.context.annotation.Configuration;
class SpringCloudDocsConfiguration {
@Bean
SpringCloudCustomProjectDocumentationUpdater springCloudCustomProjectDocumentationUpdater(
ProjectGitHandler handler, ReleaserProperties releaserProperties) {
return new SpringCloudCustomProjectDocumentationUpdater(handler,
releaserProperties);
SpringCloudCustomProjectDocumentationUpdater springCloudCustomProjectDocumentationUpdater(ProjectGitHandler handler,
ReleaserProperties releaserProperties) {
return new SpringCloudCustomProjectDocumentationUpdater(handler, releaserProperties);
}
}

View File

@@ -25,8 +25,7 @@ import org.springframework.context.annotation.Configuration;
class SpringCloudGithubConfiguration {
@Bean
SpringCloudGithubIssues springCloudGithubIssues(
ReleaserProperties releaserProperties) {
SpringCloudGithubIssues springCloudGithubIssues(ReleaserProperties releaserProperties) {
return new SpringCloudGithubIssues(releaserProperties);
}

View File

@@ -47,16 +47,14 @@ class SpringCloudGithubIssues implements CustomGithubIssues {
public void fileIssueInSpringGuides(Projects projects, ProjectVersion version) {
String user = "spring-guides";
String repo = "getting-started-guides";
this.githubIssueFiler.fileAGitHubIssue(user, repo, version, issueTitle(),
guidesIssueText(projects));
this.githubIssueFiler.fileAGitHubIssue(user, repo, version, issueTitle(), guidesIssueText(projects));
}
@Override
public void fileIssueInStartSpringIo(Projects projects, ProjectVersion version) {
String user = "spring-io";
String repo = "start.spring.io";
this.githubIssueFiler.fileAGitHubIssue(user, repo, version, issueTitle(),
startSpringIoIssueText(projects));
this.githubIssueFiler.fileAGitHubIssue(user, repo, version, issueTitle(), startSpringIoIssueText(projects));
}
private String issueTitle() {
@@ -72,21 +70,18 @@ class SpringCloudGithubIssues implements CustomGithubIssues {
}
private String startSpringIoIssueText(Projects projects) {
String springBootVersion = projects.containsProject("spring-boot")
? projects.forName("spring-boot").version : "";
return "Release train ["
+ this.properties.getMetaRelease().getReleaseTrainProjectName()
+ "] in version [" + parsedVersion()
+ "] released with the Spring Boot version [`" + springBootVersion + "`]";
String springBootVersion = projects.containsProject("spring-boot") ? projects.forName("spring-boot").version
: "";
return "Release train [" + this.properties.getMetaRelease().getReleaseTrainProjectName() + "] in version ["
+ parsedVersion() + "] released with the Spring Boot version [`" + springBootVersion + "`]";
}
private String guidesIssueText(Projects projects) {
StringBuilder builder = new StringBuilder().append("Release train [")
.append(this.properties.getMetaRelease().getReleaseTrainProjectName())
.append("] in version [").append(parsedVersion())
.append("] released with the following projects:").append("\n\n");
projects.forEach(project -> builder.append(project.projectName).append(" : ")
.append("`").append(project.version).append("`").append("\n"));
.append(this.properties.getMetaRelease().getReleaseTrainProjectName()).append("] in version [")
.append(parsedVersion()).append("] released with the following projects:").append("\n\n");
projects.forEach(project -> builder.append(project.projectName).append(" : ").append("`")
.append(project.version).append("`").append("\n"));
return builder.toString();
}

View File

@@ -27,8 +27,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@SpringBootTest(
classes = { ReleaserApplicationTests.Config.class, ReleaserApplication.class },
@SpringBootTest(classes = { ReleaserApplicationTests.Config.class, ReleaserApplication.class },
properties = { "releaser.sagan.update-sagan=false" })
class ReleaserApplicationTests {

View File

@@ -32,17 +32,13 @@ public class SpringCloudReleaserProperties {
public static ReleaserProperties get() {
try {
File releaserConfig = new File(SpringCloudReleaserProperties.class
.getResource("/application.yml").toURI());
File releaserConfig = new File(SpringCloudReleaserProperties.class.getResource("/application.yml").toURI());
YamlPropertiesFactoryBean yamlProcessor = new YamlPropertiesFactoryBean();
yamlProcessor.setResources(new FileSystemResource(releaserConfig));
Properties properties = yamlProcessor.getObject();
ReleaserProperties releaserProperties = new Binder(
new MapConfigurationPropertySource(properties.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey().toString(),
e -> e.getValue().toString()))))
.bind("releaser", ReleaserProperties.class)
.get();
ReleaserProperties releaserProperties = new Binder(new MapConfigurationPropertySource(properties.entrySet()
.stream().collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().toString()))))
.bind("releaser", ReleaserProperties.class).get();
return releaserProperties;
}
catch (URISyntaxException e) {

View File

@@ -37,80 +37,59 @@ public class SpringCloudCustomMavenBomTests {
@Test
public void should_add_boot_to_versions_when_version_is_created() {
List<CustomBomParser> bomParsers = Collections
.singletonList(new SpringCloudMavenBomParser());
List<CustomBomParser> bomParsers = Collections.singletonList(new SpringCloudMavenBomParser());
VersionsFromBom customVersionsFromBom = new VersionsFromBomBuilder()
.releaserProperties(SpringCloudReleaserProperties.get())
.parsers(bomParsers).projects(springCloudBuildProjects())
.retrieveFromBom();
.releaserProperties(SpringCloudReleaserProperties.get()).parsers(bomParsers)
.projects(springCloudBuildProjects()).retrieveFromBom();
customVersionsFromBom.setVersion("spring-boot", "1.2.3.RELEASE");
then(customVersionsFromBom.versionForProject("spring-boot"))
.isEqualTo("1.2.3.RELEASE");
then(customVersionsFromBom.versionForProject("spring-boot-starter-parent"))
.isEqualTo("1.2.3.RELEASE");
then(customVersionsFromBom.versionForProject("spring-boot-dependencies"))
.isEqualTo("1.2.3.RELEASE");
then(customVersionsFromBom.versionForProject("spring-boot")).isEqualTo("1.2.3.RELEASE");
then(customVersionsFromBom.versionForProject("spring-boot-starter-parent")).isEqualTo("1.2.3.RELEASE");
then(customVersionsFromBom.versionForProject("spring-boot-dependencies")).isEqualTo("1.2.3.RELEASE");
}
@Test
public void should_update_projects_for_boot() {
VersionsFromBom versionsFromBom = mixedVersions().setVersion("spring-boot",
"3.0.0");
VersionsFromBom versionsFromBom = mixedVersions().setVersion("spring-boot", "3.0.0");
then(versionsFromBom.versionForProject("spring-boot")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-starter-parent"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-dependencies"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-starter-parent")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-dependencies")).isEqualTo("3.0.0");
versionsFromBom = mixedVersions().setVersion("spring-boot-starter-parent",
"3.0.0");
versionsFromBom = mixedVersions().setVersion("spring-boot-starter-parent", "3.0.0");
then(versionsFromBom.versionForProject("spring-boot")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-starter-parent"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-dependencies"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-starter-parent")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-dependencies")).isEqualTo("3.0.0");
versionsFromBom = mixedVersions().setVersion("spring-boot-dependencies", "3.0.0");
then(versionsFromBom.versionForProject("spring-boot")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-starter-parent"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-dependencies"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-starter-parent")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-boot-dependencies")).isEqualTo("3.0.0");
}
@Test
public void should_update_projects_for_build() {
VersionsFromBom versionsFromBom = mixedVersions().setVersion("spring-cloud-build",
"3.0.0");
VersionsFromBom versionsFromBom = mixedVersions().setVersion("spring-cloud-build", "3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-build")).isEqualTo("3.0.0");
versionsFromBom = mixedVersions().setVersion("spring-cloud-build", "3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-dependencies-parent"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-dependencies"))
.isEqualTo("Greenwich.RELEASE");
then(versionsFromBom.versionForProject("spring-cloud-dependencies-parent")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-dependencies")).isEqualTo("Greenwich.RELEASE");
versionsFromBom = mixedVersions().setVersion("spring-cloud-dependencies-parent",
"3.0.0");
versionsFromBom = mixedVersions().setVersion("spring-cloud-dependencies-parent", "3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-build")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-dependencies-parent"))
.isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-dependencies"))
.isEqualTo("Greenwich.RELEASE");
then(versionsFromBom.versionForProject("spring-cloud-dependencies-parent")).isEqualTo("3.0.0");
then(versionsFromBom.versionForProject("spring-cloud-dependencies")).isEqualTo("Greenwich.RELEASE");
}
private VersionsFromBom mixedVersions() {
return new VersionsFromBomBuilder()
.releaserProperties(SpringCloudReleaserProperties.get())
.parsers(Collections.singletonList(new SpringCloudMavenBomParser()))
.projects(mixedProjects()).merged();
return new VersionsFromBomBuilder().releaserProperties(SpringCloudReleaserProperties.get())
.parsers(Collections.singletonList(new SpringCloudMavenBomParser())).projects(mixedProjects()).merged();
}
Set<Project> springCloudBuildProjects() {

View File

@@ -57,31 +57,26 @@ public class SpringCloudMavenBomParserTests {
this.tmpFolder = this.tmp.newFolder();
TestUtils.prepareLocalRepo();
FileSystemUtils.copyRecursively(file("/projects"), this.tmpFolder);
this.springCloudReleaseProject = new File(this.tmpFolder,
"/spring-cloud-release");
this.springCloudReleaseProject = new File(this.tmpFolder, "/spring-cloud-release");
}
private File file(String relativePath) throws URISyntaxException {
return new File(
SpringCloudMavenBomParserTests.class.getResource(relativePath).toURI());
return new File(SpringCloudMavenBomParserTests.class.getResource(relativePath).toURI());
}
@Test
public void should_throw_exception_when_null_is_passed_to_boot() {
this.properties.getPom().setPomWithBootStarterParent(null);
this.properties.getPom().setThisTrainBom(null);
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
thenThrownBy(() -> parser.versionsFromBom(this.springCloudReleaseProject))
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Pom is not present");
.isInstanceOf(IllegalStateException.class).hasMessageContaining("Pom is not present");
}
@Test
public void should_populate_sc_release_version() {
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
String scReleaseVersion = parser.versionsFromBom(this.springCloudReleaseProject)
.versionForProject("spring-cloud-release");
@@ -91,22 +86,18 @@ public class SpringCloudMavenBomParserTests {
@Test
public void should_populate_boot_version() {
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
String bootVersion = parser.versionsFromBom(this.springCloudReleaseProject)
.versionForProject("spring-boot");
String bootVersion = parser.versionsFromBom(this.springCloudReleaseProject).versionForProject("spring-boot");
then(bootVersion).isNotBlank();
}
@Test
public void should_throw_exception_when_cloud_pom_is_missing() {
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
thenThrownBy(() -> parser.versionsFromBom(new File(".")))
.isInstanceOf(IllegalStateException.class)
thenThrownBy(() -> parser.versionsFromBom(new File("."))).isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Pom is not present");
}
@@ -114,54 +105,44 @@ public class SpringCloudMavenBomParserTests {
public void should_throw_exception_when_null_is_passed_to_cloud() {
this.properties.getPom().setPomWithBootStarterParent(null);
this.properties.getPom().setThisTrainBom(null);
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
thenThrownBy(() -> parser.versionsFromBom(this.springCloudReleaseProject))
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Pom is not present");
.isInstanceOf(IllegalStateException.class).hasMessageContaining("Pom is not present");
}
@Test
public void should_throw_exception_when_cloud_version_is_missing_in_pom() {
this.properties.getPom().setPomWithBootStarterParent("pom.xml");
this.properties.getPom().setThisTrainBom("pom.xml");
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
thenThrownBy(() -> parser.versionsFromBom(this.springCloudReleaseProject))
.isInstanceOf(IllegalStateException.class).hasMessageContaining(
"The pom doesn't have a [spring-cloud-dependencies-parent] artifact id");
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("The pom doesn't have a [spring-cloud-dependencies-parent] artifact id");
}
@Test
public void should_populate_cloud_version() {
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
VersionsFromBom cloudVersionsFromBom = parser
.versionsFromBom(this.springCloudReleaseProject);
VersionsFromBom cloudVersionsFromBom = parser.versionsFromBom(this.springCloudReleaseProject);
thenAllCloudVersionsSet(cloudVersionsFromBom);
}
private void thenAllCloudVersionsSet(VersionsFromBom cloudVersionsFromBom) {
Arrays.asList("spring-cloud-bus", "spring-cloud-contract",
"spring-cloud-cloudfoundry", "spring-cloud-commons",
"spring-cloud-config", "spring-cloud-netflix", "spring-cloud-security",
"spring-cloud-consul", "spring-cloud-sleuth", "spring-cloud-stream",
"spring-cloud-task", "spring-cloud-vault", "spring-cloud-zookeeper")
.forEach(s -> then(cloudVersionsFromBom.versionForProject(s))
.isNotBlank());
Arrays.asList("spring-cloud-bus", "spring-cloud-contract", "spring-cloud-cloudfoundry", "spring-cloud-commons",
"spring-cloud-config", "spring-cloud-netflix", "spring-cloud-security", "spring-cloud-consul",
"spring-cloud-sleuth", "spring-cloud-stream", "spring-cloud-task", "spring-cloud-vault",
"spring-cloud-zookeeper").forEach(s -> then(cloudVersionsFromBom.versionForProject(s)).isNotBlank());
}
@Test
public void should_populate_boot_and_cloud_version() {
BomParser parser = MavenBomParserAccessor.bomParser(this.properties,
new SpringCloudMavenBomParser());
BomParser parser = MavenBomParserAccessor.bomParser(this.properties, new SpringCloudMavenBomParser());
VersionsFromBom cloudVersionsFromBom = parser
.versionsFromBom(this.springCloudReleaseProject);
VersionsFromBom cloudVersionsFromBom = parser.versionsFromBom(this.springCloudReleaseProject);
then(cloudVersionsFromBom.versionForProject("spring-boot")).isNotBlank();
then(cloudVersionsFromBom.versionForProject("spring-cloud-build")).isNotBlank();

View File

@@ -36,41 +36,31 @@ public class SpringCloudProjectPomUpdaterTests {
public void should_convert_fixed_versions_to_updated_fixed_versions() {
ReleaserProperties properties = SpringCloudReleaserProperties.get();
properties.getFixedVersions().put("spring-cloud-task", "2.0.0.RELEASE");
properties.getFixedVersions().put("spring-cloud-openfeign",
"2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-openfeign", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-consul", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-zookeeper",
"2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-zookeeper", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-stream", "Elmhurst.RELEASE");
properties.getFixedVersions().put("spring-cloud-config", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-cloudfoundry",
"2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-cloudfoundry", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-netflix", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-vault", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-security",
"2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-security", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-commons", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-sleuth", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-aws", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-contract",
"2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-release",
"Finchley.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-contract", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-release", "Finchley.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-build", "2.0.3.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-bus", "2.0.1.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-function",
"1.0.0.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-starter-build",
"Finchley.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-function", "1.0.0.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-cloud-starter-build", "Finchley.BUILD-SNAPSHOT");
properties.getFixedVersions().put("spring-boot", "2.0.3.RELEASE");
properties.getFixedVersions().put("spring-cloud-gateway", "2.0.1.BUILD-SNAPSHOT");
ProjectPomUpdater updater = new ProjectPomUpdater(properties,
Collections.singletonList(MavenBomParserAccessor.bomParser(properties,
new SpringCloudMavenBomParser())));
ProjectPomUpdater updater = new ProjectPomUpdater(properties, Collections
.singletonList(MavenBomParserAccessor.bomParser(properties, new SpringCloudMavenBomParser())));
Map<String, String> fixedVersions = updater.fixedVersions().stream()
.collect(Collectors.toMap(projectVersion -> projectVersion.projectName,
projectVersion -> projectVersion.version));
Map<String, String> fixedVersions = updater.fixedVersions().stream().collect(Collectors
.toMap(projectVersion -> projectVersion.projectName, projectVersion -> projectVersion.version));
BDDAssertions.then(fixedVersions).containsEntry("spring-boot", "2.0.3.RELEASE")
.containsEntry("spring-boot-dependencies", "2.0.3.RELEASE")

View File

@@ -70,23 +70,17 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests {
.getResource("/projects/spring-cloud-static").toURI());
TestUtils.prepareLocalRepo();
FileSystemUtils.copyRecursively(file("/projects"), this.tmpFolder);
this.properties.getGit().setDocumentationUrl(
file("/projects/spring-cloud-static/").toURI().toString());
this.properties.getGit().setDocumentationUrl(file("/projects/spring-cloud-static/").toURI().toString());
this.handler = new ProjectGitHandler(this.properties);
this.clonedDocProject = this.handler.cloneDocumentationProject();
this.gitHubHandler = new ProjectGitHubHandler(this.properties,
Collections.singletonList(
SpringCloudGithubIssuesAccessor.springCloud(this.properties)));
Collections.singletonList(SpringCloudGithubIssuesAccessor.springCloud(this.properties)));
}
@NotNull
private DocumentationUpdater projectDocumentationUpdater(
ReleaserProperties properties) {
return new DocumentationUpdater(this.handler, properties,
templateGenerator(properties),
Collections.singletonList(
new SpringCloudCustomProjectDocumentationUpdater(this.handler,
properties)));
private DocumentationUpdater projectDocumentationUpdater(ReleaserProperties properties) {
return new DocumentationUpdater(this.handler, properties, templateGenerator(properties),
Collections.singletonList(new SpringCloudCustomProjectDocumentationUpdater(this.handler, properties)));
}
@NotNull
@@ -97,56 +91,43 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests {
@Test
public void should_not_update_current_version_in_the_docs_if_current_release_starts_with_v_and_then_lower_letter_than_the_stored_release()
throws URISyntaxException, IOException {
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release",
"Finchley.SR33");
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release", "Finchley.SR33");
ReleaserProperties properties = new ReleaserProperties();
properties.getGit().setDocumentationUrl(
file("/projects/spring-cloud-static/").toURI().toString());
properties.getGit().setDocumentationUrl(file("/projects/spring-cloud-static/").toURI().toString());
File updatedDocs = new SpringCloudCustomProjectDocumentationUpdater(
new ProjectGitHandler(properties), properties)
.updateDocsRepoForReleaseTrain(this.clonedDocProject,
releaseTrainVersion, projects(), "vFinchley.SR33");
File updatedDocs = new SpringCloudCustomProjectDocumentationUpdater(new ProjectGitHandler(properties),
properties).updateDocsRepoForReleaseTrain(this.clonedDocProject, releaseTrainVersion, projects(),
"vFinchley.SR33");
BDDAssertions.then(new File(updatedDocs, "current/index.html").toPath())
.doesNotExist();
BDDAssertions.then(new File(updatedDocs, "current/index.html").toPath()).doesNotExist();
Path current = new File(updatedDocs, "current/").toPath();
BDDAssertions.then(current).isSymbolicLink();
BDDAssertions.then(Files.readSymbolicLink(current).toString())
.isEqualTo("Finchley.SR33");
BDDAssertions.then(Files.readSymbolicLink(current).toString()).isEqualTo("Finchley.SR33");
releaseTrainVersion = new ProjectVersion("spring-cloud-release", "Angel.SR33");
properties = new ReleaserProperties();
properties.getGit().setDocumentationUrl(
file("/projects/spring-cloud-static/").toURI().toString());
properties.getGit().setDocumentationUrl(file("/projects/spring-cloud-static/").toURI().toString());
updatedDocs = new SpringCloudCustomProjectDocumentationUpdater(
new ProjectGitHandler(properties), properties)
.updateDocsRepoForReleaseTrain(this.clonedDocProject,
releaseTrainVersion, projects(), "vAngel.SR33");
updatedDocs = new SpringCloudCustomProjectDocumentationUpdater(new ProjectGitHandler(properties), properties)
.updateDocsRepoForReleaseTrain(this.clonedDocProject, releaseTrainVersion, projects(), "vAngel.SR33");
BDDAssertions.then(new File(updatedDocs, "current/index.html").toPath())
.doesNotExist();
BDDAssertions.then(new File(updatedDocs, "current/index.html").toPath()).doesNotExist();
current = new File(updatedDocs, "current/").toPath();
BDDAssertions.then(current).isSymbolicLink();
BDDAssertions.then(Files.readSymbolicLink(current).toString())
.isNotEqualTo("Angel.SR33");
BDDAssertions.then(Files.readSymbolicLink(current).toString()).isNotEqualTo("Angel.SR33");
}
@Test
public void should_not_commit_if_the_same_version_is_already_there() {
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release",
"Dalston.SR3");
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release", "Dalston.SR3");
ReleaserProperties properties = new ReleaserProperties();
properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString());
ProjectGitHandler handler = BDDMockito.spy(new ProjectGitHandler(properties));
new SpringCloudCustomProjectDocumentationUpdater(handler, properties)
.updateDocsRepoForReleaseTrain(this.clonedDocProject, releaseTrainVersion,
projects(), "vDalston.SR3");
.updateDocsRepoForReleaseTrain(this.clonedDocProject, releaseTrainVersion, projects(), "vDalston.SR3");
BDDMockito.then(handler).should(BDDMockito.never())
.commit(BDDMockito.any(File.class), BDDMockito.anyString());
BDDMockito.then(handler).should(BDDMockito.never()).commit(BDDMockito.any(File.class), BDDMockito.anyString());
}
@Test
@@ -157,11 +138,9 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests {
ProjectGitHandler handler = BDDMockito.spy(new ProjectGitHandler(properties));
new SpringCloudCustomProjectDocumentationUpdater(handler, properties)
.updateDocsRepoForReleaseTrain(this.clonedDocProject, springBootVersion,
bootProject(), "vDalston.SR3");
.updateDocsRepoForReleaseTrain(this.clonedDocProject, springBootVersion, bootProject(), "vDalston.SR3");
BDDMockito.then(handler).should(BDDMockito.never())
.commit(BDDMockito.any(File.class), BDDMockito.anyString());
BDDMockito.then(handler).should(BDDMockito.never()).commit(BDDMockito.any(File.class), BDDMockito.anyString());
}
@Test
@@ -172,37 +151,30 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests {
ProjectGitHandler handler = BDDMockito.spy(new ProjectGitHandler(properties));
new SpringCloudCustomProjectDocumentationUpdater(handler, properties)
.updateDocsRepoForSingleProject(this.clonedDocProject, springBootVersion,
bootProject());
.updateDocsRepoForSingleProject(this.clonedDocProject, springBootVersion, bootProject());
BDDMockito.then(handler).should(BDDMockito.never())
.commit(BDDMockito.any(File.class), BDDMockito.anyString());
BDDMockito.then(handler).should(BDDMockito.never()).commit(BDDMockito.any(File.class), BDDMockito.anyString());
}
@Test
public void should_not_update_current_version_in_the_docs_if_current_release_starts_with_lower_letter_than_the_stored_release()
throws IOException {
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release",
"Angel.SR33");
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release", "Angel.SR33");
ReleaserProperties properties = new ReleaserProperties();
properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString());
File updatedDocs = new SpringCloudCustomProjectDocumentationUpdater(
new ProjectGitHandler(properties), properties)
.updateDocsRepoForReleaseTrain(this.clonedDocProject,
releaseTrainVersion, projects(), "Angel.SR33");
File updatedDocs = new SpringCloudCustomProjectDocumentationUpdater(new ProjectGitHandler(properties),
properties).updateDocsRepoForReleaseTrain(this.clonedDocProject, releaseTrainVersion, projects(),
"Angel.SR33");
BDDAssertions.then(new File(updatedDocs, "current/index.html").toPath())
.doesNotExist();
BDDAssertions.then(new File(updatedDocs, "current/index.html").toPath()).doesNotExist();
Path current = new File(updatedDocs, "current/").toPath();
BDDAssertions.then(current).isSymbolicLink();
BDDAssertions.then(Files.readSymbolicLink(current).toString())
.isNotEqualTo("Angel.SR33");
BDDAssertions.then(Files.readSymbolicLink(current).toString()).isNotEqualTo("Angel.SR33");
}
private File file(String relativePath) throws URISyntaxException {
return new File(SpringCloudCustomProjectDocumentationUpdater.class
.getResource(relativePath).toURI());
return new File(SpringCloudCustomProjectDocumentationUpdater.class.getResource(relativePath).toURI());
}
private Projects projects() {

View File

@@ -36,8 +36,7 @@ public final class TestUtils {
prepareLocalRepo("target/test-classes/projects/", "spring-cloud-static");
}
private static void prepareLocalRepo(String buildDir, String repoPath)
throws IOException {
private static void prepareLocalRepo(String buildDir, String repoPath) throws IOException {
File dotGit = new File(buildDir + repoPath + "/.git");
File git = new File(buildDir + repoPath + "/git");
if (git.exists()) {

View File

@@ -22,8 +22,7 @@ import releaser.internal.github.CustomGithubIssues;
public class SpringCloudGithubIssuesAccessor {
public static CustomGithubIssues springCloud(Github github,
ReleaserProperties releaserProperties) {
public static CustomGithubIssues springCloud(Github github, ReleaserProperties releaserProperties) {
return new SpringCloudGithubIssues(github, releaserProperties);
}

View File

@@ -74,14 +74,12 @@ public class SpringCloudGithubIssuesTests {
Github github = BDDMockito.mock(Github.class);
CustomGithubIssues githubIssues = new SpringCloudGithubIssues(github, properties);
githubIssues
.fileIssueInSpringGuides(
new Projects(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"),
new ProjectVersion("spring-cloud-build",
"2.0.0.BUILD-SNAPSHOT")),
new ProjectVersion("sc-release", "Edgware.BUILD-SNAPSHOT"));
githubIssues.fileIssueInSpringGuides(
new Projects(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"),
new ProjectVersion("spring-cloud-build", "2.0.0.BUILD-SNAPSHOT")),
new ProjectVersion("sc-release", "Edgware.BUILD-SNAPSHOT"));
BDDMockito.then(github).shouldHaveZeroInteractions();
BDDMockito.then(github).shouldHaveNoInteractions();
}
@Test
@@ -92,20 +90,18 @@ public class SpringCloudGithubIssuesTests {
issues.fileIssueInSpringGuides(
new Projects(new ProjectVersion("spring-cloud-foo", "1.0.0.RELEASE"),
new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"),
new ProjectVersion("bar", "2.0.0.RELEASE"),
new ProjectVersion("baz", "3.0.0.RELEASE")),
new ProjectVersion("bar", "2.0.0.RELEASE"), new ProjectVersion("baz", "3.0.0.RELEASE")),
new ProjectVersion("sc-release", "Edgware.RELEASE"));
Issue issue = this.github.repos()
.get(new Coordinates.Simple("spring-guides", "getting-started-guides"))
Issue issue = this.github.repos().get(new Coordinates.Simple("spring-guides", "getting-started-guides"))
.issues().get(1);
then(issue.exists()).isTrue();
Issue.Smart smartIssue = new Issue.Smart(issue);
then(smartIssue.title()).isEqualTo("Upgrade to Spring Cloud Edgware.RELEASE");
then(smartIssue.body()).contains(
"Release train [spring-cloud-release] in version [Edgware.RELEASE] released with the following projects")
.contains("spring-cloud-foo : `1.0.0.RELEASE`")
.contains("bar : `2.0.0.RELEASE`").contains("baz : `3.0.0.RELEASE`");
.contains("spring-cloud-foo : `1.0.0.RELEASE`").contains("bar : `2.0.0.RELEASE`")
.contains("baz : `3.0.0.RELEASE`");
}
@Test
@@ -114,16 +110,13 @@ public class SpringCloudGithubIssuesTests {
CustomGithubIssues issues = new SpringCloudGithubIssues(github, properties);
thenThrownBy(() -> issues.fileIssueInSpringGuides(
new Projects(Collections.singletonList(
new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"))),
nonGaSleuthProject())).isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining(
"You have to pass Github OAuth token for milestone closing to be operational");
new Projects(Collections.singletonList(new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"))),
nonGaSleuthProject())).isInstanceOf(IllegalArgumentException.class).hasMessageContaining(
"You have to pass Github OAuth token for milestone closing to be operational");
}
@Test
public void should_not_do_anything_for_non_release_train_version_when_updating_startspringio()
throws IOException {
public void should_not_do_anything_for_non_release_train_version_when_updating_startspringio() throws IOException {
setupStartSpringIo();
Github github = BDDMockito.mock(Github.class);
CustomGithubIssues issues = new SpringCloudGithubIssues(github, properties);
@@ -133,27 +126,21 @@ public class SpringCloudGithubIssuesTests {
new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE")),
new ProjectVersion("sc-release", "Edgware.BUILD-SNAPSHOT"));
BDDMockito.then(github).shouldHaveZeroInteractions();
BDDMockito.then(github).shouldHaveNoInteractions();
}
@Test
public void should_file_an_issue_for_release_version_when_updating_startspringio()
throws IOException {
public void should_file_an_issue_for_release_version_when_updating_startspringio() throws IOException {
setupStartSpringIo();
CustomGithubIssues issues = new SpringCloudGithubIssues(github, properties);
properties.getPom().setBranch("vEdgware.RELEASE");
issues.fileIssueInStartSpringIo(
new Projects(new ProjectVersion("spring-cloud-foo", "1.0.0.RELEASE"),
new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"),
new ProjectVersion("bar", "2.0.0.RELEASE"),
new ProjectVersion("baz", "3.0.0.RELEASE"),
new ProjectVersion("spring-boot", "1.2.3.RELEASE")),
issues.fileIssueInStartSpringIo(new Projects(new ProjectVersion("spring-cloud-foo", "1.0.0.RELEASE"),
new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"), new ProjectVersion("bar", "2.0.0.RELEASE"),
new ProjectVersion("baz", "3.0.0.RELEASE"), new ProjectVersion("spring-boot", "1.2.3.RELEASE")),
new ProjectVersion("sc-release", "Edgware.RELEASE"));
Issue issue = this.github.repos()
.get(new Coordinates.Simple("spring-io", "start.spring.io")).issues()
.get(1);
Issue issue = this.github.repos().get(new Coordinates.Simple("spring-io", "start.spring.io")).issues().get(1);
then(issue.exists()).isTrue();
Issue.Smart smartIssue = new Issue.Smart(issue);
then(smartIssue.title()).isEqualTo("Upgrade to Spring Cloud Edgware.RELEASE");
@@ -162,23 +149,19 @@ public class SpringCloudGithubIssuesTests {
}
@Test
public void should_throw_exception_when_no_token_was_passed_when_updating_startspringio()
throws IOException {
public void should_throw_exception_when_no_token_was_passed_when_updating_startspringio() throws IOException {
setupStartSpringIo();
properties.getGit().setOauthToken("");
CustomGithubIssues issues = new SpringCloudGithubIssues(github, properties);
thenThrownBy(() -> issues.fileIssueInStartSpringIo(
new Projects(Collections.singletonList(
new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"))),
nonGaSleuthProject())).isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining(
"You have to pass Github OAuth token for milestone closing to be operational");
new Projects(Collections.singletonList(new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"))),
nonGaSleuthProject())).isInstanceOf(IllegalArgumentException.class).hasMessageContaining(
"You have to pass Github OAuth token for milestone closing to be operational");
}
private Repo createGettingStartedGuides(MkGithub github) throws IOException {
return github.repos()
.create(new Repos.RepoCreate("getting-started-guides", false));
return github.repos().create(new Repos.RepoCreate("getting-started-guides", false));
}
private Repo createStartSpringIo(MkGithub github) throws IOException {

View File

@@ -36,10 +36,10 @@ public class AbstractSpringCloudAcceptanceTests extends AbstractSpringAcceptance
@Before
public void setupCloud() throws Exception {
this.temporaryFolder = this.tmp.newFolder();
this.springCloudConsulProject = new File(AbstractSpringAcceptanceTests.class
.getResource("/projects/spring-cloud-consul").toURI());
this.springCloudBuildProject = new File(AbstractSpringAcceptanceTests.class
.getResource("/projects/spring-cloud-build").toURI());
this.springCloudConsulProject = new File(
AbstractSpringAcceptanceTests.class.getResource("/projects/spring-cloud-consul").toURI());
this.springCloudBuildProject = new File(
AbstractSpringAcceptanceTests.class.getResource("/projects/spring-cloud-build").toURI());
TestUtils.prepareLocalRepo();
FileSystemUtils.copyRecursively(file("/projects/"), this.temporaryFolder);
}
@@ -51,12 +51,9 @@ public class AbstractSpringCloudAcceptanceTests extends AbstractSpringAcceptance
public void thenAllDryRunStepsWereExecutedForEachProject(
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler) {
nonAssertingTestProjectGitHandler.clonedProjects.stream()
.filter(f -> !f.getName().contains("angel")
&& !f.getName().equals("spring-cloud"))
.forEach(project -> {
then(Arrays.asList("spring-cloud-starter-build",
"spring-cloud-consul"))
.contains(pom(project).getArtifactId());
.filter(f -> !f.getName().contains("angel") && !f.getName().equals("spring-cloud")).forEach(project -> {
then(Arrays.asList("spring-cloud-starter-build", "spring-cloud-consul"))
.contains(pom(project).getArtifactId());
then(new File("/tmp/executed_build")).exists();
then(new File("/tmp/executed_deploy")).doesNotExist();
then(new File("/tmp/executed_docs")).doesNotExist();

View File

@@ -24,8 +24,7 @@ import releaser.internal.spring.meta.AbstractSpringMetaReleaseAcceptanceTests;
import static org.assertj.core.api.BDDAssertions.then;
public class AbstractSpringCloudMetaAcceptanceTests
extends AbstractSpringMetaReleaseAcceptanceTests {
public class AbstractSpringCloudMetaAcceptanceTests extends AbstractSpringMetaReleaseAcceptanceTests {
public File springCloudConsulProject;
@@ -34,11 +33,9 @@ public class AbstractSpringCloudMetaAcceptanceTests
@Before
public void setupCloud() throws Exception {
this.springCloudConsulProject = new File(
AbstractSpringCloudMetaAcceptanceTests.class
.getResource("/projects/spring-cloud-consul").toURI());
AbstractSpringCloudMetaAcceptanceTests.class.getResource("/projects/spring-cloud-consul").toURI());
this.springCloudBuildProject = new File(
AbstractSpringCloudMetaAcceptanceTests.class
.getResource("/projects/spring-cloud-build").toURI());
AbstractSpringCloudMetaAcceptanceTests.class.getResource("/projects/spring-cloud-build").toURI());
}
public void consulPomParentVersionIsEqualTo(File project, String expected) {
@@ -48,12 +45,9 @@ public class AbstractSpringCloudMetaAcceptanceTests
public void thenAllDryRunStepsWereExecutedForEachProject(
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler) {
nonAssertingTestProjectGitHandler.clonedProjects.stream()
.filter(f -> !f.getName().contains("angel")
&& !f.getName().equals("spring-cloud"))
.forEach(project -> {
then(Arrays.asList("spring-cloud-starter-build",
"spring-cloud-consul"))
.contains(pom(project).getArtifactId());
.filter(f -> !f.getName().contains("angel") && !f.getName().equals("spring-cloud")).forEach(project -> {
then(Arrays.asList("spring-cloud-starter-build", "spring-cloud-consul"))
.contains(pom(project).getArtifactId());
then(new File("/tmp/executed_build")).exists();
then(new File("/tmp/executed_deploy")).doesNotExist();
then(new File("/tmp/executed_docs")).doesNotExist();

View File

@@ -54,18 +54,18 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.util.FileSystemUtils;
import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.BDDMockito.given;
/**
* @author Marcin Grzejszczak
*/
public class SpringMetaReleaseAcceptanceTests
extends AbstractSpringCloudMetaAcceptanceTests {
public class SpringMetaReleaseAcceptanceTests extends AbstractSpringCloudMetaAcceptanceTests {
@Test
public void should_perform_a_meta_release_of_sc_release_and_consul()
throws Exception {
public void should_perform_a_meta_release_of_sc_release_and_consul() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
@@ -73,21 +73,18 @@ public class SpringMetaReleaseAcceptanceTests
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(defaultRunner(),
properties("debug=true").properties("test.metarelease=true")
.properties(metaReleaseArgs(project).bomBranch("vGreenwich.SR2")
.addFixedVersions(edgwareSr10()).build()),
properties("debugx=true").properties("test.metarelease=true").properties(
metaReleaseArgs(project).bomBranch("vGreenwich.SR2").addFixedVersions(edgwareSr10()).build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
.getBean(NonAssertingTestProjectGitHandler.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
PostReleaseActions postReleaseActions = context.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().metaRelease(true).options());
ExecutionResult result = releaser.release(new OptionsBuilder().metaRelease(true).options());
// print results
testExecutionResultHandler.accept(result);
@@ -97,46 +94,41 @@ public class SpringMetaReleaseAcceptanceTests
// consul, release
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(2);
// don't want to verify the docs
thenAllStepsWereExecutedForEachProject(
nonAssertingTestProjectGitHandler);
thenAllStepsWereExecutedForEachProject(nonAssertingTestProjectGitHandler);
thenSaganWasCalled(saganUpdater);
then(clonedProject(nonAssertingTestProjectGitHandler,
"spring-cloud-consul").tagList().call()).extracting("name")
.contains("refs/tags/v5.3.5.RELEASE");
then(clonedProject(nonAssertingTestProjectGitHandler, "spring-cloud-consul").tagList().call())
.extracting("name").contains("refs/tags/v5.3.5.RELEASE");
thenRunUpdatedTestsWereCalled(postReleaseActions);
thenUpdateReleaseTrainDocsWasCalled(postReleaseActions);
});
}
@Test
public void should_perform_a_meta_release_of_sc_release_and_consul_in_parallel()
throws Exception {
public void should_perform_a_meta_release_of_sc_release_and_consul_in_parallel() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
File project = cloneToTemporaryDirectory(tmpFile("spring-cloud-consul"));
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(defaultRunner(), properties("debug=true").properties("test.metarelease=true")
.properties(metaReleaseArgsForParallel(project)
.bomBranch("vGreenwich.SR2").addFixedVersions(edgwareSr10())
.metaReleaseGroups("example1,example2",
"spring-cloud-build,spring-cloud-consul,spring-cloud-release")
.build()),
run(defaultRunner(),
properties("debugx=true").properties("test.metarelease=true")
.properties(metaReleaseArgsForParallel(project).bomBranch("vGreenwich.SR2")
.addFixedVersions(edgwareSr10())
.metaReleaseGroups("example1,example2",
"spring-cloud-build,spring-cloud-consul,spring-cloud-release")
.build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
.getBean(NonAssertingTestProjectGitHandler.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
DocumentationUpdater testDocumentationUpdater = context.getBean(DocumentationUpdater.class);
PostReleaseActions postReleaseActions = context.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().metaRelease(true).options());
ExecutionResult result = releaser.release(new OptionsBuilder().metaRelease(true).options());
// print results
testExecutionResultHandler.accept(result);
@@ -150,17 +142,15 @@ public class SpringMetaReleaseAcceptanceTests
// thenAllStepsWereExecutedForEachProject(
// nonAssertingTestProjectGitHandler);
thenSaganWasCalled(saganUpdater);
then(clonedProject(nonAssertingTestProjectGitHandler,
"spring-cloud-consul").tagList().call()).extracting("name")
.contains("refs/tags/v5.3.5.RELEASE");
then(clonedProject(nonAssertingTestProjectGitHandler, "spring-cloud-consul").tagList().call())
.extracting("name").contains("refs/tags/v5.3.5.RELEASE");
thenRunUpdatedTestsWereCalled(postReleaseActions);
thenUpdateReleaseTrainDocsWasCalled(postReleaseActions);
});
}
@Test
public void should_perform_a_meta_release_dry_run_of_sc_release_and_consul()
throws Exception {
public void should_perform_a_meta_release_dry_run_of_sc_release_and_consul() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
@@ -168,23 +158,20 @@ public class SpringMetaReleaseAcceptanceTests
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(defaultRunner(),
properties("debug=true").properties("test.metarelease=true")
.properties(metaReleaseArgs(project).bomBranch("vGreenwich.SR2")
.addFixedVersions(edgwareSr10()).build()),
properties("debugx=true").properties("test.metarelease=true").properties(
metaReleaseArgs(project).bomBranch("vGreenwich.SR2").addFixedVersions(edgwareSr10()).build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
.getBean(NonAssertingTestProjectGitHandler.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
DocumentationUpdater testDocumentationUpdater = context.getBean(DocumentationUpdater.class);
PostReleaseActions postReleaseActions = context.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser.release(new OptionsBuilder()
.metaRelease(true).dryRun(true).options());
ExecutionResult result = releaser
.release(new OptionsBuilder().metaRelease(true).dryRun(true).options());
// print results
testExecutionResultHandler.accept(result);
@@ -194,20 +181,17 @@ public class SpringMetaReleaseAcceptanceTests
// consul, release
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(2);
// only dry run tasks were called
thenAllDryRunStepsWereExecutedForEachProject(
nonAssertingTestProjectGitHandler);
thenAllDryRunStepsWereExecutedForEachProject(nonAssertingTestProjectGitHandler);
thenSaganWasNotCalled(saganUpdater);
then(clonedProject(nonAssertingTestProjectGitHandler,
"spring-cloud-consul").tagList().call()).extracting("name")
.doesNotContain("refs/tags/v5.3.5.RELEASE");
then(clonedProject(nonAssertingTestProjectGitHandler, "spring-cloud-consul").tagList().call())
.extracting("name").doesNotContain("refs/tags/v5.3.5.RELEASE");
thenRunUpdatedTestsWereNotCalled(postReleaseActions);
thenUpdateReleaseTrainDocsWasNotCalled(postReleaseActions);
});
}
@Test
public void should_not_release_any_projects_when_they_are_on_list_of_projects_to_skip()
throws Exception {
public void should_not_release_any_projects_when_they_are_on_list_of_projects_to_skip() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
@@ -215,23 +199,17 @@ public class SpringMetaReleaseAcceptanceTests
GitTestUtils.setOriginOnProjectToTmp(origin, project);
File temporaryDestination = this.tmp.newFolder();
run(defaultRunner(),
properties("debug=true")
.properties("test.metarelease=true", "test.mockBuild=true")
.properties(metaReleaseArgs(project).bomBranch("Greenwich")
.addFixedVersions(consulAndReleaseSnapshots())
.updateReleaseTrainWiki(false)
.cloneDestinationDirectory(temporaryDestination)
.projectsToSkip("spring-cloud-consul").build()),
run(defaultRunner(), properties("debugx=true").properties("test.metarelease=true", "test.mockBuild=true")
.properties(metaReleaseArgs(project).bomBranch("Greenwich")
.addFixedVersions(consulAndReleaseSnapshots()).updateReleaseTrainWiki(false)
.cloneDestinationDirectory(temporaryDestination).projectsToSkip("spring-cloud-consul").build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
BuildProjectReleaseTask build = context
.getBean(BuildProjectReleaseTask.class);
BuildProjectReleaseTask build = context.getBean(BuildProjectReleaseTask.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().metaRelease(true).options());
ExecutionResult result = releaser.release(new OptionsBuilder().metaRelease(true).options());
// print results
testExecutionResultHandler.accept(result);
@@ -244,8 +222,7 @@ public class SpringMetaReleaseAcceptanceTests
}
@Test
public void should_perform_a_meta_release_of_consul_only_when_run_from_got_passed()
throws Exception {
public void should_perform_a_meta_release_of_consul_only_when_run_from_got_passed() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
@@ -254,24 +231,20 @@ public class SpringMetaReleaseAcceptanceTests
File temporaryDestination = this.tmp.newFolder();
run(defaultRunner(),
properties("debug=true")
.properties("test.metarelease=true", "test.mockBuild=true")
properties("debugx=true").properties("test.metarelease=true", "test.mockBuild=true")
.properties(metaReleaseArgs(project).bomBranch("Greenwich")
.addFixedVersions(releaseConsulBuildSnapshots())
.cloneDestinationDirectory(temporaryDestination).build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
BuildProjectReleaseTask build = context
.getBean(BuildProjectReleaseTask.class);
BuildProjectReleaseTask build = context.getBean(BuildProjectReleaseTask.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
DocumentationUpdater testDocumentationUpdater = context.getBean(DocumentationUpdater.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().startFrom("spring-cloud-consul")
.metaRelease(true).options());
.release(new OptionsBuilder().startFrom("spring-cloud-consul").metaRelease(true).options());
// print results
testExecutionResultHandler.accept(result);
@@ -290,8 +263,7 @@ public class SpringMetaReleaseAcceptanceTests
}
@Test
public void should_perform_a_meta_release_of_consul_only_when_task_names_got_passed()
throws Exception {
public void should_perform_a_meta_release_of_consul_only_when_task_names_got_passed() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
@@ -300,24 +272,20 @@ public class SpringMetaReleaseAcceptanceTests
File temporaryDestination = this.tmp.newFolder();
run(defaultRunner(),
properties("debug=true")
.properties("test.metarelease=true", "test.mockBuild=true")
properties("debugx=true").properties("test.metarelease=true", "test.mockBuild=true")
.properties(metaReleaseArgs(project).bomBranch("Greenwich")
.addFixedVersions(releaseConsulBuildSnapshots())
.cloneDestinationDirectory(temporaryDestination).build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
BuildProjectReleaseTask build = context
.getBean(BuildProjectReleaseTask.class);
BuildProjectReleaseTask build = context.getBean(BuildProjectReleaseTask.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
DocumentationUpdater testDocumentationUpdater = context.getBean(DocumentationUpdater.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser.release(new OptionsBuilder()
.taskNames(Collections.singletonList("spring-cloud-consul"))
.metaRelease(true).options());
.taskNames(Collections.singletonList("spring-cloud-consul")).metaRelease(true).options());
// print results
testExecutionResultHandler.accept(result);
@@ -336,19 +304,18 @@ public class SpringMetaReleaseAcceptanceTests
}
@Test
public void should_not_execute_any_subsequent_task_when_first_one_fails()
throws Exception {
public void should_not_execute_any_subsequent_task_when_first_one_fails() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
File project = cloneToTemporaryDirectory(tmpFile("spring-cloud-consul"));
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(failingBuildRunner(), properties("debug=true")
run(failingBuildRunner(), properties("debugx=true")
.properties("test.metarelease=true", "test.metarelease.failing=true",
"releaser.flow.default-enabled=false")
.properties(metaReleaseArgs(project).bomBranch("vGreenwich.SR2")
.addFixedVersions(edgwareSr10()).build()),
.properties(
metaReleaseArgs(project).bomBranch("vGreenwich.SR2").addFixedVersions(edgwareSr10()).build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
@@ -357,11 +324,9 @@ public class SpringMetaReleaseAcceptanceTests
.getBean(TestExecutionResultHandler.class);
FirstTask firstTask = context.getBean(FirstTask.class);
SecondTask secondTask = context.getBean(SecondTask.class);
PostReleaseTask postReleaseTask = context
.getBean(PostReleaseTask.class);
PostReleaseTask postReleaseTask = context.getBean(PostReleaseTask.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().metaRelease(true).options());
ExecutionResult result = releaser.release(new OptionsBuilder().metaRelease(true).options());
// print results
testExecutionResultHandler.accept(result);
@@ -370,48 +335,40 @@ public class SpringMetaReleaseAcceptanceTests
then(result.isFailureOrUnstable()).isTrue();
// consul
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(1);
BDDMockito.then(firstTask).should().runTask(BDDMockito.argThat(
arg -> arg.project.getName().equals("spring-cloud-consul")));
BDDMockito.then(firstTask).should()
.runTask(BDDMockito.argThat(arg -> arg.project.getName().equals("spring-cloud-consul")));
BDDMockito.then(firstTask).should(BDDMockito.never())
.runTask(BDDMockito.argThat(arg -> arg.project.getName()
.equals("spring-cloud-release")));
BDDMockito.then(secondTask).should(BDDMockito.never())
.runTask(BDDMockito.any(Arguments.class));
.runTask(BDDMockito.argThat(arg -> arg.project.getName().equals("spring-cloud-release")));
BDDMockito.then(secondTask).should(BDDMockito.never()).runTask(BDDMockito.any(Arguments.class));
BDDMockito.then(postReleaseTask).should(BDDMockito.never())
.runTask(BDDMockito.any(Arguments.class));
});
}
private SpringApplicationBuilder defaultRunner() {
return new SpringApplicationBuilder(MetaReleaseConfig.class,
MetaReleaseScanningConfiguration.class).web(WebApplicationType.NONE)
.properties("spring.jmx.enabled=false");
return new SpringApplicationBuilder(MetaReleaseConfig.class, MetaReleaseScanningConfiguration.class)
.web(WebApplicationType.NONE).properties("spring.jmx.enabled=false");
}
private SpringApplicationBuilder failingBuildRunner() {
return new SpringApplicationBuilder(
SpringMetaReleaseAcceptanceTests.MetaReleaseConfig.class,
return new SpringApplicationBuilder(SpringMetaReleaseAcceptanceTests.MetaReleaseConfig.class,
SpringMetaReleaseAcceptanceTests.MetaReleaseFailingTasksScanningConfiguration.class)
.web(WebApplicationType.NONE)
.properties("spring.jmx.enabled=false");
.web(WebApplicationType.NONE).properties("spring.jmx.enabled=false");
}
private void thenWikiPageWasUpdated(DocumentationUpdater documentationUpdater) {
BDDMockito.then(documentationUpdater).should()
.updateReleaseTrainWiki(BDDMockito.any(Projects.class));
BDDMockito.then(documentationUpdater).should().updateReleaseTrainWiki(BDDMockito.any(Projects.class));
}
private void thenBuildWasCalledFor(BuildProjectReleaseTask build,
String projectName) {
BDDMockito.then(build).should().apply(argThat(
argument -> argument.originalVersion.projectName.equals(projectName)
private void thenBuildWasCalledFor(BuildProjectReleaseTask build, String projectName) {
BDDMockito.then(build).should()
.apply(argThat(argument -> argument.originalVersion.projectName.equals(projectName)
|| argument.project.getAbsolutePath().endsWith(projectName)));
}
private void thenBuildWasNeverCalledFor(BuildProjectReleaseTask build,
String projectName) {
BDDMockito.then(build).should(BDDMockito.never()).apply(argThat(
argument -> argument.originalVersion.projectName.equals(projectName)
private void thenBuildWasNeverCalledFor(BuildProjectReleaseTask build, String projectName) {
BDDMockito.then(build).should(BDDMockito.never())
.apply(argThat(argument -> argument.originalVersion.projectName.equals(projectName)
|| argument.project.getAbsolutePath().endsWith(projectName)));
}
@@ -438,8 +395,9 @@ public class SpringMetaReleaseAcceptanceTests
@Bean
SaganClient testSaganClient() {
SaganClient saganClient = BDDMockito.mock(SaganClient.class);
BDDMockito.given(saganClient.getProject(anyString()))
.willReturn(newProject());
given(saganClient.getProject(anyString())).willReturn(newProject());
given(saganClient.addRelease(anyString(), any())).willReturn(true);
given(saganClient.deleteRelease(anyString(), anyString())).willReturn(true);
return saganClient;
}
@@ -450,33 +408,27 @@ public class SpringMetaReleaseAcceptanceTests
}
@Bean
SaganUpdater testSaganUpdater(SaganClient saganClient,
ReleaserProperties properties) {
SaganUpdater testSaganUpdater(SaganClient saganClient, ReleaserProperties properties) {
return BDDMockito.spy(new SaganUpdater(saganClient, properties));
}
@Bean
PostReleaseActions myPostReleaseActions() {
return BDDMockito
.mock(PostReleaseActions.class,
invocation -> invocation.getMethod().getReturnType()
.equals(ExecutionResult.class)
? ExecutionResult.success() : null);
return BDDMockito.mock(PostReleaseActions.class,
invocation -> invocation.getMethod().getReturnType().equals(ExecutionResult.class)
? ExecutionResult.success() : null);
}
@Bean
NonAssertingTestProjectGitHubHandler testProjectGitHubHandler(
ReleaserProperties releaserProperties) {
NonAssertingTestProjectGitHubHandler testProjectGitHubHandler(ReleaserProperties releaserProperties) {
return new NonAssertingTestProjectGitHubHandler(releaserProperties);
}
@Bean
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler(
ReleaserProperties releaserProperties,
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler(ReleaserProperties releaserProperties,
@Value("${test.projectName}") String projectName) {
return new NonAssertingTestProjectGitHandler(releaserProperties,
file -> FileSystemUtils
.deleteRecursively(new File(file, projectName)));
file -> FileSystemUtils.deleteRecursively(new File(file, projectName)));
}
@Bean
@@ -487,8 +439,7 @@ public class SpringMetaReleaseAcceptanceTests
}
@Configuration
@ConditionalOnProperty(value = "test.metarelease", havingValue = "true",
matchIfMissing = true)
@ConditionalOnProperty(value = "test.metarelease", havingValue = "true", matchIfMissing = true)
@ComponentScan({ "releaser.internal", "releaser.cloud" })
static class MetaReleaseScanningConfiguration {
@@ -551,8 +502,7 @@ class FirstTask implements ReleaseReleaserTask {
}
@Override
public ExecutionResult runTask(Arguments args)
throws BuildUnstableException, RuntimeException {
public ExecutionResult runTask(Arguments args) throws BuildUnstableException, RuntimeException {
return ExecutionResult.failure(new IllegalStateException("Failure"));
}
@@ -586,8 +536,7 @@ class SecondTask implements ReleaseReleaserTask {
}
@Override
public ExecutionResult runTask(Arguments args)
throws BuildUnstableException, RuntimeException {
public ExecutionResult runTask(Arguments args) throws BuildUnstableException, RuntimeException {
return ExecutionResult.success();
}
@@ -621,8 +570,7 @@ class PostReleaseTask implements TrainPostReleaseReleaserTask {
}
@Override
public ExecutionResult runTask(Arguments args)
throws BuildUnstableException, RuntimeException {
public ExecutionResult runTask(Arguments args) throws BuildUnstableException, RuntimeException {
return ExecutionResult.success();
}

View File

@@ -49,34 +49,33 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.util.FileSystemUtils;
import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.times;
/**
* @author Marcin Grzejszczak
*/
public class SpringSingleProjectAcceptanceTests
extends AbstractSpringCloudAcceptanceTests {
public class SpringSingleProjectAcceptanceTests extends AbstractSpringCloudAcceptanceTests {
SpringApplicationBuilder runner = new SpringApplicationBuilder(
SpringSingleProjectAcceptanceTests.SingleProjectReleaseConfig.class,
SpringSingleProjectAcceptanceTests.SingleProjectScanningConfiguration.class)
.web(WebApplicationType.NONE).properties("spring.jmx.enabled=false");
SpringSingleProjectAcceptanceTests.SingleProjectScanningConfiguration.class).web(WebApplicationType.NONE)
.properties("spring.jmx.enabled=false");
@Test
public void should_fail_to_perform_a_release_of_consul_when_sc_release_contains_snapshots()
throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release-with-snapshot/",
"vCamden.SR5.BROKEN");
public void should_fail_to_perform_a_release_of_consul_when_sc_release_contains_snapshots() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release-with-snapshot/", "vCamden.SR5.BROKEN");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
File project = cloneToTemporaryDirectory(tmpFile("spring-cloud-consul"));
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(this.runner,
properties("debug=true").properties(new ArgsBuilder(project, this.tmp)
properties("debugx=true").properties(new ArgsBuilder(project, this.tmp)
.releaseTrainUrl("/projects/spring-cloud-release-with-snapshot/")
.bomBranch("vCamden.SR5.BROKEN").expectedVersion("1.1.2.RELEASE")
.build()),
.bomBranch("vCamden.SR5.BROKEN").expectedVersion("1.1.2.RELEASE").build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
BDDAssertions.thenThrownBy(releaser::release).hasMessageContaining(
@@ -94,28 +93,23 @@ public class SpringSingleProjectAcceptanceTests
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(this.runner,
properties("debug=true").properties(new ArgsBuilder(project, this.tmp)
.releaseTrainUrl("/projects/spring-cloud-release/")
.bomBranch("vGreenwich.SR2").expectedVersion("2.1.2.RELEASE")
.build()),
properties("debugx=true").properties(
new ArgsBuilder(project, this.tmp).releaseTrainUrl("/projects/spring-cloud-release/")
.bomBranch("vGreenwich.SR2").expectedVersion("2.1.2.RELEASE").build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
TestProjectGitHubHandler gitHubHandler = context
.getBean(TestProjectGitHubHandler.class);
TestProjectGitHubHandler gitHubHandler = context.getBean(TestProjectGitHubHandler.class);
SaganClient saganClient = context.getBean(SaganClient.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
PostReleaseActions postReleaseActions = context.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().interactive(true).options());
ExecutionResult result = releaser.release(new OptionsBuilder().interactive(true).options());
Iterable<RevCommit> commits = listOfCommits(project);
Iterator<RevCommit> iterator = commits.iterator();
tagIsPresentInOrigin(origin, "v2.1.2.RELEASE");
commitIsPresent(iterator,
"Bumping versions to 2.1.3.SNAPSHOT after release");
commitIsPresent(iterator, "Bumping versions to 2.1.3.SNAPSHOT after release");
commitIsPresent(iterator, "Going back to snapshots");
commitIsPresent(iterator, "Update SNAPSHOT to 2.1.2.RELEASE");
pomVersionIsEqualTo(project, "2.1.3.SNAPSHOT");
@@ -127,11 +121,10 @@ public class SpringSingleProjectAcceptanceTests
then(releaseNotesTemplate()).doesNotExist();
// once for updating GA
// second time to update SNAPSHOT
BDDMockito.then(saganClient).should(BDDMockito.times(2))
.updateRelease(BDDMockito.eq("spring-cloud-consul"),
BDDMockito.anyList());
BDDMockito.then(saganClient).should()
.deleteRelease("spring-cloud-consul", "2.1.2.BUILD-SNAPSHOT");
BDDMockito.then(saganClient).should(times(2)).addRelease(BDDMockito.eq("spring-cloud-consul"),
BDDMockito.any());
BDDMockito.then(saganClient).should(times(2)).getProject("spring-cloud-consul");
BDDMockito.then(saganClient).should().deleteRelease("spring-cloud-consul", "2.1.2.BUILD-SNAPSHOT");
then(gitHubHandler.issueCreatedInSpringGuides).isFalse();
then(gitHubHandler.issueCreatedInStartSpringIo).isFalse();
thenRunUpdatedTestsWereNotCalled(postReleaseActions);
@@ -152,34 +145,28 @@ public class SpringSingleProjectAcceptanceTests
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(this.runner,
properties("debug=true").properties(new ArgsBuilder(project, this.tmp)
.releaseTrainUrl("/projects/spring-cloud-release/")
.bomBranch("vGreenwich.SR2").projectName("spring-cloud-build")
.expectedVersion("2.1.6.RELEASE").build()),
properties("debugx=true").properties(new ArgsBuilder(project, this.tmp)
.releaseTrainUrl("/projects/spring-cloud-release/").bomBranch("vGreenwich.SR2")
.projectName("spring-cloud-build").expectedVersion("2.1.6.RELEASE").build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
TestProjectGitHubHandler gitHubHandler = context
.getBean(TestProjectGitHubHandler.class);
TestProjectGitHubHandler gitHubHandler = context.getBean(TestProjectGitHubHandler.class);
SaganClient saganClient = context.getBean(SaganClient.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
PostReleaseActions postReleaseActions = context.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().interactive(true).options());
ExecutionResult result = releaser.release(new OptionsBuilder().interactive(true).options());
Iterable<RevCommit> commits = listOfCommits(project);
Iterator<RevCommit> iterator = commits.iterator();
tagIsPresentInOrigin(origin, "v2.1.6.RELEASE");
// we're running against camden sc-release
commitIsPresent(iterator,
"Bumping versions to 2.1.7.SNAPSHOT after release");
commitIsPresent(iterator, "Bumping versions to 2.1.7.SNAPSHOT after release");
commitIsPresent(iterator, "Going back to snapshots");
commitIsPresent(iterator, "Update SNAPSHOT to 2.1.6.RELEASE");
pomVersionIsEqualTo(project, "2.1.7.SNAPSHOT");
pomParentVersionIsEqualTo(project, "spring-cloud-build-dependencies",
"2.1.6.RELEASE");
pomParentVersionIsEqualTo(project, "spring-cloud-build-dependencies", "2.1.6.RELEASE");
then(gitHubHandler.closedMilestones).isTrue();
then(emailTemplate()).doesNotExist();
then(blogTemplate()).doesNotExist();
@@ -187,11 +174,9 @@ public class SpringSingleProjectAcceptanceTests
then(releaseNotesTemplate()).doesNotExist();
// once for updating GA
// second time to update SNAPSHOT
BDDMockito.then(saganClient).should(BDDMockito.times(2))
.updateRelease(BDDMockito.eq("spring-cloud-build"),
BDDMockito.anyList());
BDDMockito.then(saganClient).should()
.deleteRelease("spring-cloud-build", "2.1.6.BUILD-SNAPSHOT");
BDDMockito.then(saganClient).should(times(2)).addRelease(BDDMockito.eq("spring-cloud-build"),
BDDMockito.any());
BDDMockito.then(saganClient).should().deleteRelease("spring-cloud-build", "2.1.6.BUILD-SNAPSHOT");
then(gitHubHandler.issueCreatedInSpringGuides).isFalse();
then(gitHubHandler.issueCreatedInStartSpringIo).isFalse();
thenRunUpdatedTestsWereNotCalled(postReleaseActions);
@@ -211,26 +196,22 @@ public class SpringSingleProjectAcceptanceTests
GitTestUtils.setOriginOnProjectToTmp(origin, project);
run(this.runner,
properties("debug=true").properties(new ArgsBuilder(project, this.tmp)
.releaseTrainUrl("/projects/spring-cloud-release/")
.bomBranch("vDalston.RC1").expectedVersion("1.2.0.RC1").build()),
properties("debugx=true").properties(
new ArgsBuilder(project, this.tmp).releaseTrainUrl("/projects/spring-cloud-release/")
.bomBranch("vDalston.RC1").expectedVersion("1.2.0.RC1").build()),
context -> {
SpringReleaser releaser = context.getBean(SpringReleaser.class);
TestProjectGitHubHandler gitHubHandler = context
.getBean(TestProjectGitHubHandler.class);
TestProjectGitHubHandler gitHubHandler = context.getBean(TestProjectGitHubHandler.class);
SaganClient saganClient = context.getBean(SaganClient.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
PostReleaseActions postReleaseActions = context.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
ExecutionResult result = releaser
.release(new OptionsBuilder().interactive(true).options());
ExecutionResult result = releaser.release(new OptionsBuilder().interactive(true).options());
Iterable<RevCommit> commits = listOfCommits(project);
tagIsPresentInOrigin(origin, "v1.2.0.RC1");
commitIsNotPresent(commits,
"Bumping versions to 1.2.1.SNAPSHOT after release");
commitIsNotPresent(commits, "Bumping versions to 1.2.1.SNAPSHOT after release");
Iterator<RevCommit> iterator = listOfCommits(project).iterator();
commitIsPresent(iterator, "Going back to snapshots");
commitIsPresent(iterator, "Update SNAPSHOT to 1.2.0.RC1");
@@ -241,12 +222,11 @@ public class SpringSingleProjectAcceptanceTests
then(blogTemplate()).doesNotExist();
then(tweetTemplate()).doesNotExist();
then(releaseNotesTemplate()).doesNotExist();
BDDMockito.then(saganClient).should().updateRelease(
BDDMockito.eq("spring-cloud-consul"), BDDMockito.anyList());
BDDMockito.then(saganClient).should()
.deleteRelease("spring-cloud-consul", "1.2.0.M8");
BDDMockito.then(saganClient).should()
.deleteRelease("spring-cloud-consul", "1.2.0.RC1");
BDDMockito.then(saganClient).should().addRelease(BDDMockito.eq("spring-cloud-consul"),
BDDMockito.any());
BDDMockito.then(saganClient).should(times(2)).getProject("spring-cloud-consul");
BDDMockito.then(saganClient).should().deleteRelease("spring-cloud-consul", "1.2.0.M8");
BDDMockito.then(saganClient).should().deleteRelease("spring-cloud-consul", "1.2.0.SNAPSHOT");
// we update guides only for SR / RELEASE
then(gitHubHandler.issueCreatedInSpringGuides).isFalse();
then(gitHubHandler.issueCreatedInStartSpringIo).isFalse();
@@ -259,8 +239,7 @@ public class SpringSingleProjectAcceptanceTests
}
@Test
public void should_not_clone_when_option_not_to_clone_was_switched_on()
throws Exception {
public void should_not_clone_when_option_not_to_clone_was_switched_on() throws Exception {
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "master");
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
assertThatClonedConsulProjectIsInSnapshots(origin);
@@ -269,12 +248,11 @@ public class SpringSingleProjectAcceptanceTests
final File temporaryDestination = this.tmp.newFolder();
run(this.runner,
properties("debug=true").properties(new ArgsBuilder(project, this.tmp)
.releaseTrainUrl("/projects/spring-cloud-release/")
.bomBranch("vCamden.SR5").expectedVersion("1.1.2.RELEASE")
properties("debugx=true").properties(new ArgsBuilder(project, this.tmp)
.releaseTrainUrl("/projects/spring-cloud-release/").bomBranch("vCamden.SR5")
.expectedVersion("1.1.2.RELEASE")
// just build
.chosenOption("6").fetchVersionsFromGit(false)
.cloneDestinationDirectory(temporaryDestination)
.chosenOption("6").fetchVersionsFromGit(false).cloneDestinationDirectory(temporaryDestination)
.addFixedVersion("spring-cloud-release", "Finchley.RELEASE")
.addFixedVersion("spring-cloud-consul", "2.3.4.RELEASE").build()),
context -> {
@@ -288,8 +266,7 @@ public class SpringSingleProjectAcceptanceTests
private void assertThatClonedBuildProjectIsInSnapshots(File origin) {
pomVersionIsEqualTo(origin, "1.3.7.BUILD-SNAPSHOT");
pomParentVersionIsEqualTo(origin, "spring-cloud-build-dependencies",
"1.5.9.RELEASE");
pomParentVersionIsEqualTo(origin, "spring-cloud-build-dependencies", "1.5.9.RELEASE");
}
// @formatter:on
@@ -305,8 +282,7 @@ public class SpringSingleProjectAcceptanceTests
boolean issueCreatedInStartSpringIo = false;
TestProjectGitHubHandler(ReleaserProperties properties, String expectedVersion,
String projectName) {
TestProjectGitHubHandler(ReleaserProperties properties, String expectedVersion, String projectName) {
super(properties, Collections.emptyList());
this.expectedVersion = expectedVersion;
this.projectName = projectName;
@@ -325,8 +301,7 @@ public class SpringSingleProjectAcceptanceTests
}
@Override
public void createIssueInStartSpringIo(Projects projects,
ProjectVersion version) {
public void createIssueInStartSpringIo(Projects projects, ProjectVersion version) {
this.issueCreatedInStartSpringIo = true;
}
@@ -339,15 +314,15 @@ public class SpringSingleProjectAcceptanceTests
@Configuration
@EnableAutoConfiguration
@ConditionalOnProperty(value = "test.metarelease", havingValue = "false",
matchIfMissing = true)
@ConditionalOnProperty(value = "test.metarelease", havingValue = "false", matchIfMissing = true)
static class SingleProjectReleaseConfig extends DefaultTestConfiguration {
@Bean
SaganClient testSaganClient() {
SaganClient saganClient = BDDMockito.mock(SaganClient.class);
BDDMockito.given(saganClient.getProject(anyString()))
.willReturn(newProject());
given(saganClient.getProject(anyString())).willReturn(newProject());
given(saganClient.addRelease(anyString(), any())).willReturn(true);
given(saganClient.deleteRelease(anyString(), anyString())).willReturn(true);
return saganClient;
}
@@ -357,21 +332,17 @@ public class SpringSingleProjectAcceptanceTests
}
@Bean
TestProjectGitHubHandler testProjectGitHubHandler(
ReleaserProperties releaserProperties,
TestProjectGitHubHandler testProjectGitHubHandler(ReleaserProperties releaserProperties,
@Value("${test.expectedVersion}") String expectedVersion,
@Value("${test.projectName}") String projectName) {
return new TestProjectGitHubHandler(releaserProperties, expectedVersion,
projectName);
return new TestProjectGitHubHandler(releaserProperties, expectedVersion, projectName);
}
@Bean
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler(
ReleaserProperties releaserProperties,
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler(ReleaserProperties releaserProperties,
@Value("${test.projectName}") String projectName) {
return new NonAssertingTestProjectGitHandler(releaserProperties,
file -> FileSystemUtils
.deleteRecursively(new File(file, projectName)));
file -> FileSystemUtils.deleteRecursively(new File(file, projectName)));
}
@Bean
@@ -382,8 +353,7 @@ public class SpringSingleProjectAcceptanceTests
}
@Configuration
@ConditionalOnProperty(value = "test.metarelease", havingValue = "false",
matchIfMissing = true)
@ConditionalOnProperty(value = "test.metarelease", havingValue = "false", matchIfMissing = true)
@ComponentScan({ "releaser.internal", "releaser.cloud" })
static class SingleProjectScanningConfiguration {