Issue285

Title Add issue title to issue links, avoid linking to bogus issues
Priority bug Status resolved
Superseder Nosy List ajaksu2, ezio.melotti, stefan
Assigned To ezio.melotti Topics

Created on 2009-05-14.17:34:56 by ajaksu2, last changed 2010-07-25.19:07:31 by ezio.melotti.

Files
File name Uploaded Type Edit Remove
link_titles.diff ajaksu2, 2009-05-26.19:09:15 text/plain
postgres_id_overflow.diff ajaksu2, 2009-06-03.13:27:18 text/plain
Messages
msg1400 (view) Author: ajaksu2 Date: 2009-05-14.17:34:55
Understanding how one issue relates to others would be easier if issue links had
the linked issue's title as a tooltip. So we'd have:
    <a href="issue6020" title="Create a datetime.timedelta.totalseconds
property">#6020</a>

We can easily add this to the dependencies and superseder links. Adding titles
to issue links in message bodies is a bit more involved, but doable. As a
benefit, we'd be able to avoid linking to bogus issues.

RFE by Ezio Melotti and R. David Murray.
msg1405 (view) Author: ajaksu2 Date: 2009-05-26.19:09:15
The attached patch:
 * Fixes an 'integer too large' error in templating.py that causes issues to be
undisplayable.
 * Adds title attributes to Roundup's class links (e.g. 'version 1').
 * Moves in-message issue links of the form 'issue 123' from templating.py to
local_replace.py.
 * Adds issue titles to issue links in dependencies and message bodies.
 * Adds the 'open' or 'closed' CSS classes to issue links. 

I can provide the bugfix part as an independent patch.
msg1406 (view) Author: ajaksu2 Date: 2009-05-26.19:18:43
Demos:
 * Features: http://bot.bio.br/python-dev-exp/issue14
 * Bugfix: http://bot.bio.br/python-dev/issue11
msg1407 (view) Author: ajaksu2 Date: 2009-05-26.19:34:01
Just the bugfix.
msg1415 (view) Author: ajaksu2 Date: 2009-06-03.13:27:18
As suggested by Stefan Seefeld, this patch handles the overflow on the DB layer.
msg1416 (view) Author: stefan Date: 2009-06-03.13:39:40
Daniel Diniz wrote:
> Daniel Diniz <ajaksu@gmail.com> added the comment:
>
> As suggested by Stefan Seefeld, this patch handles the overflow on the DB layer.
>   
> --- a/roundup-src/roundup/backends/rdbms_common.py	Tue May 26 15:50:15 2009 -0300
> +++ b/roundup-src/roundup/backends/rdbms_common.py	Wed Jun 03 10:24:15 2009 -0300
> @@ -1110,6 +1110,8 @@
>              # Return 1, not True, to match the type of the result of
>              # the SQL operation below.
>              return 1
> +        if int(nodeid) > 2**30: # Avoid Postgres error
> +            return 0

Yes, I think this is much better. However, I'm still concerned about two 
things:

1) You put postgresql-specific code into rdbms_common.py
2) It seems there may be other cases where we don't properly check for 
type / value incompatibilities between Python and SQL backends.

I'm not sure what to suggest, as I don't know the domain well enough. 
But I wonder: might it be a good idea to have back_postgresql do more 
work, such as provide its own 'sql()' function, where it could either 
validate the arguments, or catch backend-specific errors and translate 
them into Roundup exceptions ?

Thanks,
       Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...
msg1417 (view) Author: ajaksu2 Date: 2009-06-03.13:56:41
For reference, traceback is here:  http://paste.pocoo.org/show/120779/

1) rdbms_common.Database.sql is supposed to work with Postgres and MySQL, I'm
just fixing it for the former.
2) Probably yes, but FWIW this patch fixes many other Postgres overflows in
hasnode: for superseder, status, etc.

I think we should fix this, then maybe refactor the DB code. I'm not sure
investing in refactoring and improving our own DB-compatibility layer is
desirable over picking an external ORM.
msg1453 (view) Author: ezio.melotti Date: 2009-07-27.03:28:51
I also suggest to add in the title="" the status of the issue, something like
title="[open|closed|pending] issue title here".

The alternative is to use a CSS class (as suggested by ajaksu2) and
text-decoration: line-through; or some color for closed issue, but imho this
just introduces useless noise. Even if in this way the user can see immediately
if the issue is closed or not he still has to read its title in order to know
what the issue is about.
(Setting the class="" is still a good idea, even if it's not used for this purpose.)
msg1691 (view) Author: ezio.melotti Date: 2010-06-26.22:21:53
> The attached patch:
>  * Fixes an 'integer too large' error in templating.py that causes issues to be undisplayable.

How do you get this error exactly?

> * Adds title attributes to Roundup's class links (e.g. 'version 1').
> * Moves in-message issue links of the form 'issue 123' from templating.py to
local_replace.py.

I'd rather see the opposite. IMHO roundup should add a link to #NNNN too. In local_replace there should be only Python-specific replaces (like links to the files and revisions).

> * Adds issue titles to issue links in dependencies and message bodies.
> * Adds the 'open' or 'closed' CSS classes to issue links.
msg1741 (view) Author: ezio.melotti Date: 2010-07-25.19:04:16
Fixed in r83129, r83130, r83131, and r83132 (see also http://issues.roundup-tracker.org/issue2550659).
History
Date User Action Args
2010-07-25 19:07:31ezio.melottisetassignedto: ajaksu2 -> ezio.melotti
2010-07-25 19:04:17ezio.melottisetstatus: chatting -> resolved
messages: + msg1741
2010-06-26 22:21:54ezio.melottisetmessages: + msg1691
2009-07-27 03:28:51ezio.melottisetnosy: + ezio.melotti
messages: + msg1453
2009-06-03 13:56:41ajaksu2setmessages: + msg1417
2009-06-03 13:39:41stefansetnosy: + stefan
messages: + msg1416
2009-06-03 13:29:13ajaksu2setfiles: - postgress_large_nodeid.diff
2009-06-03 13:27:20ajaksu2setfiles: + postgres_id_overflow.diff
messages: + msg1415
2009-05-26 19:34:01ajaksu2setpriority: feature -> bug
files: + postgress_large_nodeid.diff
messages: + msg1407
2009-05-26 19:18:43ajaksu2setmessages: + msg1406
2009-05-26 19:09:17ajaksu2setfiles: + link_titles.diff
status: unread -> chatting
messages: + msg1405
2009-05-14 17:34:56ajaksu2create