Low-hanging fruit fixes on bad redirects in dumper
See original GitHub issueWhen reviewing https://github.com/mdn/stumptown-renderer/pull/499/files I noticed a bunch of things the repairUri
has to do. Every time. Things that cause unnecessary trouble that could be solved once and for all in the dumper.
For example, a lot of _redirects.txt
files look like this:
# FROM-URL TO-URL
/th/docs/en /
...
and that can become:
# FROM-URL TO-URL
/th/docs/en /en-US/docs/
...
Another example is there’s 27 uses of a _
in the locale code in content/files/zh-tw/_redirects.txt
. It uses zh_tw
instead of zh-TW
which is what what’s in VALID_LOCALES
.
In content/files/zh-cn/_redirects.txt
there are a lot of these:
/zh-CN/docs/AJAX:Getting_Started /cn/docs/AJAX/Getting_Started
Just like we once used to called en-US
just en
, I guess at some point we used to call zh-CN
just cn
. There’s also a lot of redirects to things like /pt/docs/...
which needs to be replaced with pt-BR
or pt-PT
but which one?! Perhaps it can be deduced from the locale
in the MySQL wiki_document row.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Here’s what I think we should do:
repairUri
function to see how much less it had to do in the builder.repairUri
is used in the builder, in a new issue, to make it much much stricter so that faulty fatfingered PR builds where people edit the _redirects.txt files break the build before it makes things worse.Good plan?
But what about things like:
that shouldn’t have been included in the
_redirects.txt
file, right?