Edgewall Software

Changes between Initial Version and Version 2 of Ticket #11437


Ignore:
Timestamp:
Mar 13, 2014, 5:56:43 PM (10 years ago)
Author:
Ryan J Ollos
Comment:

The changes in comment:1 look good to me. I'm testing them along with the changes in #11520 and I'll make some comments in that ticket.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11437

    • Property Cc Jun Omae added
    • Property Milestone undecided1.0.2
  • Ticket #11437 – Description

    initial v2  
    1 When the Trac environment is first created the default data is [browser:/branches/1.0-stable/trac/env.py@11981:576#L544 written to trac.ini], which provides a convenience that we don't experience when installing plugin. At least, when the plugin is initially installed, it would be nice to have the default data added to trac.ini. Currently the user must manually type the section and option name if they wish to change any configuration values. I think that most users would expect that the defaults for all configuration values be found in trac.ini.
     1When a Trac environment is first created the default data is [browser:/branches/1.0-stable/trac/env.py@11981:576#L544 written to trac.ini]. However, when installing a plugin the default data is not written to trac.ini.
     2
     3When the plugin enabled it would be nice to have the default data added to trac.ini. Currently the user must manually type the section and option name if they wish to change any configuration values. I think that most users would expect that the defaults for all configuration values be found in trac.ini.
    24
    35A quick implementation that is not ideal, but demonstrates the idea is found in log:rjollos.git:t11437.
    46
    5 One issue with the quick implementation is that all of defaults are added, not just those of the plugin being installed. Maybe this is okay, but if a user likes to remove a lot default options to simplify the file, they may be surprised to have their changes undone (#7378).
     7One issue with the quick implementation is that all of defaults are written to trac.ini, not just those of the plugin being installed. Maybe this is okay, but if a user likes to remove a lot default options to simplify the file, they may be surprised to have their changes undone (#7378).
    68
    79#8290 had me thinking of a different solution, that plugins could add the information through existing `IEnvironmentParticipant` method, or new methods or helper functions that we add. The downside of course is that every plugin then needs to be modified to implement the behavior.
    810
    9 Side note: it might be useful to have a `trac-admin $ENV config clean` command to remove options from trac.ini that are no longer defined in an enabled Component. For example, with th:AccountManagerPlugin, many options were renamed going from 0.3 -> 0.5, and the users must manually clean up these sections. This comes up rather frequently when users post their configuration section to tickets and it contains a mess of old and new configuration options. Of course, it causes no harm to leave them, it is just more confusing and error prone to manage the trac.ini file. We could, by default, create a backup of the trac.ini file whenever //clean// is run.
     11Side note: it might be useful to have a `trac-admin $ENV config clean` command to remove options from trac.ini that are no longer defined in an enabled Component. For example, with th:AccountManagerPlugin, many options were renamed going from 0.3 -> 0.5, and the users must manually clean up these sections. This comes up rather frequently when users post their configuration to tickets and it contains a mess of old and new configuration options. Of course, it causes no harm to leave them, it is just more confusing and error prone to manage the trac.ini file. We could, by default, create a backup of the trac.ini file whenever //clean// is run.