From 166a8924084bb22c86f0cbb2bc1ebbbcc5fe068f Mon Sep 17 00:00:00 2001 From: Ian H Pittwood Date: Thu, 27 Feb 2020 11:24:49 -0600 Subject: [PATCH] Finalize changes for 0.0.1 build --- AUTHORS | 2 ++ ChangeLog | 9 +++++++++ gerrit_to_github_issues/engine.py | 14 +++++++------- setup.cfg | 5 ++++- 4 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 AUTHORS create mode 100644 ChangeLog diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..c4faf9b --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Ian H Pittwood +Ian Pittwood diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..afd27b1 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,9 @@ +CHANGES +======= + +* Prepare project for packaging +* Implement Relates-To and Closes tagging +* Test and debug interactions +* Implement Gerrit change retrieval and processing +* Add initial script implemented in a Zuul playbook +* Initial commit diff --git a/gerrit_to_github_issues/engine.py b/gerrit_to_github_issues/engine.py index 6977d51..896ce97 100644 --- a/gerrit_to_github_issues/engine.py +++ b/gerrit_to_github_issues/engine.py @@ -46,27 +46,27 @@ def process_change(change: dict, repo: Repository, gerrit_url: str): link_exists = github_issues.check_issue_for_matching_comments(issue, change_url) if issue.state == 'closed' and not link_exists: LOG.debug(f'Issue #{issue_number} was closed, reopening...') - #issue.edit(state='open') - #issue.create_comment('Issue reopened due to new activity on Gerrit.\n\n') + issue.edit(state='open') + issue.create_comment('Issue reopened due to new activity on Gerrit.\n\n') labels = [str(l.name) for l in list(issue.get_labels())] if 'WIP' in change['commitMessage'] or 'DNM' in change['commitMessage']: if 'wip' not in labels: LOG.debug(f'add `wip` to #{issue_number}') - #issue.add_to_labels('wip') + issue.add_to_labels('wip') if 'ready for review' in labels: try: LOG.debug(f'rm `ready for review` to #{issue_number}') - #issue.remove_from_labels('ready for review') + issue.remove_from_labels('ready for review') except github.GithubException: LOG.debug(f'`ready for review` tag does not exist on issue #{issue_number}') else: if 'ready for review' not in labels: LOG.debug(f'add `ready for review` to #{issue_number}') - #issue.add_to_labels('ready for review') + issue.add_to_labels('ready for review') if 'wip' in labels: try: LOG.debug(f'rm `wip` to #{issue_number}') - #issue.remove_from_labels('wip') + issue.remove_from_labels('wip') except github.GithubException: LOG.debug(f'`wip` tag does not exist on issue #{issue_number}') if not link_exists: @@ -78,5 +78,5 @@ def process_change(change: dict, repo: Repository, gerrit_url: str): comment_msg += '\n\nThis change will close this issue when merged.' if comment_msg: LOG.debug(f'Comment to post on #{issue_number}: {comment_msg}') - #issue.create_comment(comment_msg) + issue.create_comment(comment_msg) LOG.info(f'Comment posted to issue #{issue_number}') diff --git a/setup.cfg b/setup.cfg index 3e39f8f..b3f514e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,4 +21,7 @@ packages = [entry_points] console_scripts = - gerrit-to-github-issues = gerrit_to_github_issues.cli:main \ No newline at end of file + gerrit-to-github-issues = gerrit_to_github_issues.cli:main + +[bdist_wheel] +universal = 0 \ No newline at end of file