From 38d0d56b34061a65c50c9c91e7e2bfd4a3a4751e Mon Sep 17 00:00:00 2001 From: Olivier Coutu Date: Sun, 8 Dec 2024 03:28:17 -0500 Subject: [PATCH 1/2] Change @reviewer functionality from status to tag --- modules/question_setter.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/question_setter.py b/modules/question_setter.py index c4e62f2..2773d53 100644 --- a/modules/question_setter.py +++ b/modules/question_setter.py @@ -8,7 +8,7 @@ Review request, @reviewer, @feedback, @feedback-sketch Request a review on an answer you wrote/edited On Rob Miles's Discord server, an `@editor` can ask other `@editor`s and `@reviewer`s to give them feedback or review their changes to AI Safety Info questions. You just put one or more links to appropriate GDocs and mention one of: `@reviewer`, `@feedback`, or `@feedback-sketch`. Stampy will spot this and update their statuses in the coda table with answers appropriately. -`@reviewer ` - change status to `In review` +`@reviewer ` - tag the article as `In review` `@feedback ` - change status to `In progress` `@feedback-sketch ` - change status to `Bulletpoint sketch` @@ -182,9 +182,20 @@ def parse_review_request(self, message: ServiceMessage) -> Optional[Response]: """ text = message.clean_content + # try parsing gdoc links and questions that have these gdoc links + # if you fail, assume this is not a review request + if not (gdoc_links := parse_gdoc_links(text)): + return + self.msg_id2gdoc_links[message.id] = gdoc_links + # get new status for questions if "@reviewer" in text: - status = "In review" + query = ("GDocLinks", gdoc_links) + return Response( + confidence=10, + callback=self.cb_edit_tag, + args=[query, "in-review", message, "add"], + ) elif "@feedback-sketch" in text: status = "Bulletpoint sketch" elif "@feedback" in text: @@ -192,12 +203,6 @@ def parse_review_request(self, message: ServiceMessage) -> Optional[Response]: else: # if neither of these three roles is mentioned, this is not a review request return - # try parsing gdoc links and questions that have these gdoc links - # if you fail, assume this is not a review request - if not (gdoc_links := parse_gdoc_links(text)): - return - self.msg_id2gdoc_links[message.id] = gdoc_links - return Response( confidence=10, callback=self.cb_review_request, From 5c56644d39b87e99896c63068a2652e6af80c401 Mon Sep 17 00:00:00 2001 From: Olivier Coutu Date: Thu, 16 Jan 2025 11:37:45 -0500 Subject: [PATCH 2/2] Removed more traces of "in review" Also removed "Duplicate" from coda statuses --- api/utilities/coda_utils.py | 5 ++--- modules/question_setter.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/utilities/coda_utils.py b/api/utilities/coda_utils.py index 0c2cf5a..f2ebb69 100644 --- a/api/utilities/coda_utils.py +++ b/api/utilities/coda_utils.py @@ -63,10 +63,9 @@ class QuestionRow(TypedDict): # Status of question in coda table QuestionStatus = Literal[ "Bulletpoint sketch", - "Duplicate", "Dormant", "In progress", - "In review", + "Unlisted" "Live on site", "Marked for deletion", "Not started", @@ -85,5 +84,5 @@ class QuestionRow(TypedDict): REVIEW_STATUSES: set[QuestionStatus] = { "Bulletpoint sketch", "In progress", - "In review", + "Unlisted", } diff --git a/modules/question_setter.py b/modules/question_setter.py index b439d71..297e6c8 100644 --- a/modules/question_setter.py +++ b/modules/question_setter.py @@ -71,7 +71,7 @@ GDocLinks = list[str] MsgRefId = str -ReviewStatus = Literal["In review", "Bulletpoint sketch", "In progress", "Unlisted"] +ReviewStatus = Literal["Bulletpoint sketch", "In progress", "Unlisted"] MarkingStatus = Literal["Marked for deletion", "Duplicate"] EditAction = Literal["add", "remove", "clear"]