Skip to content

Commit

Permalink
Import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed May 31, 2024
1 parent fa459d6 commit 9d7752c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions estimage/plugins/crypto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ def _get_owner_epic_of(self, assignee, committed):
name = f"{PROJECT_NAME}-{assignee}"
if committed:
name += "-C"
if self._import_context == "proj":
name += "-future"

epic = self._cards_by_id.get(name)

if not epic:
epic = self.item_class(name)
epic.assignee = assignee
epic.title = f"Issues of {assignee}"
if self._import_context == "proj":
epic.title = f"Future issues of {assignee}"
epic.tier = 1
epic.status = "in_progress"
if committed:
Expand Down
4 changes: 4 additions & 0 deletions estimage/plugins/jira/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class Importer(importer.BareboneImporter):
def __init__(self, spec):
super().__init__(spec)

self._import_context = "none"
self.retrospective_query = spec.retrospective_query
self.projective_query = spec.projective_query
self.cutoff_date = spec.cutoff_date
Expand Down Expand Up @@ -242,17 +243,20 @@ def _export_jira_tree_to_cards(self, root_results):

def import_data(self, extractor_cls=EventExtractor):
if self.retrospective_query:
self._import_context = "retro"
self.report("Gathering retro stuff")
root_results = self._get_and_record_jira_tree(self.retrospective_query)
new_cards = self._export_jira_tree_to_cards(root_results)
self._retro_cards.update(new_cards)

if self.projective_query:
self._import_context = "proj"
self.report("Gathering proj stuff")
root_results = self._get_and_record_jira_tree(self.projective_query)
new_cards = self._export_jira_tree_to_cards(root_results)
self._projective_cards.update(new_cards)

self._import_context = "none"
new_cards = self._retro_cards.union(self._projective_cards)
for name in new_cards:
if name not in self._all_issues_by_name:
Expand Down

0 comments on commit 9d7752c

Please sign in to comment.