Skip to content

Commit

Permalink
Change @Reviewer functionality from status to tag
Browse files Browse the repository at this point in the history
  • Loading branch information
LeMurphant committed Dec 8, 2024
1 parent da980a1 commit 38d0d56
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions modules/question_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <gdoc-link(s)>` - change status to `In review`
`@reviewer <gdoc-link(s)>` - tag the article as `In review`
`@feedback <gdoc-link(s)>` - change status to `In progress`
`@feedback-sketch <gdoc-link(s)>` - change status to `Bulletpoint sketch`
Expand Down Expand Up @@ -182,22 +182,27 @@ 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:
status = "In progress"
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,
Expand Down

0 comments on commit 38d0d56

Please sign in to comment.