17
17
18
18
import com .fasterxml .jackson .databind .DeserializationFeature ;
19
19
import com .fasterxml .jackson .databind .ObjectMapper ;
20
-
21
- import io .micrometer .release .single .PostReleaseWorkflow ;
22
20
import io .micrometer .release .common .ProcessRunner ;
21
+ import io .micrometer .release .single .PostReleaseWorkflow ;
23
22
24
23
import java .net .http .HttpClient ;
25
24
import java .util .Arrays ;
@@ -33,8 +32,6 @@ public class ProjectTrainReleaseWorkflow {
33
32
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper ()
34
33
.configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , false );
35
34
36
- private final String githubRepo ;
37
-
38
35
private final ReleaseScheduler releaseScheduler ;
39
36
40
37
private final VersionToBranchConverter versionToBranchConverter ;
@@ -45,21 +42,18 @@ public class ProjectTrainReleaseWorkflow {
45
42
46
43
public ProjectTrainReleaseWorkflow (String githubOrgRepo , String artifactToCheck , ProcessRunner processRunner ,
47
44
PostReleaseWorkflow postReleaseWorkflow ) {
48
- this .githubRepo = githubOrgRepo .split ("/" )[0 ];
49
45
this .releaseScheduler = new ReleaseScheduler (
50
46
new CircleCiChecker (System .getenv ("CIRCLE_CI_TOKEN" ), githubOrgRepo , HTTP_CLIENT , OBJECT_MAPPER ),
51
47
processRunner );
52
48
this .versionToBranchConverter = new VersionToBranchConverter (System .getenv ("GH_TOKEN" ),
53
- "https://api.github.com/repos/" + githubRepo + "/branches/" , HTTP_CLIENT );
49
+ "https://api.github.com/repos/" + githubOrgRepo + "/branches/" , HTTP_CLIENT );
54
50
this .postReleaseTaskScheduler = new PostReleaseTaskScheduler (postReleaseWorkflow , githubOrgRepo );
55
51
this .mavenCentralSyncChecker = new MavenCentralSyncChecker (artifactToCheck );
56
52
}
57
53
58
54
// For tests
59
- ProjectTrainReleaseWorkflow (String githubOrgRepo , ReleaseScheduler releaseScheduler ,
60
- VersionToBranchConverter versionToBranchConverter , PostReleaseTaskScheduler postReleaseTaskScheduler ,
61
- MavenCentralSyncChecker mavenCentralSyncChecker ) {
62
- this .githubRepo = githubOrgRepo .split ("/" )[0 ];
55
+ ProjectTrainReleaseWorkflow (ReleaseScheduler releaseScheduler , VersionToBranchConverter versionToBranchConverter ,
56
+ PostReleaseTaskScheduler postReleaseTaskScheduler , MavenCentralSyncChecker mavenCentralSyncChecker ) {
63
57
this .releaseScheduler = releaseScheduler ;
64
58
this .versionToBranchConverter = versionToBranchConverter ;
65
59
this .postReleaseTaskScheduler = postReleaseTaskScheduler ;
0 commit comments