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

Create separate threads on GitHub Discussions #5

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

SD-13
Copy link
Contributor

@SD-13 SD-13 commented Nov 20, 2024

@SD-13 SD-13 marked this pull request as draft November 20, 2024 08:20
Copy link
Member

@seanlip seanlip left a 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:
Copy link
Member

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".

Copy link
Contributor Author

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.
Copy link
Member

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'."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

repo_name: str,
discussion_category: str,
) -> None:
"""Delete all existing discussions"""
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

discussion_title: str,
discussion_body: str
):
"""Create new discussion with given title and body."""
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor Author

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)
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@seanlip seanlip left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When sending "stale review" notifications, create separate threads on GitHub Discussions.
2 participants