15
15
*/
16
16
package io .micrometer .release .single ;
17
17
18
+ import io .micrometer .release .common .Input ;
18
19
import io .micrometer .release .common .ProcessRunner ;
19
20
20
21
import java .io .File ;
21
22
22
23
public class PostReleaseWorkflow {
23
24
24
- private final DependencyVerifier dependencyVerifier ;
25
-
26
25
private final ChangelogGeneratorDownloader changelogGeneratorDownloader ;
27
26
28
27
private final ChangelogGenerator changelogGenerator ;
@@ -37,12 +36,10 @@ public class PostReleaseWorkflow {
37
36
38
37
private final NotificationSender notificationSender ;
39
38
40
- PostReleaseWorkflow (DependencyVerifier dependencyVerifier ,
41
- ChangelogGeneratorDownloader changelogGeneratorDownloader , ChangelogGenerator changelogGenerator ,
42
- ChangelogFetcher changelogFetcher , ChangelogProcessor changelogProcessor ,
43
- ReleaseNotesUpdater releaseNotesUpdater , MilestoneUpdater milestoneUpdater ,
44
- NotificationSender notificationSender ) {
45
- this .dependencyVerifier = dependencyVerifier ;
39
+ PostReleaseWorkflow (ChangelogGeneratorDownloader changelogGeneratorDownloader ,
40
+ ChangelogGenerator changelogGenerator , ChangelogFetcher changelogFetcher ,
41
+ ChangelogProcessor changelogProcessor , ReleaseNotesUpdater releaseNotesUpdater ,
42
+ MilestoneUpdater milestoneUpdater , NotificationSender notificationSender ) {
46
43
this .changelogGeneratorDownloader = changelogGeneratorDownloader ;
47
44
this .changelogGenerator = changelogGenerator ;
48
45
this .changelogFetcher = changelogFetcher ;
@@ -53,22 +50,18 @@ public class PostReleaseWorkflow {
53
50
}
54
51
55
52
public PostReleaseWorkflow (ProcessRunner processRunner ) {
56
- this (new DependencyVerifier (processRunner ), new ChangelogGeneratorDownloader (),
57
- new ChangelogGenerator (processRunner ), new ChangelogFetcher (processRunner ),
58
- new ChangelogProcessor (processRunner ), new ReleaseNotesUpdater (processRunner ),
59
- new MilestoneUpdater (processRunner ), new NotificationSender ());
53
+ this (new ChangelogGeneratorDownloader (), new ChangelogGenerator (processRunner ),
54
+ new ChangelogFetcher (processRunner ), new ChangelogProcessor (processRunner ),
55
+ new ReleaseNotesUpdater (processRunner ), new MilestoneUpdater (processRunner ), new NotificationSender ());
60
56
}
61
57
62
58
// micrometer-metrics/tracing
63
59
// v1.3.1
64
60
// v1.2.5 (optional)
65
61
public void run (String githubOrgRepo , String githubRefName , String previousRefName ) {
66
- assertInputs (githubOrgRepo , githubRefName , previousRefName );
62
+ Input . assertInputs (githubOrgRepo , githubRefName , previousRefName );
67
63
String githubRepo = githubOrgRepo .contains ("/" ) ? githubOrgRepo .split ("/" )[1 ] : githubOrgRepo ;
68
64
69
- // Run dependabot and wait for it to complete
70
- verifyDependencies (githubOrgRepo );
71
-
72
65
// Close milestone and move issues around
73
66
MilestoneWithDeadline newMilestoneId = updateMilestones (githubRefName );
74
67
@@ -94,26 +87,6 @@ public void run(String githubOrgRepo, String githubRefName, String previousRefNa
94
87
sendNotifications (githubRepo , githubRefName , newMilestoneId );
95
88
}
96
89
97
- private void verifyDependencies (String githubOrgRepo ) {
98
- dependencyVerifier .verifyDependencies (githubOrgRepo );
99
- }
100
-
101
- void assertInputs (String githubOrgRepo , String githubRefName , String previousRefName ) {
102
- if (githubOrgRepo == null ) {
103
- throw new IllegalStateException ("No repo found, please provide the GITHUB_REPOSITORY env variable" );
104
- }
105
- if (githubRefName == null ) {
106
- throw new IllegalStateException ("No github ref found, please provide the GITHUB_REF_NAME env variable" );
107
- }
108
- if (!githubRefName .startsWith ("v" )) {
109
- throw new IllegalStateException ("Github ref must be a tag (must start with 'v'): " + githubRefName );
110
- }
111
- if (previousRefName != null && !previousRefName .isBlank () && !previousRefName .startsWith ("v" )) {
112
- throw new IllegalStateException (
113
- "Previous github ref must be a tag (must start with 'v'): " + previousRefName );
114
- }
115
- }
116
-
117
90
private File downloadChangelogGenerator () {
118
91
try {
119
92
return changelogGeneratorDownloader .downloadChangelogGenerator ();
0 commit comments