Configuration sections from plugins should be written to trac.ini
|Reported by:||Ryan J Ollos||Owned by:||Ryan J Ollos|
|Cc:||hasienda, Jun Omae||Branch:|
Description (last modified by )
When 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.
A quick implementation that is not ideal, but demonstrates the idea is found in log:rjollos.git:t11437.
One 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).
#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.
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 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.
Change History (25)
comment:2 by , 8 years ago
|Milestone:||undecided → 1.0.2|