Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
osoukup committed Nov 25, 2024
1 parent 9aca1c5 commit 15a2e8d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osidb/models/flaw/flaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,9 @@ def _create_task():
task_download_manager = models.ForeignKey(
JiraTaskDownloadManager, null=True, blank=True, on_delete=models.CASCADE
)
# task_sync_manager = models.ForeignKey(
# JiraTaskSyncManager, null=True, blank=True, on_delete=models.CASCADE
# )
bzsync_manager = models.ForeignKey(
BZSyncManager, null=True, blank=True, on_delete=models.CASCADE
)
44 changes: 44 additions & 0 deletions osidb/sync_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,50 @@ def __str__(self):
return result


# class JiraTaskSyncManager(SyncManager):
# """
# Sync manager class for OSIDB => Jira Task synchronization.
# """

# @staticmethod
# @app.task(name="sync_manager.jira_task_sync", bind=True)
# def sync_task(self, flaw_id):
# """
# perform the sync of the task of the given flaw to Jira

# the task may not be exising yet when performing the first
# sync therefore we use the flaw UUID as the identifier
# """
# from osidb.models import Flaw

# JiraTaskSyncManager.started(flaw_id, self)

# set_user_acls(settings.ALL_GROUPS)

# try:
# flaw = Flaw.objects.get(uuid=flaw_id)
# flaw._perform_tasksync()
# except Exception as e:
# JiraTaskSyncManager.failed(flaw_id, e)
# else:
# JiraTaskSyncManager.finished(flaw_id)

# def update_synced_links(self):
# from osidb.models import Flaw

# Flaw.objects.filter(uuid=self.sync_id).update(bzsync_manager=self)

# def __str__(self):
# from osidb.models import Flaw

# result = super().__str__()
# flaws = Flaw.objects.filter(uuid=self.sync_id)
# cves = [f.cve_id or f.uuid for f in flaws]
# result += f"Flaws: {cves}\n"

# return result


class JiraTrackerDownloadManager(SyncManager):
"""
Sync manager class for Jira => OSIDB Tracker synchronization.
Expand Down

0 comments on commit 15a2e8d

Please sign in to comment.