SSWConsulting / SSW.Rules

Generator for ssw.com.au/rules
https://www.ssw.com.au/rules
MIT License
15 stars 13 forks source link

✨ Reactions - Migrate from custom to Giscus #1567

Open babakamyljanovssw opened 1 week ago

babakamyljanovssw commented 1 week ago

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

babakamyljanovssw commented 1 week ago

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 https://github.com/SSWConsulting/SSW.Rules/pull/1382#issuecomment-2205143272 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 commented 3 days ago

PR - Add Giscus - https://github.com/SSWConsulting/SSW.Rules/pull/1579 PR - Delete Profile page - https://github.com/SSWConsulting/SSW.Rules/pull/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 commented 1 day ago

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 commented 22 hours ago

Update:

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

https://github.com/SSWConsulting/SSW.Rules.Functions/pull/85

babakamyljanovssw commented 2 hours ago

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.