Opened on 03/18/2014 at 11:17:22 AM

Last modified on 09/30/2019 at 10:30:35 AM

#169 new change

[trac] referencing blocked/blocking issues should be semi-automated

Reported by: philll Assignee:
Priority: P3 Milestone:
Module: Infrastructure Keywords:
Cc: Blocked By:
Blocking: Platform:
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

Description

Background

We are currently using the MasterTicketsPlugin to show dependencies between issues via the blocking/blocked by fields. As one issue can have many dependent other issues, querying the ones to depend on another is hard, as you need to add all possibilities of the issues ID being included in the field: Alone, comma before, comma after, surrounded by commas, with hash tag and without.

What to change

Implement some semi-automated solution the query the issues being listed as blocking or blockedby by giving one or more issue IDs only without having to add all the possible string versions.

Attachments (0)

Change History (5)

comment:1 Changed on 03/18/2014 at 11:18:48 AM by philll

I took a look into TicketDepPlugin but ended up with the following exception when trying to create any new issue:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/trac/web/api.py", line 502, in send_error
    data, 'text/html')
  File "/usr/local/lib/python2.7/dist-packages/trac/web/chrome.py", line 968, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "/usr/local/lib/python2.7/dist-packages/genshi/core.py", line 133, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "/usr/local/lib/python2.7/dist-packages/trac/web/chrome.py", line 1147, in inner
    data)
  File "/home/trac/environment/plugins/TracTicketDep-0.11_20081224-py2.7.egg/ticketdep/web_ui.py", line 92, in filter_stream
    parser = XMLParser(StringIO(dep_str))
  File "/usr/lib/python2.7/StringIO.py", line 57, in __init__
    buf = str(buf)
  File "/usr/local/lib/python2.7/dist-packages/genshi/builder.py", line 107, in __str__
    return str(self.generate())
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2514' in position 343: ordinal not in range(128)

comment:2 Changed on 03/18/2014 at 11:34:06 AM by trev

  • Priority changed from Unknown to P3
  • Ready set

This should be possible by implementing a plugin that will extend TicketQueryMacro and give it a new name, e.g. [[Blockers(123,...)]]. The expand_macro method can process the first argument (issue number) and replace it by blocking=123,or,blocking^=123\,,or,blocking$=\,123,or,blocking~=\,123\, (that's the exact incantation necessary to cover all the scenarios). It can then redirect all the work as well as processing the other parameters to the superclass.

comment:3 Changed on 03/18/2014 at 01:46:22 PM by philll

yep

comment:4 Changed on 05/12/2014 at 03:27:42 PM by philll

We could use this change instead: http://trac.edgewall.org/ticket/10871

comment:5 Changed on 05/19/2014 at 09:16:41 AM by philll

Apparently, querying list type fields like keywords works differently than expected, such that you cannot use the "is" operator to find single keywords in a list of an issue, but rather need to use the "contains" operator, which then apparently again finds the search string even if included in a non-seperated way of a bigger string. Seems like we need to still create our own macro.

Add Comment

Modify Ticket

Change Properties
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from (none).
Next status will be 'reviewing'.
 
Note: See TracTickets for help on using tickets.