Skip to content

Commit 2958117

Browse files
Fixed wrong url setting
1 parent 8c6a98d commit 2958117

File tree

3 files changed

+17
-27
lines changed

3 files changed

+17
-27
lines changed

src/main/java/io/micrometer/release/train/ProjectTrainReleaseWorkflow.java

+4-10
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717

1818
import com.fasterxml.jackson.databind.DeserializationFeature;
1919
import com.fasterxml.jackson.databind.ObjectMapper;
20-
21-
import io.micrometer.release.single.PostReleaseWorkflow;
2220
import io.micrometer.release.common.ProcessRunner;
21+
import io.micrometer.release.single.PostReleaseWorkflow;
2322

2423
import java.net.http.HttpClient;
2524
import java.util.Arrays;
@@ -33,8 +32,6 @@ public class ProjectTrainReleaseWorkflow {
3332
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
3433
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
3534

36-
private final String githubRepo;
37-
3835
private final ReleaseScheduler releaseScheduler;
3936

4037
private final VersionToBranchConverter versionToBranchConverter;
@@ -45,21 +42,18 @@ public class ProjectTrainReleaseWorkflow {
4542

4643
public ProjectTrainReleaseWorkflow(String githubOrgRepo, String artifactToCheck, ProcessRunner processRunner,
4744
PostReleaseWorkflow postReleaseWorkflow) {
48-
this.githubRepo = githubOrgRepo.split("/")[0];
4945
this.releaseScheduler = new ReleaseScheduler(
5046
new CircleCiChecker(System.getenv("CIRCLE_CI_TOKEN"), githubOrgRepo, HTTP_CLIENT, OBJECT_MAPPER),
5147
processRunner);
5248
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);
5450
this.postReleaseTaskScheduler = new PostReleaseTaskScheduler(postReleaseWorkflow, githubOrgRepo);
5551
this.mavenCentralSyncChecker = new MavenCentralSyncChecker(artifactToCheck);
5652
}
5753

5854
// 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) {
6357
this.releaseScheduler = releaseScheduler;
6458
this.versionToBranchConverter = versionToBranchConverter;
6559
this.postReleaseTaskScheduler = postReleaseTaskScheduler;

src/test/java/io/micrometer/release/train/ProjectTrainReleaseWorkflowAcceptanceTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class ProjectTrainReleaseWorkflowAcceptanceTests {
6060
VersionToBranchConverter versionToBranchConverter = new VersionToBranchConverter("foo",
6161
wm1.url("/repos/micrometer-metrics/micrometer/branches/"), HttpClient.newBuilder().build());
6262

63-
ProjectTrainReleaseWorkflow workflow = new ProjectTrainReleaseWorkflow(GITHUB_ORG_REPO, releaseScheduler,
64-
versionToBranchConverter, postReleaseTaskScheduler, mavenCentralSyncChecker);
63+
ProjectTrainReleaseWorkflow workflow = new ProjectTrainReleaseWorkflow(releaseScheduler, versionToBranchConverter,
64+
postReleaseTaskScheduler, mavenCentralSyncChecker);
6565

6666
@Test
6767
void should_perform_the_release() {

src/test/java/io/micrometer/release/train/ProjectTrainReleaseWorkflowTests.java

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
/**
22
* Copyright 2025 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
* <p>
87
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
8+
* <p>
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
1513
*/
1614
package io.micrometer.release.train;
1715

@@ -26,8 +24,6 @@
2624

2725
class ProjectTrainReleaseWorkflowTests {
2826

29-
String githubOrgRepo = "micrometer-metrics/micrometer";
30-
3127
ReleaseScheduler releaseScheduler = mock();
3228

3329
VersionToBranchConverter versionToBranchConverter = mock();
@@ -36,8 +32,8 @@ class ProjectTrainReleaseWorkflowTests {
3632

3733
MavenCentralSyncChecker mavenCentralSyncChecker = mock();
3834

39-
ProjectTrainReleaseWorkflow workflow = new ProjectTrainReleaseWorkflow(githubOrgRepo, releaseScheduler,
40-
versionToBranchConverter, postReleaseTaskScheduler, mavenCentralSyncChecker);
35+
ProjectTrainReleaseWorkflow workflow = new ProjectTrainReleaseWorkflow(releaseScheduler, versionToBranchConverter,
36+
postReleaseTaskScheduler, mavenCentralSyncChecker);
4137

4238
@Test
4339
void should_run_train_workflow_tasks() {

0 commit comments

Comments
 (0)