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

✨ Reactions - Migrate from custom to Giscus #1567

Closed
8 tasks done
babakamyljanovssw opened this issue Oct 15, 2024 · 9 comments
Closed
8 tasks done

✨ Reactions - Migrate from custom to Giscus #1567

babakamyljanovssw opened this issue Oct 15, 2024 · 9 comments
Assignees
Labels
Type: Feature A suggested idea for this project

Comments

@babakamyljanovssw
Copy link
Member

babakamyljanovssw commented Oct 15, 2024

Cc: @adamcogan @wicksipedia @bradystroud @tkapa

Hi Team,

Summary video of the discussion: https://youtu.be/J2Hx9rGU0cM
Email subject: SSW.Rules - Reactions feature broken

As per our conversation on Teams calls, it was decided that we are going to use Giscus for Reactions instead of Azure Functions.

Tasks

  • Add Giscus to rules page for reactions
  • Remove Profile page
  • Work out the best way to make existing CTF discussions show up on Rules
  • Remove Azure Functions used for reactions
  • Do a Done Video
  • Deploy SSW.Rules to Production
  • Deploy SSW.Rules.Functions to Production
  • Update Chewing the Fat template

Done Video - https://youtu.be/J2Hx9rGU0cM

@babakamyljanovssw
Copy link
Member Author

babakamyljanovssw commented Oct 18, 2024

Update:

Giscus reactions can't be separately implemented, because out of box it only supports to disable reactions not discussions.
So I will be doing ✨ Comments - Move from Disqus to giscus as part of this work together.

About migrating data:

Custom Reactions
As per email, we are going to send email to ask users to manually add their reactions

Disqus Comments
I've exported all comments to my local as xml file, but migrating them to Giscus would be problem as users commented using their Disqus account, so we can't link each users comments to their GitHub username using GitHub API. (To be able to link each users comment to their GitHub account, it would require to create GitHub API client with each person's access token which is impossible)

I found a repo that migrates comments from Disqus to Giscus, this tool adds old comments to Giscus discussion, and links the comment to one specified user. For example we can create account with name comment-migrator and the old message will be added in below format:

var message = $"Comment written by **{post.Author}** on **{post.CreatedAt}** {post.Message}";

So here the original author name will be displayed in the comment and commented account will be comment-migrator.

Repo - Disqus to GitHub issues - https://github.com/JuergenGutsch/disqus-to-github-issues/tree/master/DisqusToGithubIssues
Repo - Disqus to Giscus - https://github.com/andrewlock/convert-disqus-to-giscus/
Blog - https://andrewlock.net/migrating-comments-from-dsqus-to-giscus/
Blog - https://www.eliostruyf.com/migrate-disqus-github-discussions-giscus/

As per this comment #1382 (comment) from old PR that adds Giscus, Adam suggested we have Giscus and Disqus for now.
We can ask people to make comments again by the mean time, and maybe after 30 days, we migrate leftover comments using automation.

@babakamyljanovssw
Copy link
Member Author

PR - Add Giscus - #1579
PR - Delete Profile page - #1585

Note
To link existing discussions from the Chewing the Fat to the rule, we need to add computed sha1 of rule GUID to the discussion body in below format - sha1 hash calculator

<!-- sha1: dcbb7fedfd3bd7f69fe677a3d5e60a6f211646ba -->

@bradystroud
Copy link
Member

Hey @babakamyljanovssw

You are ready to Giscus to prod!

As per our conversation, there are 2 things to check with Adam first.

  1. GitHub - Right now the GUID is the discussion title 🤢 (see image)
    We can fork and make a PR to improve this - should this block us from going live?
  2. Check the email asking people to migrate comments

Image

@babakamyljanovssw
Copy link
Member Author

Update:

Created PR on SSW.Rules.Functions to remove Reactions related and other unused functions.

SSWConsulting/SSW.Rules.Functions#85

@babakamyljanovssw
Copy link
Member Author

Hey @bradystroud

Work out the best way to make existing CTF discussions show up on Rules

I did looked at Giscus repo source code and documentation, and if we are going to introduce new prop to widget such as discussion-title which will be used to create discussion title with using new prop, it is going to break a lot of other stuff on Giscus. Because Giscus currently treats discussion title as search parameter. That's why it is linked with mapping prop.

Image
Figure: All these options tries to find discussion by title, so if we introduce new prop for creating discussion with specified title, it is going to break other features.

Currently, I don't see any other good option than GUID to link existing discussions to rule.

Also, creating rule discussion in the General category with rule GUID as title is not big problem because people usually go to rules website to see comments not to the repo. For Chewing the Fat, we are changing the category and title when we do it, so all Chewing the Fat discussion will be looked nice and easy to find.

@JackDevAU
Copy link
Member

JackDevAU commented Oct 29, 2024

As per our conversation, Please record a Done Video @babakamyljanovssw 🙏
Showing off Giscus on Staging

  • Record Done Video

@babakamyljanovssw
Copy link
Member Author

cc: @bradystroud @JackDevAU @Calinator444

As per our conversation, Please record a Done Video @babakamyljanovssw 🙏 Showing off Giscus on Staging

  • Record Done Video

✅ Done - please see it here https://youtu.be/sX5wvR_RLqA

@babakamyljanovssw
Copy link
Member Author

Update Chewing the Fat template

@bradystroud has updated the template - Microsoft Forms Chewing the fat template

@babakamyljanovssw
Copy link
Member Author

✅ All tasks done - closing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature A suggested idea for this project
Projects
None yet
Development

No branches or pull requests

3 participants