Questions concerning reports

0 views
Skip to first unread message

mb

unread,
Dec 13, 2006, 8:31:48 AM12/13/06
to Trac Development
Hi,

the predefined reports have been changed in eg. Rev 4357, 4358.

The new db_defaults.py is published in our
../lib/python/site-packages/trac. But I see the old reports (without
the join). Using trac-admin <PATH_TO_TRACENV> update, returns
everything is up to date. This seems to be because the value of
db_version has not changed.

So my first question would be: How can I import the newer versions into
my environment?

As a workaround, I edited the reports, so that they had the same
contents, as the newer versions.

Not nice but works ... for most reports. The last three standard
reports still do not work. We use MySQL as a database backend.
It seems that the replacement of the USER variable doesn't work.
The LogFile shows:
2006-12-13 14:11:10,705 Trac[report] DEBUG: Executing report with SQL
"SELECT p.value AS __color__,
t.milestone AS __group__,
(CASE status
WHEN 'closed' THEN 'color: #777; background: #ddd; border-color:
#ccc;'
ELSE
(CASE owner WHEN 'concat(', %s, ')' THEN 'font-weight: bold'
END)
END) AS __style__,
id AS ticket, summary, component, status,
resolution,version, t.type AS type, priority, owner,
changetime AS modified,
time AS _time,reporter AS _reporter
FROM ticket t
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'),
(CASE status WHEN 'closed' THEN modified ELSE (-1)*p.value END)
DESC
" ([u'maxbernhardt'])

After that no error is generated, but the resultset seems to be empty.
Ah, I forgot to mention, we don't use the priority field, so there are
no priorities in the database. But seeing that the other reports work,
I don't think that this is the problem.

CU
Max

Matt Good

unread,
Dec 14, 2006, 8:48:42 PM12/14/06
to Trac Development
mb wrote:
> the predefined reports have been changed in eg. Rev 4357, 4358.
>
> The new db_defaults.py is published in our
> ../lib/python/site-packages/trac. But I see the old reports (without
> the join). Using trac-admin <PATH_TO_TRACENV> update, returns
> everything is up to date. This seems to be because the value of
> db_version has not changed.

Trac does not attempt to upgrade the contents of the reports since we
don't want to modify them if they've been modified by the users. I was
reluctant about trying to support this, but I just occurred to me that
we could store a list of hashes of previous versions of the reports.
If the report's content matched one of the old hashes it'd be upgraded
to the current version.

Thoughts?

-- Matt Good

Noah Kantrowitz

unread,
Dec 14, 2006, 10:55:32 PM12/14/06
to trac...@googlegroups.com

Possibly it should work like the "wiki upgrade" command, so you can
choose to run it or not.

--Noah

Reply all
Reply to author
Forward
0 new messages