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

Merged
merged 17 commits into from
Dec 5, 2024

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!

@SD-13 SD-13 marked this pull request as ready for review December 4, 2024 20:42
@SD-13
Copy link
Contributor Author

SD-13 commented Dec 4, 2024

Hey @seanlip, here is a jam(https://jam.dev/c/d202211c-e4a0-476b-ba59-4409bdb6d225) of the discussions, you can also check out them here https://github.com/SD-13/test-pending-review-notifier/discussions/categories/notify-reviewers2.
(Note: While testing, I removed "@" from discussion body to avoid unnecessary ping)

Please review the changes when you get time. Thanks!

@SD-13 SD-13 requested a review from seanlip December 4, 2024 20:46
@SD-13 SD-13 removed their assignment Dec 5, 2024
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! No concerns from my end, and the proof looks good. Let's get this merged!

@seanlip seanlip merged commit 48e428b into oppia:develop Dec 5, 2024
3 checks passed
@seanlip
Copy link
Member

seanlip commented Dec 5, 2024

@SD-13 We need to get the stale notifier working on oppia/oppia as well. I'm making updates to the CI workflows on oppia/oppia in oppia/oppia#21363 and I've included the update there -- see oppia/oppia@3f7e63b .

Just FYI! The new workflow should start working when that PR is merged :)

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