Skip to content

Commit a081ba4

Browse files
authored
Merge pull request #25 from AFPy/get_and_single_reviewers_name
2 parents f6d16f1 + 021250f commit a081ba4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.4.1
1+
v1.5.0

pydocteur/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from dotenv import load_dotenv
66
from flask import Flask
7+
from flask import jsonify
78
from flask import request
89
from github import Github
910

@@ -13,6 +14,7 @@
1314
from pydocteur.utils.pr_status import is_pr_approved
1415
from pydocteur.utils.state_actions import comment_pr
1516
from pydocteur.utils.state_actions import merge_and_thank_contributors
17+
from pydocteur.utils.state_actions import version
1618

1719
load_dotenv()
1820

@@ -39,8 +41,13 @@ def state_name(**kwargs):
3941
return SIMPLIFICATIONS.get(state, state)
4042

4143

42-
@application.route("/", methods=["POST"])
44+
@application.route("/", methods=["POST", "GET"])
4345
def process_incoming_payload():
46+
if request.method == "GET":
47+
return (
48+
jsonify({"name": "PyDocTeur", "source": "https://github.com/afpy/pydocteur", "version": version().strip()}),
49+
200,
50+
)
4451
payload = json.loads(request.data)
4552
if payload["sender"]["login"] == "PyDocTeur":
4653
logging.info("Received payload sent from PyDocTeur user, ignoring.")

pydocteur/utils/state_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def version():
3939
def replace_body_variables(pr: PullRequest, body: str):
4040
logging.debug("Replacing variables")
4141
author = pr.user.login
42-
reviewers_login = [review.user.login for review in pr.get_reviews()]
42+
reviewers_login = {review.user.login for review in pr.get_reviews()}
4343
new_body = body.replace("@$AUTHOR", "@" + author)
4444
if not reviewers_login:
4545
reviewers_login = ["JulienPalard", "Seluj78"]

0 commit comments

Comments
 (0)