Skip to content

Commit

Permalink
Print a diff of the ranking order, for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed May 22, 2024
1 parent 9cdc324 commit 199c938
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rules/team/rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
improvements that have been ranked very high.
"""

import difflib

import jira


Expand Down Expand Up @@ -69,6 +71,13 @@ def _set_rank(
total = len(new_ranking)
rerank = False

print(''.join(list(difflib.unified_diff(
[f"{issue.key} {issue.fields.summary}\n" for issue in old_ranking],
[f"{issue.key} {issue.fields.summary}\n" for issue in new_ranking],
"old_ranking",
"new_ranking",
))))

for index, issue in enumerate(new_ranking):
if issue != old_ranking[index]:
# Once we start reranking, we don't stop.
Expand Down
8 changes: 8 additions & 0 deletions src/rules/team/timesensitive_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import datetime
import difflib

import jira

Expand Down Expand Up @@ -40,6 +41,13 @@ def _set_rank(
total = len(new_ranking)
rerank = False

print(''.join(list(difflib.unified_diff(
[f"{issue.key} {issue.fields.summary}\n" for issue in old_ranking],
[f"{issue.key} {issue.fields.summary}\n" for issue in new_ranking],
"old_ranking",
"new_ranking",
))))

for index, issue in enumerate(new_ranking):
if issue != old_ranking[index]:
# Once we start reranking, we don't stop.
Expand Down

0 comments on commit 199c938

Please sign in to comment.