Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
sync-ci-images: images_streams_prs: Retry jira search
Browse files Browse the repository at this point in the history
  • Loading branch information
joepvd committed Mar 14, 2023
1 parent 98cdae4 commit 5d1e959
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doozerlib/cli/images_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from github import Github, UnknownObjectException, GithubException

from jira import JIRA, Issue
from tenacity import retry, stop_after_attempt, wait_fixed

from dockerfile_parse import DockerfileParser
from doozerlib.model import Missing
Expand Down Expand Up @@ -652,7 +653,12 @@ def reconcile_jira_issues(runtime, pr_links: Dict[str, str], dry_run: bool):
component = 'Unknown'

query = f'project={project} AND summary ~ "{summary}" AND statusCategory in ("To Do", "In Progress")'
open_issues = jira_client.search_issues(query)

@retry(reraise=True, stop=stop_after_attempt(10), wait=wait_fixed(3))
def search_issues(query):
return jira_client.search_issues(query)

open_issues = search_issues(query)

if open_issues:
print(f'A JIRA issue is already open for {pr_url}: {open_issues[0]}')
Expand Down

0 comments on commit 5d1e959

Please sign in to comment.