Finalize changes for 0.0.1 build

This commit is contained in:
Ian H Pittwood 2020-02-27 11:24:49 -06:00
parent 21c88fef51
commit 166a892408
4 changed files with 22 additions and 8 deletions

2
AUTHORS Normal file
View File

@ -0,0 +1,2 @@
Ian H Pittwood <pittwoodian@gmail.com>
Ian Pittwood <pittwoodian@gmail.com>

9
ChangeLog Normal file
View File

@ -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

View File

@ -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}')

View File

@ -22,3 +22,6 @@ packages =
[entry_points]
console_scripts =
gerrit-to-github-issues = gerrit_to_github_issues.cli:main
[bdist_wheel]
universal = 0