sagemath / trac-to-github

Script to migrate Trac tickets to GitHub issues and the Trac wiki to markdown. Input: https://trac.sagemath.org/ ➠ Intermediate: https://github.com/sagemath/trac_to_gh ➠ Output: https://github.com/sagemath/sage/issues
https://trac.sagemath.org/ticket/30363
7 stars 5 forks source link

Fix ticket-comment links in another form #159

Closed kwankyu closed 1 year ago

kwankyu commented 1 year ago

There is another form of ticket-comment links, seen in

https://34.105.185.241/sagemath/sage-all-2023-01-14-015/issues/9512#issuecomment-5696801

(compare with https://trac.sagemath.org/ticket/9512#comment:5 and https://github.com/kwankyu/trac-to-github/blob/check/wiki/Issues-09xxx/9512.md#comment:5). There are lots of these broken links.

kwankyu commented 1 year ago

Apart from this PR, I have a question. There are many ".patch" file attachments, like https://34.105.185.241/sagemath/sage-all-2023-01-14-015/issues/9516#issuecomment-5696823. Couldn't these be of "text/plain" mime type, so that ".gz" extension is unnecessary? And ".diff" files too.

kwankyu commented 1 year ago

After looking through many more converted issues, I hopefully expect that this PR is my last one.

mkoeppe commented 1 year ago

There are many ".patch" file attachments, like https://34.105.185.241/sagemath/sage-all-2023-01-14-015/issues/9516#issuecomment-5696823. Couldn't these be of "text/plain" mime type, so that ".gz" extension is unnecessary? And ".diff" files too.

The importer is very picky about file name extensions and declared mime types matching, and it appears to have a fixed set of those pairs that it accepts. It does not accept the .diff and .patch extensions -- neither as "text/plain" nor as "application/octet-stream". That's why I am using compression as a workaround. An alternative would have been to append ".txt" as an additional filename extension and to declare it "text/plain", but I prefer the ".gz" solution.

mkoeppe commented 1 year ago

Thanks a lot!

kwankyu commented 1 year ago

OK. Thank you!