Refine GitHub label update.

Add commercial flag to the command line.
This commit is contained in:
Mark Paluch
2024-02-08 09:11:21 +01:00
parent 5c07bc9780
commit b62d8202ca
2 changed files with 9 additions and 8 deletions

View File

@@ -31,9 +31,9 @@ import org.springframework.data.release.issues.IssueTracker;
import org.springframework.data.release.issues.TicketReference;
import org.springframework.data.release.model.Iteration;
import org.springframework.data.release.model.Project;
import org.springframework.data.release.model.SupportStatus;
import org.springframework.data.release.model.SupportedProject;
import org.springframework.data.release.model.Tracker;
import org.springframework.data.release.model.Train;
import org.springframework.data.release.model.TrainIteration;
import org.springframework.data.release.utils.ExecutionUtils;
import org.springframework.plugin.core.PluginRegistry;
@@ -57,10 +57,10 @@ public class GitHubCommands extends TimedCommand {
@NonNull Executor executor;
@CliCommand(value = "github update labels")
public void createOrUpdateLabels(
@CliOption(key = "", mandatory = true) Project project,
@CliOption(key = "train", mandatory = true) Train train) {
gitHubLabels.createOrUpdateLabels(train.getSupportedProject(project));
public void createOrUpdateLabels(@CliOption(key = "", mandatory = true) Project project,
@CliOption(key = "commercial", mandatory = false) Boolean commercial) {
gitHubLabels.createOrUpdateLabels(SupportedProject.of(project,
commercial == null || !commercial ? SupportStatus.OSS : SupportStatus.COMMERCIAL));
}
@CliCommand(value = "github push")
@@ -87,8 +87,9 @@ public class GitHubCommands extends TimedCommand {
if (it.getSupportedProject().getProject().getTracker() == Tracker.GITHUB) {
List<String> ticketReferences = git.getTicketReferencesBetween(it.getSupportedProject(), previousIteration, iteration)
.stream().map(TicketReference::getId).collect(Collectors.toList());
List<String> ticketReferences = git
.getTicketReferencesBetween(it.getSupportedProject(), previousIteration, iteration).stream()
.map(TicketReference::getId).collect(Collectors.toList());
gitHub.createOrUpdateRelease(iteration, it, ticketReferences);
}
});