Edgewall Software

Opened 10 years ago

Last modified 9 years ago

#11437 closed enhancement

Configuration sections from plugins should be written to trac.ini — at Initial Version

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.4
Component: general Version:
Severity: normal Keywords: configuration trac.ini
Cc: hasienda, Jun Omae Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When the Trac environment is first created the default data is 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.

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 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).

#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 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.

Change History (0)

Note: See TracTickets for help on using tickets.