Abstracted GitHub actions
- Spring Cloud guides and start.spring.io is now treated as a Spring Cloud custom action - improved start.spring.io integration fixes gh-158 fixes gh-159
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2012-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 org.springframework.cloud.release.cloud.github;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
class SpringCloudGithubConfiguration {
|
||||
|
||||
@Bean
|
||||
SpringCloudGithubIssues springCloudGithubIssues(
|
||||
ReleaserProperties releaserProperties) {
|
||||
return new SpringCloudGithubIssues(releaserProperties);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,6 +28,7 @@ import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.docs.CustomProjectDocumentationUpdater;
|
||||
import org.springframework.cloud.release.internal.docs.DocumentationUpdater;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.github.CustomGithubIssues;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.options.Parser;
|
||||
import org.springframework.cloud.release.internal.postrelease.PostReleaseActions;
|
||||
@@ -75,9 +76,12 @@ class ReleaserConfiguration {
|
||||
return new ProjectGitHandler(this.properties);
|
||||
}
|
||||
|
||||
@Autowired(required = false)
|
||||
List<CustomGithubIssues> customGithubIssues = new ArrayList<>();
|
||||
|
||||
@Bean
|
||||
ProjectGitHubHandler projectGitHubHandler() {
|
||||
return new ProjectGitHubHandler(this.properties);
|
||||
return new ProjectGitHubHandler(this.properties, this.customGithubIssues);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2012-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 org.springframework.cloud.release.cloud.github;
|
||||
|
||||
import com.jcabi.github.Github;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.github.CustomGithubIssues;
|
||||
|
||||
public class SpringCloudGithubIssuesAccessor {
|
||||
|
||||
public static CustomGithubIssues springCloud(Github github,
|
||||
ReleaserProperties releaserProperties) {
|
||||
return new SpringCloudGithubIssues(github, releaserProperties);
|
||||
}
|
||||
|
||||
public static CustomGithubIssues springCloud(ReleaserProperties releaserProperties) {
|
||||
return new SpringCloudGithubIssues(releaserProperties);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,6 +46,7 @@ import org.mockito.Mockito;
|
||||
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.release.cloud.docs.SpringCloudDocsAccessor;
|
||||
import org.springframework.cloud.release.cloud.github.SpringCloudGithubIssuesAccessor;
|
||||
import org.springframework.cloud.release.internal.Releaser;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.buildsystem.BomParser;
|
||||
@@ -961,7 +962,8 @@ public class AcceptanceTests {
|
||||
|
||||
TestProjectGitHubHandler(ReleaserProperties properties, String expectedVersion,
|
||||
String projectName) {
|
||||
super(properties);
|
||||
super(properties, Collections.singletonList(
|
||||
SpringCloudGithubIssuesAccessor.springCloud(properties)));
|
||||
this.expectedVersion = expectedVersion;
|
||||
this.projectName = projectName;
|
||||
}
|
||||
@@ -1000,7 +1002,8 @@ public class AcceptanceTests {
|
||||
boolean issueCreatedInStartSpringIo = false;
|
||||
|
||||
NonAssertingTestProjectGitHubHandler(ReleaserProperties properties) {
|
||||
super(properties);
|
||||
super(properties, Collections.singletonList(
|
||||
SpringCloudGithubIssuesAccessor.springCloud(properties)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user