Removed the tasks related to updating project documentation repo

This commit is contained in:
Marcin Grzejszczak
2020-08-04 19:25:17 +02:00
parent 84a3d1111c
commit 13091b0cf6
12 changed files with 20 additions and 411 deletions

View File

@@ -43,8 +43,6 @@ import releaser.internal.template.TemplateGenerator;
import org.springframework.util.FileSystemUtils;
import static org.assertj.core.api.BDDAssertions.then;
/**
* @author Marcin Grzejszczak
*/
@@ -81,18 +79,6 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests {
SpringCloudGithubIssuesAccessor.springCloud(this.properties)));
}
@Test
public void should_not_update_current_version_in_the_docs_if_current_release_is_not_ga_or_sr() {
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release",
"Angel.M7");
ReleaserProperties properties = SpringCloudReleaserProperties.get();
File updatedDocs = projectDocumentationUpdater(properties)
.updateDocsRepo(projects(), releaseTrainVersion, "vAngel.M7");
then(updatedDocs).isNull();
}
@NotNull
private DocumentationUpdater projectDocumentationUpdater(
ReleaserProperties properties) {
@@ -214,74 +200,6 @@ public class SpringCloudCustomProjectDocumentationUpdaterTests {
.isNotEqualTo("Angel.SR33");
}
@Test
public void should_update_current_version_in_the_docs_if_current_release_starts_with_v_and_then_higher_letter_than_the_stored_release()
throws IOException {
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(projects(), releaseTrainVersion, "vFinchley.SR33");
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");
}
@Test
public void should_update_current_version_in_the_docs_if_current_release_starts_with_higher_letter_than_the_stored_release()
throws IOException {
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release",
"Finchley.SR33");
ReleaserProperties properties = new ReleaserProperties();
properties.getGit().setUpdateDocumentationRepo(true);
properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString());
DocumentationUpdater updater = projectDocumentationUpdater(properties);
ProjectVersion sleuthVersion = new ProjectVersion("spring-cloud-sleuth",
"2.0.0.RELEASE");
Projects bom = new Projects(sleuthVersion);
File updatedDocs = updater.updateDocsRepo(bom, releaseTrainVersion,
"vFinchley.SR33");
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");
updatedDocs = updater.updateDocsRepoForSingleProject(bom, sleuthVersion);
BDDAssertions.then(
new File(updatedDocs, "spring-cloud-sleuth/current/index.html").toPath())
.doesNotExist();
current = new File(updatedDocs, "spring-cloud-sleuth/current/").toPath();
BDDAssertions.then(current).isSymbolicLink();
BDDAssertions.then(Files.readSymbolicLink(current).toString())
.isEqualTo("2.0.0.RELEASE");
}
@Test
public void should_not_update_current_version_in_the_docs_if_switch_is_off() {
ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release",
"Finchley.SR33");
ReleaserProperties properties = new ReleaserProperties();
properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString());
properties.getGit().setUpdateDocumentationRepo(false);
File updatedDocs = projectDocumentationUpdater(properties)
.updateDocsRepo(projects(), releaseTrainVersion, "Finchley.SR33");
then(updatedDocs).isNull();
}
private File file(String relativePath) throws URISyntaxException {
return new File(SpringCloudCustomProjectDocumentationUpdater.class
.getResource(relativePath).toURI());

View File

@@ -19,17 +19,14 @@ package releaser.cloud.spring.meta;
import java.io.File;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.mockito.BDDMockito;
import releaser.internal.Releaser;
import releaser.internal.ReleaserProperties;
import releaser.internal.docs.CustomProjectDocumentationUpdater;
import releaser.internal.docs.DocumentationUpdater;
import releaser.internal.git.GitTestUtils;
import releaser.internal.git.ProjectGitHandler;
import releaser.internal.options.OptionsBuilder;
import releaser.internal.postrelease.PostReleaseActions;
import releaser.internal.project.Projects;
@@ -44,9 +41,7 @@ import releaser.internal.tasks.composite.ReleaseCompositeTask;
import releaser.internal.tasks.release.BuildProjectReleaseTask;
import releaser.internal.tech.BuildUnstableException;
import releaser.internal.tech.ExecutionResult;
import releaser.internal.template.TemplateGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -86,8 +81,6 @@ public class SpringMetaReleaseAcceptanceTests
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
.getBean(NonAssertingTestProjectGitHandler.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
@@ -101,13 +94,12 @@ public class SpringMetaReleaseAcceptanceTests
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
then(result.isFailureOrUnstable()).isFalse();
// consul, release, documentation
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(3);
// consul, release
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(2);
// don't want to verify the docs
thenAllStepsWereExecutedForEachProject(
nonAssertingTestProjectGitHandler);
thenSaganWasCalled(saganUpdater);
thenDocumentationWasUpdated(testDocumentationUpdater);
then(clonedProject(nonAssertingTestProjectGitHandler,
"spring-cloud-consul").tagList().call()).extracting("name")
.contains("refs/tags/v5.3.5.RELEASE");
@@ -136,8 +128,8 @@ public class SpringMetaReleaseAcceptanceTests
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
.getBean(NonAssertingTestProjectGitHandler.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
@@ -158,7 +150,6 @@ public class SpringMetaReleaseAcceptanceTests
// thenAllStepsWereExecutedForEachProject(
// nonAssertingTestProjectGitHandler);
thenSaganWasCalled(saganUpdater);
thenDocumentationWasUpdated(testDocumentationUpdater);
then(clonedProject(nonAssertingTestProjectGitHandler,
"spring-cloud-consul").tagList().call()).extracting("name")
.contains("refs/tags/v5.3.5.RELEASE");
@@ -185,8 +176,8 @@ public class SpringMetaReleaseAcceptanceTests
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
.getBean(NonAssertingTestProjectGitHandler.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
@@ -206,7 +197,6 @@ public class SpringMetaReleaseAcceptanceTests
thenAllDryRunStepsWereExecutedForEachProject(
nonAssertingTestProjectGitHandler);
thenSaganWasNotCalled(saganUpdater);
thenDocumentationWasNotUpdated(testDocumentationUpdater);
then(clonedProject(nonAssertingTestProjectGitHandler,
"spring-cloud-consul").tagList().call()).extracting("name")
.doesNotContain("refs/tags/v5.3.5.RELEASE");
@@ -274,8 +264,8 @@ public class SpringMetaReleaseAcceptanceTests
BuildProjectReleaseTask build = context
.getBean(BuildProjectReleaseTask.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
@@ -295,7 +285,6 @@ public class SpringMetaReleaseAcceptanceTests
// post release
thenSaganWasCalled(saganUpdater);
thenDocumentationWasUpdated(testDocumentationUpdater);
thenWikiPageWasUpdated(testDocumentationUpdater);
});
}
@@ -321,8 +310,8 @@ public class SpringMetaReleaseAcceptanceTests
BuildProjectReleaseTask build = context
.getBean(BuildProjectReleaseTask.class);
SaganUpdater saganUpdater = context.getBean(SaganUpdater.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
DocumentationUpdater testDocumentationUpdater = context
.getBean(DocumentationUpdater.class);
TestExecutionResultHandler testExecutionResultHandler = context
.getBean(TestExecutionResultHandler.class);
@@ -342,7 +331,6 @@ public class SpringMetaReleaseAcceptanceTests
// post release
thenSaganWasCalled(saganUpdater);
thenDocumentationWasUpdated(testDocumentationUpdater);
thenWikiPageWasUpdated(testDocumentationUpdater);
});
}
@@ -492,13 +480,8 @@ public class SpringMetaReleaseAcceptanceTests
}
@Bean
TestDocumentationUpdater testDocumentationUpdater(
ProjectGitHandler projectGitHandler,
ReleaserProperties releaserProperties,
TemplateGenerator templateGenerator, @Autowired(
required = false) List<CustomProjectDocumentationUpdater> updaters) {
return BDDMockito.spy(new TestDocumentationUpdater(projectGitHandler,
releaserProperties, templateGenerator, updaters));
DocumentationUpdater testDocumentationUpdater() {
return BDDMockito.mock(DocumentationUpdater.class);
}
}

View File

@@ -17,10 +17,8 @@
package releaser.cloud.spring.single;
import java.io.File;
import java.nio.file.Files;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.assertj.core.api.BDDAssertions;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -28,9 +26,8 @@ import org.junit.Test;
import org.mockito.BDDMockito;
import releaser.cloud.spring.AbstractSpringCloudAcceptanceTests;
import releaser.internal.ReleaserProperties;
import releaser.internal.docs.CustomProjectDocumentationUpdater;
import releaser.internal.docs.DocumentationUpdater;
import releaser.internal.git.GitTestUtils;
import releaser.internal.git.ProjectGitHandler;
import releaser.internal.github.ProjectGitHubHandler;
import releaser.internal.options.OptionsBuilder;
import releaser.internal.postrelease.PostReleaseActions;
@@ -40,9 +37,7 @@ import releaser.internal.sagan.SaganClient;
import releaser.internal.spring.ArgsBuilder;
import releaser.internal.spring.SpringReleaser;
import releaser.internal.tech.ExecutionResult;
import releaser.internal.template.TemplateGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -108,8 +103,6 @@ public class SpringSingleProjectAcceptanceTests
TestProjectGitHubHandler gitHubHandler = context
.getBean(TestProjectGitHubHandler.class);
SaganClient saganClient = context.getBean(SaganClient.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
@@ -141,10 +134,6 @@ public class SpringSingleProjectAcceptanceTests
.deleteRelease("spring-cloud-consul", "2.1.2.BUILD-SNAPSHOT");
then(gitHubHandler.issueCreatedInSpringGuides).isFalse();
then(gitHubHandler.issueCreatedInStartSpringIo).isFalse();
then(Files.readSymbolicLink(
new File(testDocumentationUpdater.getDocumentationRepo(),
"spring-cloud-consul/current").toPath())
.toString()).isEqualTo("2.1.2.RELEASE");
thenRunUpdatedTestsWereNotCalled(postReleaseActions);
// print results
@@ -172,8 +161,6 @@ public class SpringSingleProjectAcceptanceTests
TestProjectGitHubHandler gitHubHandler = context
.getBean(TestProjectGitHubHandler.class);
SaganClient saganClient = context.getBean(SaganClient.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
@@ -207,10 +194,6 @@ public class SpringSingleProjectAcceptanceTests
.deleteRelease("spring-cloud-build", "2.1.6.BUILD-SNAPSHOT");
then(gitHubHandler.issueCreatedInSpringGuides).isFalse();
then(gitHubHandler.issueCreatedInStartSpringIo).isFalse();
then(Files.readSymbolicLink(
new File(testDocumentationUpdater.getDocumentationRepo(),
"spring-cloud-build/current").toPath())
.toString()).isEqualTo("2.1.6.RELEASE");
thenRunUpdatedTestsWereNotCalled(postReleaseActions);
// print results
@@ -236,8 +219,6 @@ public class SpringSingleProjectAcceptanceTests
TestProjectGitHubHandler gitHubHandler = context
.getBean(TestProjectGitHubHandler.class);
SaganClient saganClient = context.getBean(SaganClient.class);
TestDocumentationUpdater testDocumentationUpdater = context
.getBean(TestDocumentationUpdater.class);
PostReleaseActions postReleaseActions = context
.getBean(PostReleaseActions.class);
TestExecutionResultHandler testExecutionResultHandler = context
@@ -269,9 +250,6 @@ public class SpringSingleProjectAcceptanceTests
// we update guides only for SR / RELEASE
then(gitHubHandler.issueCreatedInSpringGuides).isFalse();
then(gitHubHandler.issueCreatedInStartSpringIo).isFalse();
// haven't even checked out the branch
then(new File(testDocumentationUpdater.getDocumentationRepo(),
"current/index.html")).doesNotExist();
thenRunUpdatedTestsWereNotCalled(postReleaseActions);
// print results
@@ -397,13 +375,8 @@ public class SpringSingleProjectAcceptanceTests
}
@Bean
TestDocumentationUpdater testDocumentationUpdater(
ProjectGitHandler projectGitHandler,
ReleaserProperties releaserProperties,
TemplateGenerator templateGenerator, @Autowired(
required = false) List<CustomProjectDocumentationUpdater> updaters) {
return new TestDocumentationUpdater(projectGitHandler, releaserProperties,
templateGenerator, updaters);
DocumentationUpdater testDocumentationUpdater() {
return BDDMockito.mock(DocumentationUpdater.class);
}
}

View File

@@ -388,39 +388,6 @@ public class Releaser {
}
}
public ExecutionResult updateDocumentationRepositoryForTrain(
ReleaserProperties properties, Projects projects,
ProjectVersion releaseVersion) {
String releaseBranch = properties.getPom().getBranch();
File file = this.documentationUpdater.updateDocsRepo(projects, releaseVersion,
releaseBranch);
if (file != null) {
log.info(
"\nSuccessfully updated documentation repository for train branch [{}]",
releaseBranch);
return ExecutionResult.success();
}
return ExecutionResult.skipped();
}
public ExecutionResult updateDocumentationRepositoryForSingleProject(
Projects projects, ProjectVersion releaseVersion) {
if (releaseVersion.projectName
.equals(projects.releaseTrain(this.releaserProperties).projectName)) {
log.info("Will not update documentation for project that is a BOM project");
return ExecutionResult.skipped();
}
File file = this.documentationUpdater.updateDocsRepoForSingleProject(projects,
releaseVersion);
if (file != null) {
log.info(
"\nSuccessfully updated documentation repository for a project with name [{}]",
releaseVersion.projectName);
return ExecutionResult.success();
}
return ExecutionResult.skipped();
}
public ExecutionResult runUpdatedSamples(Projects projects) {
return this.postReleaseActions.runUpdatedTests(projects);
}

View File

@@ -21,7 +21,6 @@ import java.util.List;
import releaser.internal.ReleaserProperties;
import releaser.internal.git.ProjectGitHandler;
import releaser.internal.project.ProjectVersion;
import releaser.internal.project.Projects;
import releaser.internal.template.TemplateGenerator;
@@ -49,35 +48,6 @@ public class DocumentationUpdater {
this.releaseTrainContentsUpdater = contentsUpdater;
}
/**
* Updates the documentation repository if current release train version is greater or
* equal than the one stored in the repo.
* @param projects list of projects with updated versions
* @param currentProject the project we're parsing
* @param bomReleaseBranch branch of the BOM
* @return {@link File cloned temporary directory} - {@code null} if wrong version is
* used
*/
public File updateDocsRepo(Projects projects, ProjectVersion currentProject,
String bomReleaseBranch) {
return this.projectDocumentationUpdater.updateDocsRepo(projects, currentProject,
bomReleaseBranch);
}
/**
* Updates the documentation repository if current release train version is greater or
* equal than the one stored in the repo.
* @param projects list of projects with updated versions
* @param currentProject the project we're parsing
* @return {@link File cloned temporary directory} - {@code null} if wrong version is
* used
*/
public File updateDocsRepoForSingleProject(Projects projects,
ProjectVersion currentProject) {
return this.projectDocumentationUpdater.updateDocsRepoForSingleProject(projects,
currentProject);
}
/**
* Updates the release train wiki page.
* @param projects list of projects to update versions for

View File

@@ -48,6 +48,8 @@ class ProjectDocumentationUpdater {
this.updaters = updaters;
}
// Not needed any more cause all projects publish to docs.spring.io
@Deprecated
public File updateDocsRepo(Projects projects, ProjectVersion currentProject,
String bomBranch) {
if (!shouldUpdate(currentProject)) {
@@ -61,6 +63,8 @@ class ProjectDocumentationUpdater {
projects, bomBranch);
}
// Not needed any more cause all projects publish to docs.spring.io
@Deprecated
public File updateDocsRepoForSingleProject(Projects projects,
ProjectVersion currentProject) {
if (!shouldUpdate(currentProject)) {

View File

@@ -321,7 +321,7 @@ public class PostReleaseActions implements Closeable {
.cloneReleaseTrainDocumentationProject(releaseTrain.releaseTagName());
ReleaserProperties projectProps = projectProps(file);
String releaseTrainVersion = releaseTrain.version;
//updateWithVersions(file, projects);
// updateWithVersions(file, projects);
this.projectCommandExecutor.generateReleaseTrainDocs(projectProps,
releaseTrainVersion, file.getAbsolutePath());
return ExecutionResult.success();

View File

@@ -61,22 +61,6 @@ class PostReleaseTasksConfiguration {
return new UpdateAllTestSamplesTrainPostReleaseTask(releaser);
}
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty("releaser.git.update-documentation-repo")
UpdateDocsRepositoryProjectPostReleaseTask updateDocsRepositoryProjectPostReleaseTask(
Releaser releaser) {
return new UpdateDocsRepositoryProjectPostReleaseTask(releaser);
}
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty("releaser.git.update-documentation-repo")
UpdateDocsRepositoryTrainPostReleaseTask updateDocsRepositoryTrainPostReleaseTask(
Releaser releaser) {
return new UpdateDocsRepositoryTrainPostReleaseTask(releaser);
}
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty("releaser.git.update-guides-repo")

View File

@@ -1,69 +0,0 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package releaser.internal.tasks.postrelease;
import releaser.internal.Releaser;
import releaser.internal.spring.Arguments;
import releaser.internal.tasks.ProjectPostReleaseReleaserTask;
import releaser.internal.tech.ExecutionResult;
public class UpdateDocsRepositoryProjectPostReleaseTask
implements ProjectPostReleaseReleaserTask {
/**
* Order of this task. The higher value, the lower order.
*/
public static final int ORDER = 105;
private final Releaser releaser;
public UpdateDocsRepositoryProjectPostReleaseTask(Releaser releaser) {
this.releaser = releaser;
}
@Override
public String name() {
return "updateDocumentationForProject";
}
@Override
public String shortName() {
return "udp";
}
@Override
public String header() {
return "UPDATE DOCUMENTATION FOR PROJECT";
}
@Override
public String description() {
return "Updating documentation repository for a single project";
}
@Override
public ExecutionResult runTask(Arguments args) {
return this.releaser.updateDocumentationRepositoryForSingleProject(args.projects,
args.versionFromBom);
}
@Override
public int getOrder() {
return UpdateDocsRepositoryProjectPostReleaseTask.ORDER;
}
}

View File

@@ -1,69 +0,0 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package releaser.internal.tasks.postrelease;
import releaser.internal.Releaser;
import releaser.internal.spring.Arguments;
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
import releaser.internal.tech.ExecutionResult;
public class UpdateDocsRepositoryTrainPostReleaseTask
implements TrainPostReleaseReleaserTask {
/**
* Order of this task. The higher value, the lower order.
*/
public static final int ORDER = 110;
private final Releaser releaser;
public UpdateDocsRepositoryTrainPostReleaseTask(Releaser releaser) {
this.releaser = releaser;
}
@Override
public String name() {
return "updateDocumentation";
}
@Override
public String shortName() {
return "ud";
}
@Override
public String header() {
return "UPDATE DOCUMENTATION FOR RELEASE TRAIN";
}
@Override
public String description() {
return "Updating documentation repository for a release train";
}
@Override
public ExecutionResult runTask(Arguments args) {
return this.releaser.updateDocumentationRepositoryForTrain(args.properties,
args.projects, args.versionFromBom);
}
@Override
public int getOrder() {
return UpdateDocsRepositoryTrainPostReleaseTask.ORDER;
}
}

View File

@@ -42,18 +42,14 @@ import org.mockito.BDDMockito;
import releaser.internal.ReleaserProperties;
import releaser.internal.buildsystem.TestPomReader;
import releaser.internal.buildsystem.TestUtils;
import releaser.internal.docs.CustomProjectDocumentationUpdater;
import releaser.internal.docs.DocumentationUpdater;
import releaser.internal.git.GitTestUtils;
import releaser.internal.git.ProjectGitHandler;
import releaser.internal.options.Options;
import releaser.internal.postrelease.PostReleaseActions;
import releaser.internal.project.ProjectVersion;
import releaser.internal.project.Projects;
import releaser.internal.sagan.Project;
import releaser.internal.sagan.Release;
import releaser.internal.tasks.ReleaserTask;
import releaser.internal.template.TemplateGenerator;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
@@ -310,40 +306,6 @@ public abstract class AbstractSpringAcceptanceTests {
}
public static class TestDocumentationUpdater extends DocumentationUpdater {
private File documentationRepo;
public TestDocumentationUpdater(ProjectGitHandler gitHandler,
ReleaserProperties properties, TemplateGenerator templateGenerator,
List<CustomProjectDocumentationUpdater> updaters) {
super(gitHandler, properties, templateGenerator, updaters);
}
@Override
public File updateDocsRepo(Projects projects, ProjectVersion currentProject,
String bomReleaseBranch) {
File documentationRepo = super.updateDocsRepo(projects, currentProject,
bomReleaseBranch);
this.documentationRepo = documentationRepo;
return documentationRepo;
}
@Override
public File updateDocsRepoForSingleProject(Projects projects,
ProjectVersion currentProject) {
File documentationRepo = super.updateDocsRepoForSingleProject(projects,
currentProject);
this.documentationRepo = documentationRepo;
return documentationRepo;
}
public File getDocumentationRepo() {
return documentationRepo;
}
}
public static class TestExecutionResultHandler
extends SpringBatchExecutionResultHandler {

View File

@@ -24,7 +24,6 @@ import java.util.Map;
import org.mockito.BDDMockito;
import releaser.internal.ReleaserProperties;
import releaser.internal.docs.DocumentationUpdater;
import releaser.internal.github.ProjectGitHubHandler;
import releaser.internal.project.ProjectVersion;
import releaser.internal.project.Projects;
@@ -131,19 +130,6 @@ public abstract class AbstractSpringMetaReleaseAcceptanceTests
BDDMockito.any(ProjectVersion.class), BDDMockito.any(Projects.class));
}
public void thenDocumentationWasUpdated(DocumentationUpdater documentationUpdater) {
BDDMockito.then(documentationUpdater).should().updateDocsRepo(
BDDMockito.any(Projects.class), BDDMockito.any(ProjectVersion.class),
BDDMockito.anyString());
}
public void thenDocumentationWasNotUpdated(
DocumentationUpdater documentationUpdater) {
BDDMockito.then(documentationUpdater).should(BDDMockito.never()).updateDocsRepo(
BDDMockito.any(Projects.class), BDDMockito.any(ProjectVersion.class),
BDDMockito.anyString());
}
public static class NonAssertingTestProjectGitHubHandler
extends ProjectGitHubHandler {