wiki:SimpleMultiProjectPlugin

Manage multiple user projects with one Trac instance

Description

This plugin lets you easily manage multiple user projects with one Trac instance or, respectively, one Trac database (.db file).

This is not a meta project in front of several other Trac projects. It implements the idea of wiki:TracMultipleProjects/SingleEnvironment.

Key features:

  • Milestones and versions are assigned to their projects, and both are displayed on the roadmap.
  • On the roadmap page and timeline page it is possible to apply filters to show only projects that meet certain criteria.
  • Components can be assigned to all or only certain projects.
  • 'New Ticket' will just offer the associated milestones, versions and components of the chosen project. This requires a new custom-ticket field 'project'.
  • Restrict access to certain milestones, versions and tickets by defining members or non-members of a project.

This plugin is already running stable in production environments.

Note: The Multiple Project feature in the sense of having a meta Trac project on top of several Trac projects is discussed in T:#11025 (formerly T:#130) and the unscheduled milestone Trac topic-multiproject.

Integration with other plugins

MultiProjectBacklogPlugin integrates with this plugin allowing you to maintain project specific backlogs in your agile process.

When ExtendedVersionPlugin is installed SimpleMultiProjectPlugin adds an additional Version column to the milestone table of the milestone admin page.

Plan

(falkb: I'm currently not active anymore because I'm quite sufficiently satisfied with what the plugin achieves, but I'm available for hotfixes)

In testing state:

No results

Work in progress:

#11563
Restrict owner to users with access to the project
#12374
Refactor model.py
#12799
Milestone progress bars are very narrow

Still just an idea:

#10089
project-related timeline page filtering of wiki changes
#10090
user-defined field used to define the "project" (e.g. by using component)
#10152
Localization / translation support (L10N)
#11162
improve project selection widget
#11543
Per-project ticket.default_* settings

Technical implementation details

This plugin adds a new resource 'project' implemented by database table:

  1. smp_project: a list of all defined projects
    Actually, most database tables of Trac core related to resources would need a new column 'project_id'. This way tickets, components, milestones, versions or even wikis could attach to certain projects. Since a plugin just adds stuff but cannot change the core structure, it implements the new dimension 'project' not by adding a new column to each resource table but rather by adding several mapping tables smp_[resource]_project, each one mapping a certain resource to projects:
  2. smp_milestone_project: the association of milestones to projects
  3. smp_version_project: the association of versions to projects
  4. smp_component_project: the association of components to projects

Example

All actions are also possible with the trac-admin script. See trac-admin <your-trac-env> project help for the list of available commands.

Admin Interface:

project admin interface


Add project summary and description. This is displayed on the roadmap page as follows:

write project summary and description


Associate a milestone with a project:

  • Mapping milestones and versions to a project is supported
    • via main menu item "Admin" -> "Ticket System" -> "Milestones" / "Versions".
    • Another way is doing it from the Roadmap page:
      1. From the Roadmap Page, find the desired milestone/version and click it.
      2. Scroll to bottom of page and "Edit" the page. Select the project from the given combobox.
    • via trac-admin project script.
  • Note: "New Ticket" with a chosen project only offers milestones and versions mapped to that certain project.

Edit milestone


Group milestones and versions on the roadmap by project, show project summary and description in the header of the project box, and display only projects chosen in the filter box:

roadmap can display project summary+description; project filter displays milestones and versions of certain projects, only


Display only tickets in the timeline of projects chosen in the filter box (adapted from TimelineComponentFilterPlugin):

timeline filter demo


You also can include the Project Name in your Ticket Queries by adding a join to the ticket_custom table:

SELECT p.value AS __color__,
   id AS ticket, summary, 
   tc.value AS 'Project-Name',    -- display the Project Name in the Ticket Overview
   version, milestone, t.type AS type,
   owner, status,
   time AS created,
   changetime AS _changetime, description AS _description,
   reporter AS _reporter
FROM ticket t
   LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
   LEFT JOIN ticket_custom tc ON t.id = tc.ticket AND tc.name = 'project'   -- join to ticket_custom and only select the Project-Name
WHERE status <> 'closed'
ORDER BY CAST(p.value AS integer), milestone, t.type, time

Bugs/Feature Requests

Existing bugs and feature requests for SimpleMultiProjectPlugin are here.

If you have any issues, create a new ticket.

defect

59 / 60

enhancement

34 / 48

task

5 / 6

Download

Download the zipped source from here.

The current release version is V0.5.1 in the tags directory. The trunk version works but may lack some documentation.

Source

You can check out SimpleMultiProjectPlugin from here using Subversion, or browse the source with Trac.

Installation

  1. Add a custom ticket field 'project' in your trac.ini file to give tickets the information to which project they belong. Milestones selection depends on that as well:
    [ticket-custom]
    project = select
    project.label = Project
    project.value =
    
  2. Generate the plugin .egg file from sources:
    python setup.py bdist_egg
    
  3. Copy the plugin to the plugins directory of your Trac installation:
    cp dist/SimpleMultiProject-0.0.1-py2.6.egg /instance_trac/plugins/
    
  4. Restart Apache: after installation of this plugin Trac needs a database upgrade:
    trac-admin /instance_trac/ upgrade
    
  5. Give permissions to certain users. Available permissions are:
    • PROJECT_SETTINGS_VIEW - you can see the list of projects with their description and their component mapping on the Admin panel
    • PROJECT_ADMIN - full access, you can also create and delete projects, and map to milestones, versions and components
  6. Since plugin version 0.4 we support project-wise restriction of resources to a subset of users (#11367). Switch on the plugin component ProjectTicketsPolicy to activate it, and add the following to your trac.ini file:
    [trac]
    permission_policies = ProjectTicketsPolicy, ... any other ...
    
    Define a comma-separated list of users or groups in 'Admin' -> 'Manage Projects' -> 'Projects' -> '<project name>' -> 'Restrict to users' to limit the access to certain projects, such as milestones, versions and tickets. For example, set
    • john, mary, group1, authenticated to restrict to this set of users
    • !, bob, anonymous, group2 to exclude from the project.

Configuration

The plugin comes with sane default values, but if you have specific requirements you may change some configuration options.

When ExtendedVersionPlugin is installed an additional column with version information is added to the milestone table on the admin page. You may remove this column just by disabling the plugin SmpAddExtendedVersionColumn. Use the plugin admin panel or add the following line to your configuration file:

[components]
simplemultiprojectplugin.admin_filter.SmpAddExtendedVersionColumn = disabled

There are some trac.ini options to control association of projects with milestones and components.

  1. Creation of milestones is only possible when a project is chosen. You may disable this behaviour by setting the following in trac.ini:
    [simple-multi-project]
    milestone_without_project = True
    
  2. To ensure only a single project is associated with each milestone set the following in trac.ini:
    [simple-multi-project]
    single_project_milestones = True
    
  3. Creation of versions is only possible when a project is chosen. You may disable this behaviour by setting the following in trac.ini:
    [simple-multi-project]
    version_without_project = True
    
  4. To ensure only a single project is associated with each version set the following in trac.ini:
    [simple-multi-project]
    single_project_versions = True
    

Recent Changes

15523 by Cinc-th on 2016-04-30 22:18:21
SimpleMultiProjectPlugin: bumped version to V0.5.2dev.
15522 by Cinc-th on 2016-04-30 22:12:17
Release V0.5.1.

The following new features are available:

  • #12367:
    • associate projects and components using the components panel of Trac
  • #12702:
    • new plugin to add a column to the milestone table with version information if ExtendedVersionPlugin is installed and enabled
  • #12703:
    • allow hiding of completed milestones on milestone admin page
    • allow filtering of milestones by project on milestone admin page
  • #12704:
    • allow hiding of completed versions on version admin page
    • allow filtering of versions by project on version admin page

The following bugs were fixed:

  • #12568
    • UnicodeError: source returned bytes, but no encoding specified when using Genshi 0.7
  • #12628
    • IndexError: list index out of range
  • #12761

Some minor fixes not tracked by tickets were applied.

See log:simplemultiprojectplugin@15018:15521 for full changelog since V0.5.0.

Closes #12765

15521 by Cinc-th on 2016-04-30 21:58:37
SimpleMultiProjectPlugin: prepare release V0.5.1.
15432 by Cinc-th on 2016-03-14 10:55:51
SimpleMultiProjectPlugin: allow filtering of milestones by project on milestone admin page even if several projects are linked with a milestone.

Fixes #12703.

15431 by Cinc-th on 2016-03-14 10:21:29
SimpleMultiProjectPlugin:

  • allow hiding of completed versions on version admin page
  • allow filtering of versions by project on version admin page

Fixes #12704.

(more)

Author/Contributors

Author: crossroad, falkb, thomasd, Cinc-th
Maintainer: falkb
Contributors:

Last modified 72 minutes ago Last modified on Jul 30, 2016, 4:58:14 PM

Attachments (8)

Download all attachments as: .zip