Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change @reviewer functionality from status to tag #331

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading