-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create separate threads on GitHub Discussions #5
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SD-13, I think this looks great, thanks for working on it so quickly!
I left a few inline comments. Just a few general notes:
- The jam.dev functionality looks good, but doesn't show what happens when you click into a discussion. Could you show it please?
- The CI checks are failing, might be worth taking a look at them.
Other than that, it looks really good to me ;) Thanks a lot!
Hi {{ username }}, | ||
|
||
It looks like you're assigned to this PR, but haven't taken any action for at least 2 days: | ||
The following PRs are blocked on your review: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll still want to keep the "Hi {{username}}" bit, otherwise this is a bit abrupt?
Let's maybe also changed "blocked" here to "currently blocked".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
{{ pr_list }} | ||
|
||
Please review and unassign yourself from the pending PRs as soon as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this line, thanks. Let's also change it to: "Please review and unassign yourself from the pending PRs as soon as possible, then mark this discussion thread as 'Done'."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
src/github_services.py
Outdated
repo_name: str, | ||
discussion_category: str, | ||
) -> None: | ||
"""Delete all existing discussions""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete all existing discussions in the given discussion category.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/github_services.py
Outdated
discussion_title: str, | ||
discussion_body: str | ||
): | ||
"""Create new discussion with given title and body.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a new discussion with the given title and body in the given discussion category.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/main.py
Outdated
"""Generates message using the template provided in | ||
PENDING_REVIEW_NOTIFICATION_TEMPLATE.md. | ||
|
||
Args: | ||
username: str. Reviewer username. | ||
pr_list: str. List of PRs not reviewed within the maximum waiting time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit odd that this is a string. Is it actually a string or is it a list?
If the former, maybe more info in the docstring about how this string is actually formatted would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it is taking PullRequest
objects as input and joining it to string inside the function.
src/main.py
Outdated
reviewer_name, prs, org_name, repo_name, discussion_category, discussion_title) | ||
for reviewer_name, pr_list in reviewer_to_assigned_prs.items(): | ||
discussion_title = f"Pending Reviews: @{reviewer_name}" | ||
discussion_body = generate_message('\n'.join(str(pr) for pr in pr_list), TEMPLATE_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the first arg here seems to be doing some joining. Maybe better to do that in the generate_message() function instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, now we are doing it inside the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @SD-13 -- code looks fine to me generally with regards to the inline comments. Just need to fix the CI, and if you could add a demo video showing what going "into" a discussion thread looks like, that'd be great. Thanks!
Fixes #4
I tested the changes in my repo
https://jam.dev/c/d9844463-3bd6-4c09-bc59-423dfed0b582