<html><head></head><body>The lacking redirect support is unfortunate. In my opinion this is something we will need to handle going forward as well; a one time solution like adding nginx redirects doesn't seem like the right approach to me. <br><br>I would rather advocate either option 3 or one of the following options:<br><br> 5. Detect redirects and convert them to symbolic links in the repo<br> 6. Request redirect support in the gitlab wiki.<br><br><div class="gmail_quote">On March 6, 2019 5:55:15 AM EST, Tobias Dammers <tdammers@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Wed, Mar 06, 2019 at 09:32:44AM +0300, Ömer Sinan Ağacan wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">- Redirects don't seem to work:<br>  <a href="https://gitlab.staging.haskell.org/ghc/ghc/wikis/commentary/rts/heap-objects">https://gitlab.staging.haskell.org/ghc/ghc/wikis/commentary/rts/heap-objects</a><br></blockquote><br>I believe this is an unfortunate result of the way we migrate wiki<br>pages. The way that works is that we don't actually parse the original<br>Trac markup; instead, we scrape the rendered HTML directly from the live<br>Trac instance, and massage that into GitLab markup.<br><br>This has a few interesting consequences:<br><br>1. "Wiki processors", such as for example dynamically-generated TOCs and<br>issue lists, get to run on the Trac instance as we request the page, and<br>thus capture a snapshot of the dynamic data at the time of migration.<br>2. Redirects, being implemented as such wiki processors, cause<br>client-side redirects, which our scraper will not follow. Hence, the<br>converted page is based on an HTML page body that you don't normally get<br>to see, and no actual redirect is generated on the GitLab side of<br>things.<br>3. The scraper only looks at what is normally the actual page content;<br>any additional UI generated outside of the main content element is<br>ignored. Hence, when Trac generates links to the redirect target for<br>clients that do not support client-side redirects, those links don't<br>make it into the converted page.<br>4. Because redirects are usually the last thing to be added to a page,<br>that page's history ends there, and becomes the "current" version on the<br>GitLab side. So we end up with what you're seeing: a nonsensical page<br>that contains the fallback content, a somewhat cryptic question asking<br>whether it should redirect, and no way to answer that question.<br><br>Since GitLab doesn't have an equivalent to those "wiki processors", and<br>AFAIK does not cater for such redirects, the question is how we should<br>handle these. I can think of several options:<br><br>1. Do nothing; when anyone complains, fix the offending pages manually<br>(either by converting the useless redirect message into a proper<br>hyperlink, or by manually adding a rewrite entry to the nginx<br>configuration).<br>2. Generate a list of redirecting pages from the Trac dataset, either as<br>part of the import (2a), or with some grep/sed/awk magic based on the<br>converted git repo after the fact (2b); then use that list to generate<br>suitable nginx redirects.<br>3. Extend the import script to detect redirects, and special-case those<br>so that they render as proper links to the redirect target.<br>4. Do more research and see if there is a way to make GitLab redirect<br>based on wiki content, then extend the import script like in step 3, but<br>render redirecting pages to use the (currently hypothetical) redirect<br>feature.<br><br>Personally, I'm inclined to say let's go with option 2b: run the import,<br>then grep for 'redirect(wiki:', and massage that into nginx redirects.<br><br>TL;DR: the import currently ignores Trac wiki redirects, and I'm not<br>sure what the best way is to deal with this.<hr>ghc-devs mailing list<br>ghc-devs@haskell.org<br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br></pre></blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>