~aparcar

Trackers

~aparcar/openwrt-bugs-import-test-2

Last active 2 years ago

~aparcar/openwrt-bugs-import-test

Last active 2 years ago

~aparcar/asu-import-test

Last active 2 years ago

~aparcar/openwrt

Last active 2 years ago

~aparcar/test

Last active 3 years ago

#3976 Another test with external email address 2 years ago

Comment by ~aparcar on ~aparcar/openwrt-bugs-import-test-2

Manually adding a comment should increase comment_count correctly.

#255 Missing comment count in overview after ticket import 2 years ago

Comment by ~aparcar on ~sircmpwn/todo.sr.ht

Correction, something like the following could do a better job. I'll setup a test instance and report back:

diff --git a/todosrht/tracker_import.py b/todosrht/tracker_import.py
index fd89311..e68a59f 100644
--- a/todosrht/tracker_import.py
+++ b/todosrht/tracker_import.py
@@ -70,6 +70,7 @@ def _import_comment(ticket, event, edata):
             comment.authenticity = TicketAuthenticity.authentic
         else:
             comment.authenticity = TicketAuthenticity.tampered
+    ticket.comment_count += 1
     db.session.add(comment)
     db.session.flush()
     event.comment_id = comment.id

#255 Missing comment count in overview after ticket import 2 years ago

Comment by ~aparcar on ~sircmpwn/todo.sr.ht

Problem is ticket comments are stored as an integer and the import doesn't set that value automatically. Looking at the migration code it looks like after every import something like this should run:

UPDATE ticket t
        SET comment_count = (
            SELECT count(*)
            FROM ticket_comment
            WHERE ticket_id = t.id AND superceeded_by_id IS NULL
        )

#3975 This is a test ticket 2 years ago

Ticket created by ~aparcar on ~aparcar/openwrt-bugs-import-test-2

Here we go a test for testing.

#255 Missing comment count in overview after ticket import 2 years ago

Ticket created by ~aparcar on ~sircmpwn/todo.sr.ht

I imported a number of tickets exported from a flyspray(.org) tracker and while successful, the overview doesn't show the number of comments per ticket.

The affected todo tracker is ~aparcar/openwrt-bugs-import-test-2. The very first ticket show no (0) comments in the overview while there is actually one.

#1 Test2 2 years ago

Ticket created by ~aparcar on ~aparcar/asu-import-test

test

#4 curl test 2 years ago

Ticket created by ~aparcar on ~aparcar/openwrt

issue submitted via curl

#3 curl test 2 years ago

Ticket created by ~aparcar on ~aparcar/openwrt

issue submitted via curl

#2 test2 2 years ago

Comment by ~aparcar on ~aparcar/openwrt

This is aa test

foo = 3
if foo:
   print(foo)

#2 test2 2 years ago

on ~aparcar/openwrt

REPORTED RESOLVED NOT_OUR_BUG