Edgewall Software
Modify

Opened 9 years ago

Last modified 8 years ago

#11985 new task

Create a [database] section in trac.ini

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: next-major-releases
Component: database backend Version:
Severity: normal Keywords: options
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Continuing with the theme of better categorizing the options in trac.ini (#11776, #11703, #11849, #11956, and less-so #11856, #11976), I'm considering the following:

  • [trac] backup_dir[database] backup_dir
  • [trac] database[database] connection_uri
  • [trac] timeout[database] connection_timeout
  • [trac] debug_sql[database] debug_sql
  • [trac] pg_dump_path[postgresql] dump_path
  • [trac] mysqldump_path[mysql] dump_path

I'm considering putting the latter two in the [database] section, however note that an [sqlite] section already exists.

Careful review of the [trac] section may lead to some other options for re-categorization. Given the number of Option changes that are already made for milestone:1.2, it seems best to make these changes before that release.

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 9 years ago

Description: modified (diff)

in reply to:  description comment:2 by Ryan J Ollos, 9 years ago

Replying to rjollos:

Given the number of Option changes that are already made for milestone:1.2, it seems best to make these changes before that release.

Considering the use-case of a deployment script that installs a Trac instance and sets configuration options using TracAdmin, the changes in tickets such as #11776 could be considered API changes. I'm not sure it's worth retaining the old option names and having some deprecation mechanism for renamed options, however considering that these changes may be viewed as API changes would provide more motivation for completing further changes before Trac 1.2 so that end-users only have to deal with a large number of changes in a single major release.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:3 by Jun Omae, 9 years ago

That changes would lead consistency and elegancy. However, many code in Trac core and plugins directly call self.config.get('trac', 'database'). I think we should leave only [trac] database option without changes.

IMO, I'd like to use DatabaseManager(self.env).connection_uri rather than. However, the reviewer has suggested self.config.get('trac', 'database').

$ git grep "[\"']trac[\"'], *[\"']database[\"']"
trac/admin/console.py:                ('trac', 'database', db_str),
trac/db/api.py:    connection_uri = Option('trac', 'database', 'sqlite:db/trac.db',
trac/db/api.py:            db_str = self.config.get('trac', 'database')
trac/db/mysql_backend.py:        db_url = self.env.config.get('trac', 'database')
trac/db/postgres_backend.py:        db_url = self.env.config.get('trac', 'database')
trac/db/sqlite_backend.py:        db_str = self.config.get('trac', 'database')
trac/env.py:            db_str = self.env.config.get('trac', 'database')
trac/test.py:            self.config.set('trac', 'database', self.dburi)
trac/upgrades/db16.py:    if env.config.get('trac', 'database').startswith('postgres'):
$ git --git-dir ~/src/trac-hacks.org/.git grep "[\"']trac[\"'], *[\"']database[\"']" | wc -l
81

comment:4 by Ryan J Ollos, 9 years ago

Milestone: next-dev-1.1.xnext-major-releases

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.