Skip to content

Commit

Permalink
Closes #17 resolve issue links
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPirnbaum committed Sep 24, 2024
1 parent 0be93f9 commit 1ed43d4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@
import org.jqassistant.plugin.jira.cache.CacheEndpoint;
import org.jqassistant.plugin.jira.jjrc.JiraRestClientWrapper;
import org.jqassistant.plugin.jira.model.JiraServer;
import org.jqassistant.plugin.jira.scanner.builder.IssueLinkBuilder;
import org.jqassistant.plugin.jira.scanner.builder.PriorityBuilder;
import org.jqassistant.plugin.jira.scanner.builder.ProjectBuilder;
import org.jqassistant.plugin.jira.scanner.builder.ServerInfoBuilder;
import org.jqassistant.plugin.jira.scanner.builder.StatusBuilder;
import org.jqassistant.plugin.jira.scanner.builder.SubtaskRelationBuilder;

public class GraphBuilder {
private final ServerInfoBuilder serverInfoBuilder;
private final PriorityBuilder priorityBuilder;
private final StatusBuilder statusBuilder;
private final IssueLinkBuilder issueLinkBuilder;
private final SubtaskRelationBuilder subtaskRelationBuilder;
private final ProjectBuilder projectBuilder;

GraphBuilder(JiraRestClientWrapper jiraRestClientWrapper, CacheEndpoint cacheEndpoint, Map<String, String> customIssueFields, String customJql) {
this.serverInfoBuilder = new ServerInfoBuilder(jiraRestClientWrapper);
this.priorityBuilder = new PriorityBuilder(cacheEndpoint, jiraRestClientWrapper);
this.statusBuilder = new StatusBuilder(cacheEndpoint, jiraRestClientWrapper);
this.issueLinkBuilder = new IssueLinkBuilder(cacheEndpoint);
this.subtaskRelationBuilder = new SubtaskRelationBuilder(cacheEndpoint);
this.projectBuilder = new ProjectBuilder(cacheEndpoint, jiraRestClientWrapper, customIssueFields, customJql);
}

Expand All @@ -34,7 +28,5 @@ void startTraversal(JiraServer jiraServer, List<String> projects) {
this.priorityBuilder.handlePriorities(jiraServer);
this.statusBuilder.handleStatuses(jiraServer);
this.projectBuilder.handleProjects(jiraServer, projects);
this.issueLinkBuilder.handleIssueLinks();
this.subtaskRelationBuilder.handleSubtaskRelations();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ void handleIssues(JiraProject jiraProject) {
LOGGER.info("Finished loading issues.");
}

void resolveIssueLinks() {
this.issueLinkBuilder.handleIssueLinks();
}

void resolveSubtaskRelations() {
this.subtaskRelationBuilder.handleSubtaskRelations();
}

private Map<String, String> extractCustomFields(Issue issue) {
Map<String, String> customFields = new HashMap<>();
for (IssueField field : issue.getFields()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public void handleProjects(JiraServer jiraServer, List<String> projects) {
}

LOGGER.info("Imported {} Jira projects", jiraServer.getProjects().size());
LOGGER.info("Resolving Issue Links");
this.issueBuilder.resolveIssueLinks();

LOGGER.info("Resolving Subtask Relations");
this.issueBuilder.resolveSubtaskRelations();
}

private void resolveLeaderForProject(JiraProject jiraProject, BasicUser basicUser) {
Expand Down

0 comments on commit 1ed43d4

Please sign in to comment.