Edgewall Software
Modify

Opened 8 years ago

Last modified 2 years ago

#12406 new enhancement

Standardize nomenclature/options for cached repository

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.7.1
Component: version control Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Added cached attribute to repository and removed [git] cached_repository option and the svn direct-svnfs (non-cached) and svnfs (alias of cached svn) types.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Cached SVN repository is specified using the type svn. Cached Git repository is specified using the option [git] cached_repository. I think the latter is more clear, however it can't be specified per-repository.

In order to be more consistent, we could make cached a repository attribute, and use it for Git and Subversion repositories. We could allow the attribute to be set from the Manage Repositories admin page. An upgrade could be added to migrate users to the new configuration.

Also, the admin panel shows two additional types: direct-svnfs and svnfs. Are these just aliases?

Attachments (0)

Change History (17)

comment:1 by Ryan J Ollos, 7 years ago

Milestone: next-major-releases1.3.3
Owner: set to Ryan J Ollos
Status: newassigned

comment:2 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)

comment:3 by Ryan J Ollos, 7 years ago

Description: modified (diff)

comment:4 by Ryan J Ollos, 7 years ago

Implementation details:

The repository type svn remains a cached repository because cached defaults to True. The repository type git was previously non-cached by default since [git] cached_repository was False by default. Type git will now be a cached repository by default.

We could make repositories non-cached by default. The implementation is a bit easier that way. However, it seems like a cached repository is what most users would want. I haven't tested the mercurial plugin yet, which doesn't support cached repositories. I'll do some testing, but I think the value of the cached attribute will just be ignored. We could add a repository attribute to indicate whether the type supports cached repositories and disable the checkbox on the admin page if the repository type doesn't support CachedRepository.

Let me know if there's a preference for making the default value of cached either True or False. In absence of feedback, I'll go with True.

The changes are entirely not backward compatible, however the upgrade step will prevent breaking an existing environment. Users will need to adapt to the new behavior when creating repositories from the Repositories admin page or using trac-admin. For example, when creating a repository of type git, the user will need to explicitly unselect the cached attribute if they want a non-cached repository.

I think it's worth making the change to make the interface more consistent, easier to understand, and add the flexibility to specify per-repository caching for Git repositories. I also think the aliased terms direct-svnfs and svnfs were confusing. To mitigate the impact on users, the change will be described in TracUpgrade and the Release Notes.

Changes in log:rjollos.git:t12406_cached_repository_nomenclature.

comment:5 by Ryan J Ollos, 7 years ago

Fixed some issues in log:rjollos.git:t12406_cached_repository_nomenclature.3. The messages to resync the cache and modify the repository hooks will only be shown when appropriate. I'll need to add more tests since the changes are rather extensive.

TODO Update TracDev/ApiChanges/1.3 and TracDev/PluginDevelopment/ExtensionPoints/trac.versioncontrol.api.IRepositoryConnector.

comment:6 by Ryan J Ollos, 7 years ago

It looks like sync_per_request is only valid for a cached repository, so I'll remove the field from the Repository admin page for a repository (such as TracMercurial) that doesn't support cached repository.

Edited 1.3/TracRepositoryAdmin@3.

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

comment:7 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)

comment:8 by Ryan J Ollos, 7 years ago

Looks like we'll need to add a cached option to the [gitweb-repositories] section as well (see also #12480).

I'm reconsidering how the attributes for gitweb repositories should be handled. In order to support the standard repository attributes such as hidden and alias we could have the standard options in a [gitweb] section: projects_base, projects_list and projects_url. The [gitweb-repositories] section would then contain repositories in the format of the [repositories] section, except:

  • Only attributes for repositories defined in the projects_list file would be used.
  • dir and type would be ignored.
  • url attribute, if specified, would override [gitweb] projects_url.
  • description attribute, if specified, would override the repository description file.

On the last point, we should maybe read the description file for a [repositories] section git repository as well.

TODO Update wiki:1.3/TracRepositoryAdmin#ReposGitWeb.

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

comment:9 by Ryan J Ollos, 7 years ago

Scope of this ticket is further expanded based on discussion in gmessage:trac-dev:2ityvgVZxsQ/e-yprv0aBAAJ.

  • Add fs_encoding Git repository attribute, to replace [git] git_fs_encoding. We could retain git_fs_encoding to specify the default (global) repository encoding, perhaps renaming it to default_fs_encoding. The trade-off is having an extra configuration option and more complexity vs the convenience of not having to specify fs_encoding for every repository when encoding is other than utf-8. Either way the default, when not specified, will remain utf-8.
    • This change will require adding a way to specify connector-specific attributes. I'm considering adding get_repository_attributes to the IRepositoryConnector interface.
  • Use the sync_per_request attribute as a proxy for [git] persistent_cache, eliminating the latter configuration option. This depends on resolving #12895.

comment:10 by Ryan J Ollos, 6 years ago

Milestone: 1.3.31.3.4

comment:11 by Ryan J Ollos, 6 years ago

Milestone: 1.3.41.5.1

comment:12 by Ryan J Ollos, 4 years ago

Milestone: 1.5.11.5.3

comment:13 by Ryan J Ollos, 3 years ago

Milestone: 1.5.31.7

comment:14 by Ryan J Ollos, 3 years ago

Milestone: 1.71.7.1

Milestone renamed

comment:15 by Ryan J Ollos, 3 years ago

Milestone: 1.7.1
Owner: Ryan J Ollos removed
Status: assignednew

comment:16 by Ryan J Ollos, 3 years ago

Milestone: 1.7.1

comment:17 by Ryan J Ollos, 2 years ago

Prior to TracRepositoryAdmin@53, it was incorrectly stated:

Repositories that support caching are cached by default.

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.