From 5dc20c2eb3d0023611996f453917b8420354404a Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Wed, 19 Jun 2019 15:11:20 -0400 Subject: [PATCH 1/3] new check for copyediting --- astropy_bot/copyedit_checker.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 astropy_bot/copyedit_checker.py diff --git a/astropy_bot/copyedit_checker.py b/astropy_bot/copyedit_checker.py new file mode 100644 index 0000000..eae02c2 --- /dev/null +++ b/astropy_bot/copyedit_checker.py @@ -0,0 +1,32 @@ +from baldrick.plugins.github_pull_requests import pull_request_handler + + +COPYEDITOR_GH_HANDLE = 'lglattly' + + +@pull_request_handler +def check_copyedit_docs(pr_handler, repo_handler): + statuses = {} + + if 'docs' in pr_handler.labels: + if 'copyedited' in pr_handler.labels: + statuses['copyedit'] = { + 'description': "This PR has been copyedited.", + 'state': 'success' + } + + else: + statuses['copyedit'] = { + 'description': "This PR modifies the documentation and is " + "waiting for copyediting. No action is needed " + "from the contributor.", + 'state': 'failure' + } + + else: + return None + + if COPYEDITOR_GH_HANDLE not in pr_handler.json['assignees']: + pr_handler.add_assignees(COPYEDITOR_GH_HANDLE) + + return statuses From 51d1fda301242435fc22ddf4f90db42cfe8c913c Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Wed, 19 Jun 2019 15:11:51 -0400 Subject: [PATCH 2/3] todo --- astropy_bot/copyedit_checker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/astropy_bot/copyedit_checker.py b/astropy_bot/copyedit_checker.py index eae02c2..8f0c940 100644 --- a/astropy_bot/copyedit_checker.py +++ b/astropy_bot/copyedit_checker.py @@ -1,6 +1,8 @@ from baldrick.plugins.github_pull_requests import pull_request_handler +# TODO: we need to note somewhere that if the copyeditor changes, this needs to +# be updated! COPYEDITOR_GH_HANDLE = 'lglattly' From 14d2cc2834200874a10e6353631902dfd57629cb Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Wed, 19 Jun 2019 15:11:56 -0400 Subject: [PATCH 3/3] import new check --- run.py | 1 + 1 file changed, 1 insertion(+) diff --git a/run.py b/run.py index 5c01de6..fb6c4f1 100644 --- a/run.py +++ b/run.py @@ -11,6 +11,7 @@ # Load astropy-specific plugins import astropy_bot.changelog_checker # noqa +import astropy_bot.copyedit_checker # noqa # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get('PORT', 5000))