Opened 6 years ago

Last modified 2 months ago

#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.

Change History (5)

comment:1 Changed 6 years ago 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 6 years ago 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 6 years ago by philll

yep

comment:4 Changed 6 years ago by philll

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

comment:5 Changed 6 years ago 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.

Note: See TracTickets for help on using tickets.