You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by Apache Bloodhound <bl...@incubator.apache.org> on 2012/09/19 18:18:12 UTC
[Apache Bloodhound] #204: Activity feed currently breaks new ticket
page link
#204: Activity feed currently breaks new ticket page link
-----------------------+-----------------------
Reporter: gjm | Owner: nobody
Type: defect | Status: new
Priority: critical | Milestone: Release 2
Component: dashboard | Version:
Keywords: |
-----------------------+-----------------------
At least in the case where there are no tickets available in the system,
the activity feed breaks new ticket page rendering with the following
error:
{{{
File
"/home/bloodhound/bh/bloodhound/bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html",
line 54, in <Expression u'summary_of(context.resource)'>
No events reported for <em>${summary_of(context.resource)}</em> in the
File "/home/bloodhound/bh/bloodhound/trac/trac/resource.py", line 347, in
get_resource_summary
return get_resource_description(env, resource, 'summary')
File "/home/bloodhound/bh/bloodhound/trac/trac/resource.py", line 333, in
get_resource_description
return manager.get_resource_description(resource, format, **kwargs)
File "/home/bloodhound/bh/bloodhound/trac/trac/ticket/api.py", line 555,
in get_resource_description
return self.format_summary(*args)
File "/home/bloodhound/bh/bloodhound/trac/trac/ticket/api.py", line 561,
in format_summary
summary = type + ': ' + summary
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/204>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound (incubating) issue tracker
Re: [Apache Bloodhound] #204: Activity feed currently breaks new
ticket page link
Posted by Gary Martin <ga...@wandisco.com>.
On 20/09/12 14:55, Olemis Lang wrote:
> On 9/19/12, Gary Martin <ga...@wandisco.com> wrote:
>> On 19/09/12 19:38, Olemis Lang wrote:
>>> On 9/19/12, Apache Bloodhound <bl...@incubator.apache.org>
>>> wrote:
>>>> #204: Activity feed currently breaks new ticket page link
>>>> ------------------------+-----------------------
>>>> Reporter: gjm | Owner: nobody
>>>> Type: defect | Status: new
>>>> Priority: critical | Milestone: Release 2
>>>> Component: dashboard | Version:
>>>> Resolution: | Keywords:
>>>> ------------------------+-----------------------
>>>>
>>>> Comment (by gjm):
>>>>
>>> [...]
>>>> ---
>>>>
>>>> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
>>>> (revision 1387596)
>>>> +++
>>>>
>>>> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
>>>> (working copy)
>>>> @@ -50,6 +50,7 @@
>>>> </tbody>
>>>> </table>
>>>> <py:otherwise>
>>>> + <py:if test="context.resource.id">
>>>> <py:def function="timeline_empty()">
>>>> No events reported for <em>${summary_of(context.resource)}</em>
>>>> in
>>>> the
>>>> last <em>$daysback</em> days since
>>>> @@ -59,5 +60,6 @@
>>>> </py:def>
>>>> <xi:include href="widget_alert.html"
>>>> py:with="msglabel = 'Warning'; msgbody = timeline_empty()" />
>>>> + </py:if>
>>>> </py:otherwise>
>>>> </div>
>>>> }}}
>>>>
>>> I'd rather sugesst doing something like
>>>
>>> <em py:if="context.resource.id">${summary_of(context.resource)}</em>
>>>
>>> or
>>>
>>> <em>${summary_of(context.resource) if context.resource.id else
>>> 'Unknown resource'}</em>
>>>
>>>
>> Well, that is a bit too specific and the message will no longer make
>> sense. But either way this still feels like a fix for the symptom rather
>> than the cause. I don't think that trac's TicketSystem.format_summary
>> method should fail for such input. I may of course be asking too much.
>>
> yes . I just looked at it once again , and it should not fail that ...
>
>> A little more off topic, it is also annoying that the error message
>> appears at all. There are a lot of false positives positive situations
>> where there are no events to be displayed and the message will display.
> cases like what ?
>
>> Hopefully we can remove some of those (event collection in a non-time
>> based manner may be helpful here in particular) but we should probably
>> only suggest that there is a problem with the system configuration if
>> there actually is.
>>
> you may be right , yes . I see your point .
>
OK, I guess we could do with some action on this ticket. This is an
important bug to fix, so I'll implement one of the quick hacks. After
that I'll raise a ticket for fixing the underlying problem.
I have already raised https://issues.apache.org/bloodhound/ticket/214 to
look at the warning message when no events are reported.
Cheers,
Gary
Re: [Apache Bloodhound] #204: Activity feed currently breaks new
ticket page link
Posted by Olemis Lang <ol...@gmail.com>.
On 9/19/12, Gary Martin <ga...@wandisco.com> wrote:
> On 19/09/12 19:38, Olemis Lang wrote:
>> On 9/19/12, Apache Bloodhound <bl...@incubator.apache.org>
>> wrote:
>>> #204: Activity feed currently breaks new ticket page link
>>> ------------------------+-----------------------
>>> Reporter: gjm | Owner: nobody
>>> Type: defect | Status: new
>>> Priority: critical | Milestone: Release 2
>>> Component: dashboard | Version:
>>> Resolution: | Keywords:
>>> ------------------------+-----------------------
>>>
>>> Comment (by gjm):
>>>
>> [...]
>>> ---
>>>
>>> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
>>> (revision 1387596)
>>> +++
>>>
>>> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
>>> (working copy)
>>> @@ -50,6 +50,7 @@
>>> </tbody>
>>> </table>
>>> <py:otherwise>
>>> + <py:if test="context.resource.id">
>>> <py:def function="timeline_empty()">
>>> No events reported for <em>${summary_of(context.resource)}</em>
>>> in
>>> the
>>> last <em>$daysback</em> days since
>>> @@ -59,5 +60,6 @@
>>> </py:def>
>>> <xi:include href="widget_alert.html"
>>> py:with="msglabel = 'Warning'; msgbody = timeline_empty()" />
>>> + </py:if>
>>> </py:otherwise>
>>> </div>
>>> }}}
>>>
>> I'd rather sugesst doing something like
>>
>> <em py:if="context.resource.id">${summary_of(context.resource)}</em>
>>
>> or
>>
>> <em>${summary_of(context.resource) if context.resource.id else
>> 'Unknown resource'}</em>
>>
>>
> Well, that is a bit too specific and the message will no longer make
> sense. But either way this still feels like a fix for the symptom rather
> than the cause. I don't think that trac's TicketSystem.format_summary
> method should fail for such input. I may of course be asking too much.
>
yes . I just looked at it once again , and it should not fail that ...
> A little more off topic, it is also annoying that the error message
> appears at all. There are a lot of false positives positive situations
> where there are no events to be displayed and the message will display.
cases like what ?
> Hopefully we can remove some of those (event collection in a non-time
> based manner may be helpful here in particular) but we should probably
> only suggest that there is a problem with the system configuration if
> there actually is.
>
you may be right , yes . I see your point .
--
Regards,
Olemis.
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
Re: [Apache Bloodhound] #204: Activity feed currently breaks new
ticket page link
Posted by Gary Martin <ga...@wandisco.com>.
On 19/09/12 19:38, Olemis Lang wrote:
> On 9/19/12, Apache Bloodhound <bl...@incubator.apache.org> wrote:
>> #204: Activity feed currently breaks new ticket page link
>> ------------------------+-----------------------
>> Reporter: gjm | Owner: nobody
>> Type: defect | Status: new
>> Priority: critical | Milestone: Release 2
>> Component: dashboard | Version:
>> Resolution: | Keywords:
>> ------------------------+-----------------------
>>
>> Comment (by gjm):
>>
> [...]
>> ---
>> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
>> (revision 1387596)
>> +++
>> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
>> (working copy)
>> @@ -50,6 +50,7 @@
>> </tbody>
>> </table>
>> <py:otherwise>
>> + <py:if test="context.resource.id">
>> <py:def function="timeline_empty()">
>> No events reported for <em>${summary_of(context.resource)}</em> in
>> the
>> last <em>$daysback</em> days since
>> @@ -59,5 +60,6 @@
>> </py:def>
>> <xi:include href="widget_alert.html"
>> py:with="msglabel = 'Warning'; msgbody = timeline_empty()" />
>> + </py:if>
>> </py:otherwise>
>> </div>
>> }}}
>>
> I'd rather sugesst doing something like
>
> <em py:if="context.resource.id">${summary_of(context.resource)}</em>
>
> or
>
> <em>${summary_of(context.resource) if context.resource.id else
> 'Unknown resource'}</em>
>
>
Well, that is a bit too specific and the message will no longer make
sense. But either way this still feels like a fix for the symptom rather
than the cause. I don't think that trac's TicketSystem.format_summary
method should fail for such input. I may of course be asking too much.
A little more off topic, it is also annoying that the error message
appears at all. There are a lot of false positives positive situations
where there are no events to be displayed and the message will display.
Hopefully we can remove some of those (event collection in a non-time
based manner may be helpful here in particular) but we should probably
only suggest that there is a problem with the system configuration if
there actually is.
Cheers,
Gary
Re: [Apache Bloodhound] #204: Activity feed currently breaks new
ticket page link
Posted by Olemis Lang <ol...@gmail.com>.
On 9/19/12, Apache Bloodhound <bl...@incubator.apache.org> wrote:
> #204: Activity feed currently breaks new ticket page link
> ------------------------+-----------------------
> Reporter: gjm | Owner: nobody
> Type: defect | Status: new
> Priority: critical | Milestone: Release 2
> Component: dashboard | Version:
> Resolution: | Keywords:
> ------------------------+-----------------------
>
> Comment (by gjm):
>
[...]
>
> ---
> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
> (revision 1387596)
> +++
> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
> (working copy)
> @@ -50,6 +50,7 @@
> </tbody>
> </table>
> <py:otherwise>
> + <py:if test="context.resource.id">
> <py:def function="timeline_empty()">
> No events reported for <em>${summary_of(context.resource)}</em> in
> the
> last <em>$daysback</em> days since
> @@ -59,5 +60,6 @@
> </py:def>
> <xi:include href="widget_alert.html"
> py:with="msglabel = 'Warning'; msgbody = timeline_empty()" />
> + </py:if>
> </py:otherwise>
> </div>
> }}}
>
I'd rather sugesst doing something like
<em py:if="context.resource.id">${summary_of(context.resource)}</em>
or
<em>${summary_of(context.resource) if context.resource.id else
'Unknown resource'}</em>
--
Regards,
Olemis.
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
Re: [Apache Bloodhound] #204: Activity feed currently breaks new
ticket page link
Posted by Gary Martin <ga...@wandisco.com>.
Hi,
Spotted this bug in new installs, at least with the recent changes
activity feeds. Essentially the newticket view (currently available as
one of the links under the Apps section of the menu) fails to render
when there are no tickets in the system. The error (as noted in the
ticket itself) is something like this:
File
"/home/bloodhound/bh/bloodhound/bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html",
line 54, in <Expression u'summary_of(context.resource)'>
No events reported for <em>${summary_of(context.resource)}</em> in the
File "/home/bloodhound/bh/bloodhound/trac/trac/resource.py", line 347, in
get_resource_summary
return get_resource_description(env, resource, 'summary')
File "/home/bloodhound/bh/bloodhound/trac/trac/resource.py", line 333, in
get_resource_description
return manager.get_resource_description(resource, format, **kwargs)
File "/home/bloodhound/bh/bloodhound/trac/trac/ticket/api.py", line 555,
in get_resource_description
return self.format_summary(*args)
File "/home/bloodhound/bh/bloodhound/trac/trac/ticket/api.py", line 561,
in format_summary
summary = type + ': ' + summary
The diff I suggest below is a possible workaround but it may be worth
considering alternatives to make the underlying code more robust instead.
Cheers,
Gary
On 09/19/2012 05:20 PM, Apache Bloodhound wrote:
> #204: Activity feed currently breaks new ticket page link
> ------------------------+-----------------------
> Reporter: gjm | Owner: nobody
> Type: defect | Status: new
> Priority: critical | Milestone: Release 2
> Component: dashboard | Version:
> Resolution: | Keywords:
> ------------------------+-----------------------
>
> Comment (by gjm):
>
> I expect something like this might help as a quick hack but is there a
> better answer?
>
> {{{
> #!diff
> Index:
> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
> ===================================================================
> ---
> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
> (revision 1387596)
> +++
> bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
> (working copy)
> @@ -50,6 +50,7 @@
> </tbody>
> </table>
> <py:otherwise>
> + <py:if test="context.resource.id">
> <py:def function="timeline_empty()">
> No events reported for <em>${summary_of(context.resource)}</em> in
> the
> last <em>$daysback</em> days since
> @@ -59,5 +60,6 @@
> </py:def>
> <xi:include href="widget_alert.html"
> py:with="msglabel = 'Warning'; msgbody = timeline_empty()" />
> + </py:if>
> </py:otherwise>
> </div>
> }}}
>
Re: [Apache Bloodhound] #204: Activity feed currently breaks new
ticket page link
Posted by Apache Bloodhound <bl...@incubator.apache.org>.
#204: Activity feed currently breaks new ticket page link
------------------------+-----------------------
Reporter: gjm | Owner: nobody
Type: defect | Status: new
Priority: critical | Milestone: Release 2
Component: dashboard | Version:
Resolution: | Keywords:
------------------------+-----------------------
Comment (by gjm):
I expect something like this might help as a quick hack but is there a
better answer?
{{{
#!diff
Index:
bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
===================================================================
---
bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
(revision 1387596)
+++
bloodhound_dashboard/bhdashboard/widgets/templates/widget_timeline.html
(working copy)
@@ -50,6 +50,7 @@
</tbody>
</table>
<py:otherwise>
+ <py:if test="context.resource.id">
<py:def function="timeline_empty()">
No events reported for <em>${summary_of(context.resource)}</em> in
the
last <em>$daysback</em> days since
@@ -59,5 +60,6 @@
</py:def>
<xi:include href="widget_alert.html"
py:with="msglabel = 'Warning'; msgbody = timeline_empty()" />
+ </py:if>
</py:otherwise>
</div>
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/204#comment:1>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound (incubating) issue tracker
Re: [Apache Bloodhound] #204: Activity feed currently breaks new
ticket page link
Posted by Apache Bloodhound <bl...@incubator.apache.org>.
#204: Activity feed currently breaks new ticket page link
------------------------+-----------------------
Reporter: gjm | Owner: nobody
Type: defect | Status: closed
Priority: critical | Milestone: Release 2
Component: dashboard | Version:
Resolution: fixed | Keywords:
------------------------+-----------------------
Changes (by gjm):
* status: new => closed
* resolution: => fixed
Comment:
r1392403 fixes this (the {{{<py:if/>}}}s moved inside the
{{{timeline_empty()}}} function.)
The TicketSystem.format_summary should not have failed for this input but
this will be tracked by a different ticket.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/204#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound (incubating) issue tracker