Ticket #1549 (new enhancement)
Save/restore/add reports via trac-admin
| Reported by: | pkou at ua.fm | Owned by: | daniel |
|---|---|---|---|
| Priority: | lowest | Milestone: | 1.0 |
| Component: | report system | Version: | devel |
| Severity: | normal | Keywords: | multiple project |
| Cc: |
Description
Implementing a customized workflow system in Trac affects almost every feature (timeline, roadmap, reports, tickets, queries) because ticket statuses can be different. While all features can be abstracted from ticket statuses, reports cannot.
A solution for this problem is to give administrator a possibility to update reports when a workflow is changed.
It requires the following changes:
- trac-admin shall allow admins to save existing reports in a file;
- trac-admin shall allow admins to add new reports from a file;
- trac-admin shall allow admins to replace workflow-specific reports from a file.
While (1) and (2) is understandable, it is necessary to define how to distinguish between a report that should be replaced during workflow change (e.g. system report) and a report that should be kept during workflow change (e.g. user report).
Possible solutions:
- Classify all reports as system and other. User is not able to change report type. By default, all reports that are created by Trac are marked as system. When user creates a report, it is marked as other. When user edits a system report, Trac shows a warning that the changes will be lost after workflow change.
- It requires changes in database (new column type for table report).
- When system reports are replaced, Trac deletes existing system reports first, then creates reports from a file trying to keep recommended report ID that is specified in a file.
- Reserve first N reports as system (e.g. N=30). When user creates a report, it is created in user area and has id>N.
- It requires an upgrade script that moves all reports created by user behind N. As result, report references in wiki will be lost.
{{trac-admin}}} commands:
- report save (system|user) <filename> - save system or user reports to a file;
- report add (system|user) <filename> - add system or user reports from a file;
- report replace (system|user) <filename> - replace system or user reports from a file.
Thus, when a workflow needs to be changed for a project, admin should take the following steps:
- Specify new workflow in configuration;
- Replace system reports for a project.
Workaround until the feature is not implemented: Update reports by direct database editing using sqlite.
(In preparation to #869)


