From 76dcd9ecebae19db3d8fabe8d433f0eb540aad27 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Mon, 20 Mar 2023 15:14:44 -0500 Subject: [PATCH 1/2] Issue requester login information to associate PRs --- src/ontobot_change_agent/api.py | 1 + src/ontobot_change_agent/cli.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/ontobot_change_agent/api.py b/src/ontobot_change_agent/api.py index c59521d..e7d4442 100644 --- a/src/ontobot_change_agent/api.py +++ b/src/ontobot_change_agent/api.py @@ -96,6 +96,7 @@ def _extract_info_from_issue_object(issue: Issue) -> dict: issue_as_dict = issue.__dict__ important_info = {k: issue_as_dict[RAW_DATA][k] for k in ISSUE_KEYS} important_info["body"] = _make_sense_of_body(important_info["body"]) + important_info["user"] = issue_as_dict["_rawData"]["user"]["login"] return important_info diff --git a/src/ontobot_change_agent/cli.py b/src/ontobot_change_agent/cli.py index f5cbdf6..53e2d9d 100644 --- a/src/ontobot_change_agent/cli.py +++ b/src/ontobot_change_agent/cli.py @@ -20,6 +20,7 @@ BODY = "body" TITLE = "title" +USER = "user" @click.group() @@ -186,15 +187,18 @@ def process_issue( formatted_body += _list_to_markdown(KGCL_COMMANDS) formatted_body += "
Fixes #" + str(issue["number"]) # TODO: remove `set-output` when env var setting is confirmed. + import pdb; pdb.set_trace() if os.getenv("GITHUB_ENV"): with open(os.getenv("GITHUB_ENV"), "a") as env: # type: ignore print(f"PR_BODY={formatted_body}", file=env) print(f"PR_TITLE={issue[TITLE]}", file=env) + print(f"ISSUE_CREATOR={issue[USER]}", file=env) click.echo( f""" PR_BODY={formatted_body} PR_TITLE={issue[TITLE]} + ISSUE_CREATOR={issue[USER]} """ ) else: From 89bb4f43f745a10a769fd9bef06732b151dbbd47 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Mon, 20 Mar 2023 15:16:12 -0500 Subject: [PATCH 2/2] Removed debugger --- src/ontobot_change_agent/cli.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ontobot_change_agent/cli.py b/src/ontobot_change_agent/cli.py index 53e2d9d..f5a481a 100644 --- a/src/ontobot_change_agent/cli.py +++ b/src/ontobot_change_agent/cli.py @@ -187,7 +187,6 @@ def process_issue( formatted_body += _list_to_markdown(KGCL_COMMANDS) formatted_body += "
Fixes #" + str(issue["number"]) # TODO: remove `set-output` when env var setting is confirmed. - import pdb; pdb.set_trace() if os.getenv("GITHUB_ENV"): with open(os.getenv("GITHUB_ENV"), "a") as env: # type: ignore print(f"PR_BODY={formatted_body}", file=env)