Environment Inheritance

(draft)

This functionality will enable e.g. trac hosting providers (or large scale users) to configure a basic trac environment which is then inherited to subusers environments.

The user can then inherit his own environment to his different projects. If the user wants to apply a change for all environmets, he just modifies the base environment (e.g. via webadmin or via trac-admin or whilst editing custom templates etc.).

The basic concept is to not point to different directories like "templates", "config" etc., but to point to environments instead (verify: finer grade control would be optionally possible, e.g. setting templates dir to somewhere else).

Notes

This task is a complex one, althought it consist about estimated 5 to 10 small changes to the code-base. It will take possibly a few weeks or even months to implement. It is important to extract small non-intrusive (= do not break existent behaviour) changes/additions which go into the code-base, enabling this way to think about the next step.

Terminology

  • base environment : the firstmost environment of a trac-installation
    • currently: default dirs, configured within 'siteconfig.py'
  • parent environemnt: environment from which all settings etc. are inherited.

Goal

  • concept-change: any environment can serve as the "shared-dir"
  • Enable a trac environment to inherit settings/templates etc. from another one
  • Keep simplicity of installation (e.g. environment inheritance is optional)

Requirements

  • Should work with simple SVN checkout
  • Should not interfere with basic setuptools installation
  • Should allow package managers to define alternative setup locations
  • Code checked out via svn should work immediately from it's location
    • => hardcoded pointer to directory structure (already available)
  • verify: Base Environment (= shared environment) configured within siteconfig.py
  • verify: Parent Environment configured within trac.ini
  • verify: Basic static Resources configured via a setuptools mechanisms (=pkg_resource)
    • possibly negate the need for this
      • generate an base environment during installation and point to this
  • An active environment (which contains db) can serve as an parent environment, too

Extended Functionality

  • Wiki default pages can be optionally retrieved from the database of the environment
    • e.g.: option in *.ini section [inheritance], "wiki-default-from-db"

Thoughts

  • Distinguish between "dynamic" and "creation" inheritance
    • dynamic : changes to parent are reflect to child
    • creation: parent setting are taken only at environement creation time
  • Define a Config Object?
    • config.ticket.restrict_owner, instead of
    • restrict_owner = Bool Option?('ticket', 'restrict_owner', 'false',