Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import java.io.InputStream;
import java.io.PrintStream;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -311,8 +311,9 @@ protected Map<String, String> implementChanges(Server server, Changes changes) t
try {
final Issue actualIssue = issueClient.getIssue(created.getKey()).get();
final Iterable<Transition> transitions = issueClient.getTransitions(actualIssue).get();
final Transition transition = StreamSupport.stream(transitions.spliterator(), false).filter(t -> Objects.equal(t.getName(), transitionName)).findFirst().orElse(null);
issueClient.transition(actualIssue, new TransitionInput(transition.getId())).get();
final Optional<Transition> transition = StreamSupport.stream(transitions.spliterator(), false).filter(t -> Objects.equal(t.getName(), transitionName)).findFirst();
if (transition.isEmpty()) throw new IllegalArgumentException(String.format("There was no transition named %1$s in Jira, please check that you're using the name of the transition, rather than the desired end state, and update your issue creation config", transitionName));
issueClient.transition(actualIssue, new TransitionInput(transition.get().getId())).get();
} catch (ExecutionException e) {
throwables.add(e);
continue;
Expand All @@ -336,11 +337,11 @@ protected Map<String, String> implementChanges(Server server, Changes changes) t
}

@Override
public IExit invoke(CommandInvocation<InputStream, PrintStream> invocation) throws Throwable {
public IExit invoke(CommandInvocation<?, InputStream, PrintStream> invocation) throws Throwable {
if (invocation.getArguments().size() < 1 || invocation.getArguments().size() > 2) throw new IllegalArgumentException("You must specify one or two inputs the optional path to server and the path fo the config!");
final boolean hasServer = invocation.getArguments().size() > 1;
final IDataSource server = hasServer ? new PathDataSource(Paths.get(invocation.getArguments().get(0))) : null;
final IDataSource config = new PathDataSource(Paths.get(invocation.getArguments().get(hasServer ? 1 : 0)));
final IDataSource server = hasServer ? new PathDataSource(invocation.getArgumentsAsArguments().get(0).getPath()) : null;
final IDataSource config = new PathDataSource(invocation.getArgumentsAsArguments().get(hasServer ? 1 : 0).getPath());
createIssues(server, config).entrySet().forEach(entry -> System.out.println(String.format("%1$s %2$s", entry.getValue(), entry.getKey())));
return IStandardCommand.SUCCESS;
}
Expand Down
5 changes: 2 additions & 3 deletions pj-plan/src/main/java/com/g2forge/project/plan/Download.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.io.PrintStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
Expand Down Expand Up @@ -52,10 +51,10 @@ public static Path withBase(Path base, Path path) {
}

@Override
public IExit invoke(CommandInvocation<InputStream, PrintStream> invocation) throws Throwable {
public IExit invoke(CommandInvocation<?, InputStream, PrintStream> invocation) throws Throwable {
HLog.getLogControl().setLogLevel(Level.INFO);
if (invocation.getArguments().size() != 1) throw new IllegalArgumentException();
final Path inputPath = Paths.get(invocation.getArguments().get(0));
final Path inputPath = invocation.getArgumentsAsArguments().get(0).getPath();
final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
final Input input = mapper.readValue(inputPath.toFile(), Input.class);

Expand Down
6 changes: 3 additions & 3 deletions pj-plan/src/main/java/com/g2forge/project/plan/Sprints.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public static void main(String[] args) throws Throwable {
}

@Override
public IExit invoke(CommandInvocation<InputStream, PrintStream> invocation) throws Throwable {
public IExit invoke(CommandInvocation<?, InputStream, PrintStream> invocation) throws Throwable {
if (invocation.getArguments().size() != 2) throw new IllegalArgumentException();
final long initialSprintId = Long.parseLong(invocation.getArguments().get(0));
final int sprintDuration = Integer.parseInt(invocation.getArguments().get(1));
final long initialSprintId = Long.parseLong(invocation.getArgumentsAsArguments().get(0).getString());
final int sprintDuration = Integer.parseInt(invocation.getArgumentsAsArguments().get(1).getString());

try (final ExtendedJiraRestClient client = JiraAPI.load().connect(true)) {
final SprintRestClient sprintClient = client.getSprintClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ protected List<Change> examineIssue(final ExtendedJiraRestClient client, Server
public static final DateTimeFormatter DATETIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm[:ss]");

@Override
public IExit invoke(CommandInvocation<InputStream, PrintStream> invocation) throws Throwable {
public IExit invoke(CommandInvocation<?, InputStream, PrintStream> invocation) throws Throwable {
HLog.getLogControl().setLogLevel(Level.INFO);
final Arguments arguments = ArgumentParser.parse(Arguments.class, invocation.getArguments());
final Arguments arguments = ArgumentParser.parse(Arguments.class, invocation);

final Server server = HConfig.load(new PathDataSource(arguments.getServer()), Server.class);
final Request request = HConfig.load(new PathDataSource(arguments.getRequest()), Request.class);
Expand Down