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

Related tickets are populated incorrectly #15

Closed mpickering closed 5 years ago

mpickering commented 5 years ago

See

https://ghc.haskell.org/trac/ghc/ticket/8809#comment:40

and

https://gitlab.staging.haskell.org/ghc/ghc/issues/8809#note_103516

bgamari commented 5 years ago

Agreed, this was the same issue I (tersely) complained about in #2. These should really be proper GitLab ticket relationships.

tdammers commented 5 years ago

The problem here is that gitlab issue relationships are bidirectional (i.e., "A is related to B" implies "B is related to A"), while trac's related tickets are directed.

Hence, adding a related ticket reference to one ticket also adds it to the related ticket; and worse, deleting a relationship deletes it on both ends. So if we have two tickets, A and B, and both were originally marked as related to the other, and then someone deleted one relationship but not the other, we can either consider it deleted on both ends or neither, but we cannot accurately transfer the unidirectional situation. Worse yet, figuring out when it is appropriate to delete a relationship is tricky - we have to check that it's already been deleted on the other end, but in order to do that, we have to remember previously seen one-way relationships.

Thoughts?

mpickering commented 5 years ago

It's a bug in trac that the related ticket field is unidirectional. If someone removes a related ticket link from one ticket then I think you should assume it is correct to do so for the other ticket as well.

tdammers commented 5 years ago

Alright then. So I'll just take the lists of related tickets, diff them, and execute suitable link creations and removals. Should be fairly straightforward. (Famous last words, I know...)

On Thu, Dec 6, 2018, 12:28 Matthew Pickering <notifications@github.com wrote:

It's a bug in trac that the related ticket field is unidirectional. If someone removes a related ticket link from one ticket then I think you should assume it is correct to do so for the other ticket as well.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bgamari/trac-to-remarkup/issues/15#issuecomment-444840856, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXjx0m4gIgpA11ioHm2SpbehbDpOJneks5u2P9ngaJpZM4Y-4Xn .

tdammers commented 5 years ago

4ea8647 should create correct ticket links (unlinking yet to be implemented), but this doesn't actually work for some reason; the createTicketLink API call gives a 404 response, even though both the source and destination tickets exist. Everything seems to be correct as per the documentation, so I'm at a bit of a loss.

bgamari commented 5 years ago

I believe this now works.