We "completed" the migration of this vB3 site to Discourse a number of days ago. However, deeper testing by @Scrutinizer and @MadeInGermany revealed that a lot of text was mangled in the migration. We traced these bugs to two issues:
- A minor bug in the Ruby
vbulletin.rb
migration script which transformed "\n"
in code fragments to hard breaks; and - A major bug in the recommended migration Ruby gem
ruby-bbcode-to-md
that mangled all code fragments withleft square brackets.
(strips them out, completely!)
These are serious migration bugs which affect the integrity of all of the hard work our member have contributed over the years and must be corrected.
I posted a bug report over at meta-discourse on the major bug in the Ruby gem ruby-bbcode-to-md
but the maintainer of that repo shut me down, deleted my bug reports, washed his hands of a repo with his name on it, and acted very unprofessional, even though the bug was easily confirmed. This was not encouraging and brought my spirits down a bit at the time.
@Scrutinizer then came to the rescue (thank you!), took a step back, and did a formal analysis of the Ruby preprocessing script and the various bbcode transformations including the:
- Ruby preprocessing method in the
vbulletin.rb
migration script - Discourse builtin bbcode support
- Ruby gem
ruby-bbcode-to-md
Discourse plugin
At the same time, I was working on:
- Debugging the
ruby-bbcode-to-md
discourse plugin - New PHP script to reprocess the pagetext from the vB3 MySQL DB and replace the text mangled by the
ruby-bbcode-to-md
gem in the Discourse Postgres DB.
@Scrutinizer created a spreadsheet and did the analysis and determined that the mangler gem ruby-bbcode-to-md
was not required.
In addition, @Scrutinizer suggested we install the discourse-bbcode
plugin and test it.
With good preliminary results from discourse-bbcode
, I started to learn how to modify a Discourse plugin and found that the discourse-bbcode
plugin was not difficult to modify (straight forward javascript), so I set up a development environment on my desktop as follows:
- Forked the
discourse-bbcode
on GitHub toneo-discourse-bbcode
- Cloned the
neo-discourse-bbcode
to my desktop - Modified
neo-discourse-bbcode
using Visual Studio Code - Pushed changes to my newly minted forked
neo-discourse-bbcode
repo on GitHub - Rebuilt and tested our staging Discourse apps using the modified
neo-discourse-bbcode
repo in theapp.yml
build file.
From this test setup, was able to add new "preliminary" bbcode tags, for example I created two new tags which correspond (roughly) to two of our legacy tags:
- ICODE tag
- MOD tag
This forked repo is still a work-in-progress and I am still learning to modify and test and try to add other tags. Right now, I'm having some issues with preformatted
elements, but that's a discussion for another day.
GitHub - unixneo/neo-discourse-bbcode: vBulletin BBCode plugin
Although we have made progress, @Scrutinzer also discovered that the Markdown and CODE bbcode tags used by Discourse (builtin) do not permit BBCode in the fenced code blocks.
This means that our technique of using color to highlight sections of code in blocks when helping others currently has no solution, but we are working on this. Currently, in the migration script this bbcode is stripped out during migration. However, we want to find a way to preserve this capability and feature if possible.
However, there are gremlins around the corner:
Fixing this will more-than-likely require us to disable the Discourse builtin CODE tag (so far, I have not been about to override this in a plugin); and there is just about zero chance the busy folks at meta discourse will support this or even answer my question in a helpful way if I ask how to do this (disable or override their builtin code tag). Historical discussions from the meta discourse team shows a near religious passion for markdown and any deviation from that they perceive as "right and wrong" is not well received. Plus, this is a migration issue, and they are focused on the future, not the past (understandably). I see zero chance asking about this will be well received over there.
So the current options seem to be:
- Hack the Discourse code base to disable their builtin code tag and write a plugin to do this (not certain how to do this, really and it will not be persistent when Discourse upgrades, so this seems not a reasonable possibility at the moment).
- Ask "how to do this on meta" and get beat up severely by the meta team, who will surely oppose this and tell us to "get over it" and "move on".
- Strip out all bbcode in block code tags during migration (the current "solution").
- Look at highlight.js and see if we can hack that to get bbcode to work (just a wild idea at the moment).
- Something yet to appear in the fog of all this.
I don't consider removing color indicators from our code blocks and stripping out bbcode from these fenced code blocks a major issue; but there are some who will consider it a big deal, possibly. We will be "losing" this well-liked feature if we strip it out.
So, we are still looking into this.
However, I am not planning to ask on meta, because that question will surely, based on historical discussions on code tags there and my "not good" experiences with two migration bug reports over there, will not turn out good, this I am sure. Migration issues are not well received over there (they are working on building for the future, and this is understandable, honestly) and we are pretty much "own our own" on this.
That is the latest