Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
webbnh committed Nov 20, 2024
1 parent cd3b9d5 commit 9d9b52c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions sync2jira/upstream_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,10 @@ def github_issues(upstream, config):
log.debug("GitHub error while fetching issue %s/%s#%s: %s",
orgname, reponame, issuenumber, response.text)
continue
gh_field_name = ''
try:
project_node = _get_current_project_node(
upstream, project_number, issuenumber, gh_issue)
item_nodes = project_node['fieldValues']['nodes'] if project_node else []
project_node = _get_current_project_node(
upstream, project_number, issuenumber, gh_issue)
if project_node:
item_nodes = project_node.get('fieldValues', {}).get('nodes', {})
for item in item_nodes:
gh_field_name = item.get('fieldName', {}).get('name')
prio_field = github_project_fields.get('priority', {}).get('gh_field')
Expand All @@ -360,14 +359,10 @@ def github_issues(upstream, config):
if gh_field_name == sp_field:
try:
issue['storypoints'] = int(item['number'])
except ValueError as err:
except (ValueError, KeyError) as err:
log.debug(
"Error while processing storypoints for issue %s/%s#%s: %s",
orgname, reponame, issuenumber, err)
except KeyError as err:
log.debug("Error fetching %s!r from GitHub issue %s/%s#%s: %s",
gh_field_name, orgname, reponame, issuenumber, err)
continue

final_issues.append(issue)

Expand Down

0 comments on commit 9d9b52c

Please sign in to comment.