Skip to content

Commit

Permalink
Tweak logging
Browse files Browse the repository at this point in the history
  • Loading branch information
webbnh committed Nov 16, 2024
1 parent 58446d3 commit 29071b9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions sync2jira/downstream_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,10 @@ def _get_preferred_issue_types(config, issue):
# 'enhancement': 'Story'
# }
type_list = []
log.debug(config)

map = config['sync2jira'].get('map', {})
conf = map.get('github', {}).get(issue.upstream, {})

log.debug(conf)
# we consider the issue_types mapping if it exists. If it does, exclude all other logic.
if 'issue_types' in conf:
for tag, issue_type in conf['issue_types'].items():
Expand Down Expand Up @@ -616,11 +614,6 @@ def _create_jira_issue(client, issue, config):
:returns: Returns JIRA issue that was created
:rtype: jira.resources.Issue
"""
log.info("Creating %r issue for %r", issue.downstream, issue)
if config['sync2jira']['testing']:
log.info("Testing flag is true. Skipping actual creation.")
return

custom_fields = issue.downstream.get('custom_fields', {})
preferred_types = _get_preferred_issue_types(config, issue)
description = _build_description(issue)
Expand All @@ -646,7 +639,11 @@ def _create_jira_issue(client, issue, config):
if 'labels' in issue.downstream.keys():
kwargs['labels'] = issue.downstream['labels']

log.info("Creating issue.")
log.info("Creating issue for %r: %r", issue, kwargs)
if config['sync2jira']['testing']:
log.info("Testing flag is true. Skipping actual creation.")
return

downstream = client.create_issue(**kwargs)

# Add Epic link, QA, EXD-Service field if present
Expand Down

0 comments on commit 29071b9

Please sign in to comment.