From cdc1605ef5819728022103cf2e714f80f1b57cfe Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 22 Nov 2019 20:26:38 +0100 Subject: [PATCH] All post release tasks are opt in; fixes gh-176 --- docs/src/main/asciidoc/_configprops.adoc | 39 ++++++++++--------- .../cloud/github/SpringCloudGithubIssues.java | 4 +- .../release/internal/ReleaserProperties.java | 31 ++++++++++----- .../internal/github/ProjectGitHubHandler.java | 18 +++++++++ ...ustomProjectDocumentationUpdaterTests.java | 2 + .../ReleaseTrainContentsUpdaterTests.java | 3 ++ .../internal/github/GithubIssuesTests.java | 24 ++++++++---- .../postrelease/PostReleaseActionsTests.java | 4 ++ .../sagan/SaganUpdaterOldDocsTest.java | 4 +- .../internal/sagan/SaganUpdaterTest.java | 4 +- .../versions/VersionsFromBomFetcherTests.java | 5 +++ .../internal/spring/AcceptanceTests.java | 15 +++++++ 12 files changed, 113 insertions(+), 40 deletions(-) diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/src/main/asciidoc/_configprops.adoc index 9ab25db9..798e7cb8 100644 --- a/docs/src/main/asciidoc/_configprops.adoc +++ b/docs/src/main/asciidoc/_configprops.adoc @@ -1,11 +1,11 @@ |=== |Name | Default | Description -|releaser.bash.build-command | echo "{{systemProps}}" | Command to be executed to build the project. -|releaser.bash.deploy-command | echo "{{systemProps}}" | Command to be executed to deploy a built project. -|releaser.bash.deploy-guides-command | echo "{{systemProps}}" | Command to be executed to build and deploy guides project only. +|releaser.bash.build-command | echo "{{systemProps}}" | Command to be executed to build the project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. +|releaser.bash.deploy-command | echo "{{systemProps}}" | Command to be executed to deploy a built project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. +|releaser.bash.deploy-guides-command | echo "{{systemProps}}" | Command to be executed to build and deploy guides project only. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.bash.generate-release-train-docs-command | echo "{{version}}" | Command to be executed to generate release train documentation. -|releaser.bash.publish-docs-commands | [mkdir -p target, echo "{{version}}"] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. +|releaser.bash.publish-docs-commands | [mkdir -p target, echo "{{version}}"] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.bash.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property. |releaser.bash.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish. |releaser.fixed-versions | | Project name to its version - overrides all versions retrieved from a release train repository like Spring Cloud Release. @@ -22,31 +22,32 @@ |releaser.git.release-train-docs-url | https://github.com/spring-cloud-samples/scripts | URL to the release train documentation. |releaser.git.release-train-wiki-page-prefix | Spring-Cloud | Page prefix for the release train wiki. E.g. for [Spring-Cloud-Finchley-Release-Notes] it would be [Spring-Cloud]. |releaser.git.release-train-wiki-url | https://github.com/spring-projects/spring-cloud.wiki | URL to the release train wiki. -|releaser.git.run-updated-samples | true | If set to {@code false}, will not update the test samples. +|releaser.git.run-updated-samples | false | If set to {@code false}, will not update the test samples. |releaser.git.spring-project-branch | gh-pages | Branch to check out for the release train project. |releaser.git.spring-project-url | https://github.com/spring-projects/spring-cloud | URL to the release train project page repository. |releaser.git.test-samples-branch | master | Branch to check out for the test samples. |releaser.git.test-samples-project-url | https://github.com/spring-cloud/spring-cloud-core-tests | URL to test samples. -|releaser.git.update-all-test-samples | true | If set to {@code false}, will not clone and update the samples for all projects. -|releaser.git.update-documentation-repo | true | If {@code false}, will not update the documentation repository. -|releaser.git.update-release-train-docs | true | If set to {@code false}, will not update the release train docs. -|releaser.git.update-release-train-wiki | true | If set to {@code false}, will not clone and update the release train wiki. -|releaser.git.update-spring-guides | true | If set to {@code false}, will not update Spring Guides for a release train. -|releaser.git.update-spring-project | true | If set to {@code false}, will not update the Spring Project for a release train. E.g. for Spring Cloud will not update https://cloud.spring.io . -|releaser.git.update-start-spring-io | true | If set to {@code false}, will not update start.spring.io for a release train. +|releaser.git.update-all-test-samples | false | If set to {@code false}, will not clone and update the samples for all projects. +|releaser.git.update-documentation-repo | false | If {@code false}, will not update the documentation repository. +|releaser.git.update-github-milestones | false | If set to {@code false}, will not update Github milestones. +|releaser.git.update-release-train-docs | false | If set to {@code false}, will not update the release train docs. +|releaser.git.update-release-train-wiki | false | If set to {@code false}, will not clone and update the release train wiki. +|releaser.git.update-spring-guides | false | If set to {@code false}, will not update Spring Guides for a release train. +|releaser.git.update-spring-project | false | If set to {@code false}, will not update the Spring Project for a release train. E.g. for Spring Cloud will not update https://cloud.spring.io . +|releaser.git.update-start-spring-io | false | If set to {@code false}, will not update start.spring.io for a release train. |releaser.git.username | | Optional Git username. If not passed keys will be used for authentication. -|releaser.gradle.build-command | ./gradlew clean build publishToMavenLocal {{systemProps}} | Command to be executed to build the project. -|releaser.gradle.deploy-command | ./gradlew clean build publish {{systemProps}} | Command to be executed to deploy a built project. -|releaser.gradle.deploy-guides-command | ./gradlew clean build deployGuides {{systemProps}} | Command to be executed to build and deploy guides project only. +|releaser.gradle.build-command | ./gradlew clean build publishToMavenLocal --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}} | Command to be executed to build the project If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. +|releaser.gradle.deploy-command | ./gradlew publish --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}} | Command to be executed to deploy a built project. +|releaser.gradle.deploy-guides-command | ./gradlew clean build deployGuides --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}} | Command to be executed to build and deploy guides project only. |releaser.gradle.generate-release-train-docs-command | echo 'TODO' | Command to be executed to generate release train documentation. |releaser.gradle.gradle-props-substitution | | A mapping that should be applied to {@code gradle.properties} in order to perform a substitution of properties. The mapping is from a property inside {@code gradle.properties} to the projects name. Example. In {@code gradle.properties} you have {@code verifierVersion=1.0.0} . You want this property to get updated with the value of {@code spring-cloud-contract} version. Then it's enough to do the mapping like this for this Releaser's property: {@code verifierVersion=spring-cloud-contract}. |releaser.gradle.ignored-gradle-regex | | List of regular expressions of ignored gradle props. Defaults to test projects and samples. |releaser.gradle.publish-docs-commands | [echo 'TODO'] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. |releaser.gradle.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property. |releaser.gradle.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish. -|releaser.maven.build-command | ./mvnw clean install -B -Pdocs {{systemProps}} | Command to be executed to build the project. -|releaser.maven.deploy-command | ./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}} | Command to be executed to deploy a built project. -|releaser.maven.deploy-guides-command | ./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}} | Command to be executed to build and deploy guides project only. +|releaser.maven.build-command | ./mvnw clean install -B -Pdocs {{systemProps}} | Command to be executed to build the project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. +|releaser.maven.deploy-command | ./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}} | Command to be executed to deploy a built project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. +|releaser.maven.deploy-guides-command | ./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}} | Command to be executed to build and deploy guides project only. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.maven.generate-release-train-docs-command | bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto | Command to be executed to generate release train documentation. |releaser.maven.publish-docs-commands | [mkdir -p target, wget https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/ghpages.sh -O target/gh-pages.sh, chmod +x target/gh-pages.sh, ./target/gh-pages.sh -v {{version}} -c] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. |releaser.maven.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property. @@ -66,7 +67,7 @@ |releaser.sagan.boot-section-file-name | sagan-boot.adoc | Name of the ascii doc file with boot part of this project's Sagan project page. Linked with {@link this#docsAdocsFile}. |releaser.sagan.docs-adocs-file | docs/src/main/asciidoc | Folder with asciidoctor files for docs. |releaser.sagan.index-section-file-name | sagan-index.adoc | Name of the ascii doc file with core part of this project's Sagan project page. Linked with {@link this#docsAdocsFile}. -|releaser.sagan.update-sagan | true | If set to {@code false} will not update Sagan. +|releaser.sagan.update-sagan | false | If set to {@code false} will not update Sagan. |releaser.template.template-folder | cloud | Folder in which blog, email etc. templates are stored. |releaser.versions.all-versions-file-url | https://raw.githubusercontent.com/spring-io/start.spring.io/master/start-site/src/main/resources/application.yml | Url to a file containing all the versions. Defaults to YAML from start.spring.io. |releaser.versions.bom-name | spring-cloud | Name in the YAML from initilizr for BOM mappings. diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/cloud/github/SpringCloudGithubIssues.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/cloud/github/SpringCloudGithubIssues.java index 40f9dbad..cacf25d8 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/cloud/github/SpringCloudGithubIssues.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/cloud/github/SpringCloudGithubIssues.java @@ -46,8 +46,8 @@ class SpringCloudGithubIssues implements CustomGithubIssues { @Override public boolean isApplicable(ReleaserProperties properties, Projects projects, ProjectVersion version) { - return version.projectName.startsWith("spring-cloud") || projects.stream() - .anyMatch(project -> project.projectName.startsWith("spring-cloud")); + return projects.stream() + .anyMatch(project -> project.projectName.contains("spring-cloud-build")); } @Override diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java index 90fca4e1..b1f6e8fb 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java @@ -364,45 +364,50 @@ public class ReleaserProperties implements Serializable { /** * If {@code false}, will not update the documentation repository. */ - private boolean updateDocumentationRepo = true; + private boolean updateDocumentationRepo = false; + + /** + * If set to {@code false}, will not update Github milestones. + */ + private boolean updateGithubMilestones = false; /** * If set to {@code false}, will not update Spring Guides for a release train. */ - private boolean updateSpringGuides = true; + private boolean updateSpringGuides = false; /** * If set to {@code false}, will not update start.spring.io for a release train. */ - private boolean updateStartSpringIo = true; + private boolean updateStartSpringIo = false; /** * If set to {@code false}, will not update the Spring Project for a release * train. E.g. for Spring Cloud will not update https://cloud.spring.io . */ - private boolean updateSpringProject = true; + private boolean updateSpringProject = false; /** * If set to {@code false}, will not update the test samples. */ - private boolean runUpdatedSamples = true; + private boolean runUpdatedSamples = false; /** * If set to {@code false}, will not update the release train docs. */ - private boolean updateReleaseTrainDocs = true; + private boolean updateReleaseTrainDocs = false; // TODO: Spring Cloud specific? /** * If set to {@code false}, will not clone and update the release train wiki. */ - private boolean updateReleaseTrainWiki = true; + private boolean updateReleaseTrainWiki = false; /** * If set to {@code false}, will not clone and update the samples for all * projects. */ - private boolean updateAllTestSamples = true; + private boolean updateAllTestSamples = false; /** * Project to urls mapping. For each project will clone the test project and will @@ -628,6 +633,14 @@ public class ReleaserProperties implements Serializable { this.releaseTrainWikiPagePrefix = releaseTrainWikiPagePrefix; } + public boolean isUpdateGithubMilestones() { + return this.updateGithubMilestones; + } + + public void setUpdateGithubMilestones(boolean updateGithubMilestones) { + this.updateGithubMilestones = updateGithubMilestones; + } + @Override public String toString() { return "Git{" + "releaseTrainBomUrl='" + this.releaseTrainBomUrl + '\'' @@ -1160,7 +1173,7 @@ public class ReleaserProperties implements Serializable { /** * If set to {@code false} will not update Sagan. */ - private boolean updateSagan = true; + private boolean updateSagan = false; /** * URL to the Sagan API. diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/github/ProjectGitHubHandler.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/github/ProjectGitHubHandler.java index 8ea12f44..44c62117 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/github/ProjectGitHubHandler.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/github/ProjectGitHubHandler.java @@ -55,14 +55,32 @@ public class ProjectGitHubHandler implements ReleaserPropertiesAware { } public void closeMilestone(ProjectVersion releaseVersion) { + if (!this.properties.getGit().isUpdateGithubMilestones()) { + log.info( + "Will not update the release train documentation, since the switch to do so " + + "is off. Set [releaser.git.update-github-milestones] to [true] to change that"); + return; + } this.githubMilestones.closeMilestone(releaseVersion); } public void createIssueInSpringGuides(Projects projects, ProjectVersion version) { + if (!this.properties.getGit().isUpdateSpringGuides()) { + log.info( + "Will not update the release train documentation, since the switch to do so " + + "is off. Set [releaser.git.update-spring-guides] to [true] to change that"); + return; + } this.githubIssues.fileIssueInSpringGuides(projects, version); } public void createIssueInStartSpringIo(Projects projects, ProjectVersion version) { + if (this.properties.getGit().isUpdateStartSpringIo()) { + log.info( + "Will not update the release train documentation, since the switch to do so " + + "is off. Set [releaser.git.update-start-spring-io] to [true] to change that"); + return; + } this.githubIssues.fileIssueInStartSpringIo(projects, version); } diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/cloud/docs/SpringCloudCustomProjectDocumentationUpdaterTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/cloud/docs/SpringCloudCustomProjectDocumentationUpdaterTests.java index 3fcd62c3..445af674 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/cloud/docs/SpringCloudCustomProjectDocumentationUpdaterTests.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/cloud/docs/SpringCloudCustomProjectDocumentationUpdaterTests.java @@ -190,6 +190,7 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests { ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release", "Finchley.SR33"); ReleaserProperties properties = new ReleaserProperties(); + properties.getGit().setUpdateDocumentationRepo(true); properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString()); File updatedDocs = projectDocumentationUpdater(properties) @@ -209,6 +210,7 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests { ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release", "Finchley.SR33"); ReleaserProperties properties = new ReleaserProperties(); + properties.getGit().setUpdateDocumentationRepo(true); properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString()); File updatedDocs = projectDocumentationUpdater(properties).updateDocsRepo( diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/docs/ReleaseTrainContentsUpdaterTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/docs/ReleaseTrainContentsUpdaterTests.java index fd03ae42..bd633535 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/docs/ReleaseTrainContentsUpdaterTests.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/docs/ReleaseTrainContentsUpdaterTests.java @@ -110,6 +110,7 @@ public class ReleaseTrainContentsUpdaterTests { public void should_not_update_the_contents_of_wiki_repo_when_release_train_smaller() throws GitAPIException, IOException { this.properties.getMetaRelease().setEnabled(true); + this.properties.getGit().setUpdateReleaseTrainWiki(true); this.properties.getGit() .setReleaseTrainWikiUrl(this.wikiRepo.getAbsolutePath() + "/"); @@ -129,6 +130,7 @@ public class ReleaseTrainContentsUpdaterTests { public void should_update_the_contents_of_wiki_when_release_train_greater() throws GitAPIException, IOException { this.properties.getMetaRelease().setEnabled(true); + this.properties.getGit().setUpdateReleaseTrainWiki(true); this.properties.getGit() .setReleaseTrainWikiUrl(this.wikiRepo.getAbsolutePath() + "/"); @@ -148,6 +150,7 @@ public class ReleaseTrainContentsUpdaterTests { public void should_generate_the_contents_of_wiki_when_release_train_missing() throws GitAPIException, IOException { this.properties.getMetaRelease().setEnabled(true); + this.properties.getGit().setUpdateReleaseTrainWiki(true); this.properties.getGit() .setReleaseTrainWikiUrl(this.wikiRepo.getAbsolutePath() + "/"); diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/github/GithubIssuesTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/github/GithubIssuesTests.java index 5be8e8cc..5338aa20 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/github/GithubIssuesTests.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/github/GithubIssuesTests.java @@ -77,14 +77,15 @@ public class GithubIssuesTests { SpringCloudGithubIssuesAccessor.springCloud(github, withToken()))); issues.fileIssueInSpringGuides( - new Projects(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT")), + 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(); } @Test - public void should_not_do_anything_if_switch_is_not_set() { + public void should_not_do_anything_if_not_applicable() { Github github = BDDMockito.mock(Github.class); ReleaserProperties properties = withToken(); properties.getGit().setUpdateSpringGuides(false); @@ -107,6 +108,7 @@ public class GithubIssuesTests { 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("sc-release", "Edgware.RELEASE")); @@ -132,8 +134,9 @@ public class GithubIssuesTests { .springCloud(new ReleaserProperties()))); thenThrownBy(() -> issues.fileIssueInSpringGuides( - new Projects(Collections.emptySet()), nonGaSleuthProject())) - .isInstanceOf(IllegalArgumentException.class) + 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"); } @@ -147,14 +150,15 @@ public class GithubIssuesTests { SpringCloudGithubIssuesAccessor.springCloud(github, withToken()))); issues.fileIssueInStartSpringIo( - new Projects(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT")), + new Projects(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"), + new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE")), new ProjectVersion("sc-release", "Edgware.BUILD-SNAPSHOT")); BDDMockito.then(github).shouldHaveZeroInteractions(); } @Test - public void should_not_do_anything_if_switch_is_not_set_when_updating_startspringio() + public void should_not_do_anything_if_not_applicable_when_updating_startspringio() throws IOException { setupStartSpringIo(); Github github = BDDMockito.mock(Github.class); @@ -181,6 +185,7 @@ public class GithubIssuesTests { 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")), @@ -206,8 +211,9 @@ public class GithubIssuesTests { .springCloud(new ReleaserProperties()))); thenThrownBy(() -> issues.fileIssueInStartSpringIo( - new Projects(Collections.emptySet()), nonGaSleuthProject())) - .isInstanceOf(IllegalArgumentException.class) + 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"); } @@ -229,6 +235,8 @@ public class GithubIssuesTests { ReleaserProperties properties = new ReleaserProperties(); properties.getGit().setOauthToken("foo"); properties.getPom().setBranch("vEdgware.RELEASE"); + properties.getGit().setUpdateSpringGuides(true); + properties.getGit().setUpdateStartSpringIo(true); return properties; } diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/postrelease/PostReleaseActionsTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/postrelease/PostReleaseActionsTests.java index 865f8917..d2764373 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/postrelease/PostReleaseActionsTests.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/postrelease/PostReleaseActionsTests.java @@ -134,6 +134,8 @@ public class PostReleaseActionsTests { @Test public void should_update_project_and_run_tests_and_update_test_is_called() { this.properties.getMetaRelease().setEnabled(true); + this.properties.getGit().setRunUpdatedSamples(true); + this.properties.getGit().setUpdateAllTestSamples(true); this.properties.getGit().setTestSamplesProjectUrl( tmpFile("spring-cloud-core-tests/").getAbsolutePath() + "/"); this.properties.getMaven().setBuildCommand("touch build.log"); @@ -232,6 +234,7 @@ public class PostReleaseActionsTests { public void should_update_test_sample_projects_when_test_samples_update_is_called() throws Exception { this.properties.getMetaRelease().setEnabled(true); + this.properties.getGit().setUpdateAllTestSamples(true); this.properties.getGit().getAllTestSampleUrls().clear(); this.properties.getGit().getAllTestSampleUrls().put("spring-cloud-sleuth", Collections.singletonList( @@ -275,6 +278,7 @@ public class PostReleaseActionsTests { public void should_assume_that_project_version_is_snapshot_when_no_pom_is_present() throws Exception { this.properties.getMetaRelease().setEnabled(true); + this.properties.getGit().setUpdateAllTestSamples(true); this.properties.getGit().getAllTestSampleUrls().clear(); this.properties.getGit().getAllTestSampleUrls().put("spring-cloud-sleuth", Collections.singletonList( diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterOldDocsTest.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterOldDocsTest.java index f3814cbe..370de615 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterOldDocsTest.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterOldDocsTest.java @@ -48,7 +48,7 @@ public class SaganUpdaterOldDocsTest { ReleaserProperties properties = new ReleaserProperties(); - SaganUpdater saganUpdater = new SaganUpdater(this.saganClient, this.properties); + SaganUpdater saganUpdater; Projects projects = new Projects(); @@ -58,6 +58,8 @@ public class SaganUpdaterOldDocsTest { project.projectReleases.addAll(Arrays.asList(release("1.0.0.RC1"), release("1.1.0.BUILD-SNAPSHOT"), release("2.0.0.M4"))); BDDMockito.given(this.saganClient.getProject(anyString())).willReturn(project); + this.properties.getSagan().setUpdateSagan(true); + this.saganUpdater = new SaganUpdater(this.saganClient, this.properties); } private Release release(String version) { diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterTest.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterTest.java index 92e1d3af..ee9fc15f 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterTest.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/sagan/SaganUpdaterTest.java @@ -48,7 +48,7 @@ public class SaganUpdaterTest { ReleaserProperties properties = new ReleaserProperties(); - SaganUpdater saganUpdater = new SaganUpdater(this.saganClient, this.properties); + SaganUpdater saganUpdater; Projects projects = new Projects(); @@ -58,6 +58,8 @@ public class SaganUpdaterTest { project.projectReleases.addAll(Arrays.asList(release("2.2.0.RC1"), release("2.3.0.BUILD-SNAPSHOT"), release("2.2.0.M4"))); BDDMockito.given(this.saganClient.getProject(anyString())).willReturn(project); + this.properties.getSagan().setUpdateSagan(true); + this.saganUpdater = new SaganUpdater(this.saganClient, this.properties); } private Release release(String version) { diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/versions/VersionsFromBomFetcherTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/versions/VersionsFromBomFetcherTests.java index beda2144..b2def9b9 100644 --- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/versions/VersionsFromBomFetcherTests.java +++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/versions/VersionsFromBomFetcherTests.java @@ -58,6 +58,7 @@ class VersionsFromBomFetcherTests { URI initilizrUri = VersionsFromBomFetcherTests.class .getResource("/raw/initializr.yml").toURI(); ReleaserProperties properties = new ReleaserProperties(); + properties.getGit().setUpdateSpringGuides(true); properties.getVersions().setAllVersionsFileUrl(initilizrUri.toString()); properties.getGit().setReleaseTrainBomUrl( file("/projects/spring-cloud-release/").toURI().toString() + "/"); @@ -78,6 +79,7 @@ class VersionsFromBomFetcherTests { URI initilizrUri = VersionsFromBomFetcherTests.class .getResource("/raw/initializr.yml").toURI(); ReleaserProperties properties = new ReleaserProperties(); + properties.getGit().setUpdateSpringGuides(true); properties.getVersions().setAllVersionsFileUrl(initilizrUri.toString()); properties.getGit().setReleaseTrainBomUrl( file("/projects/spring-cloud-release/").toURI().toString() + "/"); @@ -98,6 +100,7 @@ class VersionsFromBomFetcherTests { URI initilizrUri = VersionsFromBomFetcherTests.class .getResource("/raw/initializr.yml").toURI(); ReleaserProperties properties = new ReleaserProperties(); + properties.getGit().setUpdateSpringGuides(true); properties.getVersions().setAllVersionsFileUrl(initilizrUri.toString()); properties.getGit().setReleaseTrainBomUrl( file("/projects/spring-cloud-release/").toURI().toString()); @@ -114,6 +117,7 @@ class VersionsFromBomFetcherTests { ProjectVersion projectVersion = new ProjectVersion("spring-cloud-contract", "1.0.0.BUILD-SNAPSHOT"); ReleaserProperties properties = new ReleaserProperties(); + properties.getGit().setUpdateSpringGuides(true); ProjectPomUpdater updater = new ProjectPomUpdater(properties, new ArrayList<>()); VersionsFetcher versionsFetcher = new VersionsFetcher(properties, updater); @@ -127,6 +131,7 @@ class VersionsFromBomFetcherTests { ProjectVersion projectVersion = new ProjectVersion("spring-cloud-contract", "1.0.0.BUILD-SNAPSHOT"); ReleaserProperties properties = new ReleaserProperties(); + properties.getGit().setUpdateSpringGuides(true); VersionsFetcher versionsFetcher = new VersionsFetcher(properties, new ProjectPomUpdater(properties, new ArrayList<>()) { @Override diff --git a/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java b/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java index 541752d2..d7b3813f 100644 --- a/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java +++ b/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java @@ -886,6 +886,14 @@ public class AcceptanceTests { .setSpringProjectUrl(tmpFile("spring-cloud").getAbsolutePath() + "/"); releaserProperties.getGit().setReleaseTrainWikiUrl( tmpFile("spring-cloud-wiki").getAbsolutePath() + "/"); + releaserProperties.getGit().setRunUpdatedSamples(true); + releaserProperties.getGit().setUpdateSpringGuides(true); + releaserProperties.getGit().setUpdateStartSpringIo(true); + releaserProperties.getGit().setUpdateReleaseTrainWiki(true); + releaserProperties.getGit().setUpdateAllTestSamples(true); + releaserProperties.getGit().setUpdateDocumentationRepo(true); + releaserProperties.getGit().setUpdateReleaseTrainDocs(true); + releaserProperties.getSagan().setUpdateSagan(true); URI initilizrUri = AcceptanceTests.class.getResource("/raw/initializr.yml") .toURI(); releaserProperties.getVersions().setAllVersionsFileUrl(initilizrUri.toString()); @@ -922,6 +930,13 @@ public class AcceptanceTests { releaserProperties.getGit().setReleaseTrainWikiUrl( tmpFile("spring-cloud-wiki").getAbsolutePath() + "/"); releaserProperties.setFixedVersions(versions); + releaserProperties.getGit().setRunUpdatedSamples(true); + releaserProperties.getGit().setUpdateSpringGuides(true); + releaserProperties.getGit().setUpdateStartSpringIo(true); + releaserProperties.getGit().setUpdateReleaseTrainWiki(true); + releaserProperties.getGit().setUpdateAllTestSamples(true); + releaserProperties.getGit().setUpdateDocumentationRepo(true); + releaserProperties.getGit().setUpdateReleaseTrainDocs(true); URI initilizrUri = AcceptanceTests.class.getResource("/raw/initializr.yml") .toURI(); releaserProperties.getVersions().setAllVersionsFileUrl(initilizrUri.toString());