Skip to content

Commit acd2487

Browse files
committed
Add support to fully ignore links, issue #54
1 parent 85fe429 commit acd2487

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

jira-dependency-graph.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def get_issue_uri(self, issue_key):
6464
return self.__base_url + '/browse/' + issue_key
6565

6666

67-
def build_graph_data(start_issue_key, jira, excludes, show_directions, directions, includes, issue_excludes,
67+
def build_graph_data(start_issue_key, jira, excludes, ignores, show_directions, directions, includes, issue_excludes,
6868
ignore_closed, ignore_epic, ignore_subtasks, traverse, word_wrap):
6969
""" Given a starting image key and the issue-fetching function build up the GraphViz data representing relationships
7070
between issues. This will consider both subtasks and issue links.
@@ -130,6 +130,9 @@ def process_link(fields, issue_key, link):
130130
if includes not in linked_issue_key:
131131
return
132132

133+
if link_type.strip() in ignores:
134+
return
135+
133136
if link_type.strip() in excludes:
134137
return linked_issue_key, None
135138

@@ -240,7 +243,8 @@ def parse_args():
240243
parser.add_argument('-f', '--file', dest='image_file', default='issue_graph.png', help='Filename to write image to')
241244
parser.add_argument('-l', '--local', action='store_true', default=False, help='Render graphviz code to stdout')
242245
parser.add_argument('-e', '--ignore-epic', action='store_true', default=False, help='Don''t follow an Epic into it''s children issues')
243-
parser.add_argument('-x', '--exclude-link', dest='excludes', default=[], action='append', help='Exclude link type(s)')
246+
parser.add_argument('-x', '--exclude-link', dest='excludes', default=[], action='append', help='Travel link type(s) but excluding it from the graph')
247+
parser.add_argument('-il', '--ignore-link', dest='ignores', default=[], action='append', help='Exclude link type(s)')
244248
parser.add_argument('-ic', '--ignore-closed', dest='closed', action='store_true', default=False, help='Ignore closed issues')
245249
parser.add_argument('-i', '--issue-include', dest='includes', default='', help='Include issue keys')
246250
parser.add_argument('-xi', '--issue-exclude', dest='issue_excludes', action='append', default=[], help='Exclude issue keys; can be repeated for multiple issues')
@@ -288,7 +292,7 @@ def main():
288292

289293
graph = []
290294
for issue in options.issues:
291-
graph = graph + build_graph_data(issue, jira, options.excludes, options.show_directions, options.directions,
295+
graph = graph + build_graph_data(issue, jira, options.excludes, options.ignores, options.show_directions, options.directions,
292296
options.includes, options.issue_excludes, options.closed, options.ignore_epic,
293297
options.ignore_subtasks, options.traverse, options.word_wrap)
294298

0 commit comments

Comments
 (0)