Closed mpickering closed 5 years ago
Figured out what happens here.
The situation in the Trac database is:
keywords
field contains "Generics"
.keywords
entry, with oldvalue
= NULL
and newvalue
= "Generics"
.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.
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.
And here we go: 89e55b2
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.