#12965 closed enhancement (fixed)
Remove default components and milestones in `trac-admin initenv` — at Version 7
Reported by: | anonymous | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.5.1 |
Component: | admin/console | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Added option |
||
API Changes: |
|
||
Internal Changes: |
Description
When initializing a new environment it will be populated with placeholder components and milestones (ie "component#" and "milestone#").
However I think it's rather unlikely that these actual components and milestones will be useful in an actual project. This means that the next step is likely to manually remove these components and milestones and populate the environment with relevant components and milestones.
I suggest that trac-admin initenv
instead create an environment without any components or milestones predefined or if required prompt the user for the actual names of the components and milestones.
Change History (7)
comment:1 by , 6 years ago
Milestone: | → next-major-releases |
---|
comment:2 by , 6 years ago
r16341 moved the DatabaseManager.insert_into_tables
call to the DatabaseManager
class via implementation of IEnvironmentSetupParticipant
. The motivation was to reduce coupling between the modules.
The change would either need to be reverted, or we would need a way to pass a parameter to environment_created
. We could add an argument to IEnvironmentSetupParticipant.environment_created
for passing parameters.
PoC changes in [d9b04db04/rjollos.git]. Note that the --no-default-data
argument results in skipping insertion of all default data: components, milestones, enums, permissions and reports. We could divide this into "sample data" and "default data" (i.e. default configuration data). Milestones, components and versions are clearly sample data. However, whether enums are sample data is a bit more subjective, and I think that permissions and reports are clearly default data.
If anything is done related to this ticket, I think the aim should be to give more control over how the environment is populated with data, not to extend initenv
so that resources like milestones can be added while interactively running initenv
. Note that everything request in comment:description can be scripted using trac-admin
commands. For example, use the TracAdmin milestone remove
/ milestone add
commands, or milestone rename
.
comment:3 by , 5 years ago
Milestone: | next-major-releases → 1.5.1 |
---|---|
Owner: | set to |
Release Notes: | modified (diff) |
Status: | new → assigned |
I've experimented a bit, and now have the following proposed changes:
--no-default-data
will yield an empty environment: no reports, milestones, components, permission groups, etc. This gives the user two scripting options: Start with no data and add (e.g.trac-admin milestone add ..
), or start with sample data and delete what's unwanted.- Add method
DatabaseManager.insert_default_data
, which is called fromEnvironment.create
. - The database version entries in the
system
tables are always inserted when the database is initialized, set byDatabaseManager.init_db
(this is a minor API change).
log:rjollos.git:t12965_initenv_no_default_data.2
Thoughts?
If it looks okay, I'll tidy up the docstrings and add test coverage.
comment:4 by , 5 years ago
I will add test coverage and proceed to push the changes in absence of any feedback.
Rebased in log:rjollos.git:t12965_initenv_no_default_data.3 —squashed→ [29a8d17a0/rjollos.git]
comment:7 by , 5 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in r17162.
We can consider adding a
--no-default-data
option.