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

@@ -162,7 +162,7 @@ Java and Maven versions are installed via https://sdkman.io/[SDKman] during the
link:src/main/java/org/springframework/data/release/issues/github/ProjectLabelConfiguration.java[`ProjectLabelConfiguration`] contains a per-project configuration which labels should be present in a project. To apply that configuration (create or update), use:
----
$ github update labels $project
$ github update labels $project [--commercial]
----
===== Dependency Upgrade

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);
}
});