annotate doc/tracker_templates.txt @ 6433:c1d3fbcdbfbd

issue2551142 - Import of retired node ... unique constraint failure. Title: Import of retired node with username after active node fails with unique constraint failure. More fixes needed for mysql and postgresql. mysql: add unique constraint for (keyvalue, __retired__) when creating class in the database. On schema change if class is changed, remove the unique constraint too. upgrade version of rdbms database from 5 to 6 to add constraint to all version 5 databases that were created as version 5 and didn't get the unique constraint. Make no changes on version 5 databases upgraded from version 4, the upgrade process to 5 added the constraint. Make no changes to other databases (sqlite, postgres) during upgrade from version 5 to 6. postgres: Handle the exception raised on unique constraint violation. The exception invalidates the database connection so it can't be used to recover from the exception. Added two new database methods: checkpoint_data - performs a db.commit under postgres does nothing on other backends restore_connection_on_error - does a db.rollback on postgres, does nothing on other backends with the rollback() done on the connection I can use the database connection to fixup the import that failed on the unique constraint. This makes postgres slower but without the commit after every imported object, the rollback will delete all the entries done up to this point. Trying to figure out how to make the caller do_import batch and recover from this failure is beyond me. Also dismissed having to process the export csv file before importing. Pushing that onto a user just seems wrong. Also since import/export isn't frequently done the lack of surprise on having a failing import and reduced load/frustration for the user seems worth it. Also the import can be run in verbose mode where it prints out a row as it is processed, so it may take a while, ut the user can get feedback. db_test-base.py: add test for upgrade from 5 to 6.
author John Rouillard <rouilj@ieee.org>
date Thu, 10 Jun 2021 12:52:05 -0400
parents b76be13e027e
children 3f3ce3004013
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2133
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
1 =========================
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
2 Roundup Tracker Templates
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
3 =========================
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
4
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
5 The templates distributed with Roundup are stored in the "share" directory
2826
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
6 nominated by Python. On Unix this is typically
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
7 ``/usr/share/roundup/templates/`` (or ``/usr/local/share...``) and
2133
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
8 on Windows this is ``c:\python22\share\roundup\templates\``.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
9
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
10 The template loading looks in four places to find the templates:
2826
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
11
2133
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
12 1. *share* - eg. ``<prefix>/share/roundup/templates/*``.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
13 This should be the standard place to find them when Roundup is
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
14 installed.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
15 2. ``<roundup.admin.__file__>/../templates/*``.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
16 This will be used if Roundup's run in the distro (aka. source)
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
17 directory.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
18 3. ``<current working dir>/*``.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
19 This is for when someone unpacks a 3rd-party template.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
20 4. ``<current working dir>``.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
21 This is for someone who "cd"s to the 3rd-party template dir.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
22
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
23 Templates contain:
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
24
2826
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
25 - modules ``schema.py`` and ``initial_data.py``
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
26 - directories ``html``, ``detectors`` and ``extensions``
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
27 (with appropriate contents)
5762
b76be13e027e issue2551029: Jinja2 template install error.
John Rouillard <rouilj@ieee.org>
parents: 4557
diff changeset
28 - optional ``config_ini.ini`` file. It is structured like a tracker's
b76be13e027e issue2551029: Jinja2 template install error.
John Rouillard <rouilj@ieee.org>
parents: 4557
diff changeset
29 ``config.ini`` but contains only headers (e.g. ``[main]``) and
b76be13e027e issue2551029: Jinja2 template install error.
John Rouillard <rouilj@ieee.org>
parents: 4557
diff changeset
30 *required* parameters that are different from defaults:
b76be13e027e issue2551029: Jinja2 template install error.
John Rouillard <rouilj@ieee.org>
parents: 4557
diff changeset
31 e.g. ``template_engine = jinja2`` and ``static_files =
b76be13e027e issue2551029: Jinja2 template install error.
John Rouillard <rouilj@ieee.org>
parents: 4557
diff changeset
32 static``. These settings override the default values saved to the
b76be13e027e issue2551029: Jinja2 template install error.
John Rouillard <rouilj@ieee.org>
parents: 4557
diff changeset
33 tracker's ``config.ini``.
2826
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
34 - template "marker" file ``TEMPLATE-INFO.txt``, which contains
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
35 the name of the template, a description of the template
eb0015a2caa5 template contents description changed to new layout
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2133
diff changeset
36 and its intended audience.
2133
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
37
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
38 An example TEMPLATE-INFO.txt::
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
39
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
40 Name: classic
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
41 Description: This is a generic issue tracker that may be used to track bugs,
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
42 feature requests, project issues or any number of other types
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
43 of issues. Most users of Roundup will find that this template
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
44 suits them, with perhaps a few customisations.
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
45 Intended-For: All first-time Roundup users
f01befe8a7fe *** empty log message ***
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
46

Roundup Issue Tracker: http://roundup-tracker.org/