bgamari / trac-to-remarkup

Moved to GitLab: https://gitlab.haskell.org/bgamari/trac-to-remarkup
https://gitlab.haskell.org
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Keyword thrashing #6

Closed mpickering closed 5 years ago

mpickering commented 5 years ago

Consider this issue:

https://gitlab.staging.haskell.org/ghc/ghc/issues/9523

and the relevant trac ticket

https://ghc.haskell.org/trac/ghc/ticket/9523

Observe how it appears that dfeuer removes the Generics label before Ryan adds it back later. This isn't what actually happened as the label was only added once and never removed.

tdammers commented 5 years ago

Figured out what happens here.

The situation in the Trac database is:

Now our code has this findOrig function that crawls the list of ticket changes back to the oldest one for each field; if it finds anything, the it returns its oldvalue, otherwise, it returns Nothing. Then, in the trac -> gitlab ticket conversion, we check if the findOrig value is a Just, and if so, use it to overwrite whatever we found in the ticket, because we want the ticket in the state as it was originally created; if, however, the findOrig value is Nothing, then we assume that that particular field was never updated, and so the ticket's current value for that field must be the original one. BUT THIS IS WRONG: Nothing can mean either "no ticket changes for that field found", or "the original value for this field was Nothing / NULL".

Oh dear.

tdammers commented 5 years ago

So I fixed the findOrig thing, but it turns out there is another bug here, namely, that the editTicket data structure doesn't actually cater for keywords at all. Going to fix that too.

tdammers commented 5 years ago

And here we go: 89e55b2