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

GIthub Discussions and Discussion Comments Webhooks #808

Merged

Conversation

elewis787
Copy link
Contributor

@elewis787 elewis787 commented Jul 23, 2024

Summary

This pr adds basic support for GitHub discussions and discussion comment events.

Ticket Link

If this pull request addresses a Help Wanted ticket #480

Notes

I would love to hear thoughts on the template for both discussions and discussion comments. I did not add additional style or attempt to pull out a lot of information but I am happy to update the template as needed.

I also struggled with the playwrite test. If helpful, I am happy to further debug them and ensure they are working. I tested this manually using smee.io for webhook forwarding to a local deployment. I replayed the webhooks while testing.

test where done by integrated https://github.com/orgs/elewis787-org/discussions

I have attached a few screenshots to help demonstrate the functionality

Screenshot 2024-07-23 at 7 38 40 AM Screenshot 2024-07-23 at 7 38 06 AM

@elewis787 elewis787 requested a review from wiggin77 as a code owner July 23, 2024 04:24
@mattermost-build
Copy link
Contributor

Hello @elewis787,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement?
Once you have signed the CLA, please comment with /check-cla and confirm that the CLA check is green.

This is a standard procedure for many open source projects.

Please let us know if you have any questions.

We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

@fmartingr fmartingr self-requested a review July 23, 2024 07:35
@hanzei hanzei added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Jul 23, 2024
@hanzei hanzei linked an issue Jul 23, 2024 that may be closed by this pull request
Copy link
Contributor

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

Good work on the PR! No specific complaints but there are a few typos around.

Can you get some screenshots and add those to the PR summary?

Makefile Show resolved Hide resolved
server/plugin/template.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
elewis787 and others added 7 commits July 23, 2024 07:29
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
@elewis787
Copy link
Contributor Author

elewis787 commented Jul 23, 2024

Good work on the PR! No specific complaints but there are a few typos around.

Can you get some screenshots and add those to the PR summary?

Thanks @fmartingr. Apologies for the spelling errors!

I have attached screenshots and a demo org/repository.

@elewis787 elewis787 requested a review from fmartingr July 23, 2024 14:45
Copy link
Contributor

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

Thanks for the submission! I will request someone else's reviews to have more eyes on this and make sure it adheres to the plugin guidelines.

@fmartingr
Copy link
Contributor

@elewis787 Can you check the lint errors?

@fmartingr fmartingr requested review from ayusht2810, Kshitij-Katiyar and hanzei and removed request for ayusht2810 July 24, 2024 10:57
@elewis787
Copy link
Contributor Author

@elewis787 Can you check the lint errors?

I pushed a fix for the indentation error in the const block. I'm looking into if I can retrigger the ci lint check to verify I caught all of them. I am not seeing any other changes locally.

Copy link
Contributor

@raghavaggarwal2308 raghavaggarwal2308 left a comment

Choose a reason for hiding this comment

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

@elewis787 Great work on this PR. Just added a few code refactoring comments

server/plugin/subscriptions.go Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
webapp/package-lock.json Outdated Show resolved Hide resolved
server/plugin/template.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
server/plugin/webhook.go Outdated Show resolved Hide resolved
@hanzei
Copy link
Contributor

hanzei commented Jul 29, 2024

@fmartingr There are already four other people who review the PR. If you don't mind, I prefer not to review the PR. Is that fine with you?

@raghavaggarwal2308
Copy link
Contributor

raghavaggarwal2308 commented Jul 30, 2024

@wiggin77 Can you please give this PR a review. Also, I have never worked on playwright tests,so not sure about the changes make in the playwright tests.

I see the package-lock.json shows edits - I can revert this as needed - these changes are a result of using an audit fix. I was not able to use the e2e test locally. I suspect that this is largely related to my local node version. I did not attempt to revert back to previous versions.

@elewis787 Yes, I think we can revert that

@elewis787
Copy link
Contributor Author

@wiggin77 Can you please give this PR a review. Also, I have never worked on playwright tests,so not sure about the changes make in the playwright tests.

I see the package-lock.json shows edits - I can revert this as needed - these changes are a result of using an audit fix. I was not able to use the e2e test locally. I suspect that this is largely related to my local node version. I did not attempt to revert back to previous versions.

@elewis787 Yes, I think we can revert that

I have push a reverted package-lock.json for the e2e tests.

Copy link
Member

@wiggin77 wiggin77 left a comment

Choose a reason for hiding this comment

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

Great work @elewis787 👍

@wiggin77 wiggin77 removed the 2: Dev Review Requires review by a core committer label Jul 31, 2024
@mattermost-build
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

@mattermost-build
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

@elewis787
Copy link
Contributor Author

Anything I can do to help push this forward?

@raghavaggarwal2308
Copy link
Contributor

raghavaggarwal2308 commented Aug 26, 2024

Anything I can do to help push this forward?

Hey @elewis787 ,
This PR is waiting for a approval from QA. We will try to get it reviewed ASAP.
Apologies for the delay.
cc: @AayushChaudhary0001

@elewis787
Copy link
Contributor Author

elewis787 commented Aug 26, 2024

Anything I can do to help push this forward?

Hey @elewis787 , This PR is waiting for a approval from QA. We will try to get it reviewed ASAP. Apologies for the delay. cc: @AayushChaudhary0001

Thank you! No rush. Please reach out if there is anything I can do to help.

Copy link

@AayushChaudhary0001 AayushChaudhary0001 left a comment

Choose a reason for hiding this comment

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

This PR has been tested and looks good. All the notifications regarding the new discussion creation and discussion comments are received on Mattermost. Approved.

Note:- Please add the change regarding the events(discussions, discussion comments) to be enabled in Github webhook for notifications of discussions and discussion comments in the readme file.

@raghavaggarwal2308 raghavaggarwal2308 added Docs/Needed Requires documentation and removed Lifecycle/1:stale 3: QA Review Requires review by a QA tester labels Aug 27, 2024
@raghavaggarwal2308
Copy link
Contributor

raghavaggarwal2308 commented Aug 27, 2024

@elewis787 Can you create a PR in the MM docs https://github.com/mattermost/docs repo for the documentation changes? I think the webhook configurations needed to be updated for this PR to work.

@elewis787
Copy link
Contributor Author

Absolutely! I'll work on a write up.

@raghavaggarwal2308
Copy link
Contributor

@elewis787 Thanks! Please let us know when the PR is created. We can merge this PR after that

@elewis787
Copy link
Contributor Author

elewis787 commented Aug 28, 2024

@raghavaggarwal2308 here are the minimal doc updates mattermost/docs#7371.

Please let me know if more details are needed.

@raghavaggarwal2308
Copy link
Contributor

@elewis787 Awesome work on this PR. Thank you for your contribution.

@raghavaggarwal2308 raghavaggarwal2308 merged commit 489c828 into mattermost:master Aug 28, 2024
9 checks passed
@elewis787
Copy link
Contributor Author

@raghavaggarwal2308 Thanks for all of your help with the reviews and direction! I am excited to see this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Docs/Needed Requires documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate supporting GitHub Discussions webhooks
7 participants