Page MenuHomePhabricator

Support renaming repositories in Gerrit
Closed, ResolvedPublic

Description

My understanding is that the Gerrit metadata will no more be in the database and would only be in the Git repository (known as NoteDB). Gerrit the index those metadata from git into a faster system (the secondary index, supported by Lucene).

So if I get it right, renaming a repository would mean something like:

  • stop Gerrit
  • move the git repository on disk
  • run offline indexing to get rid of the old repository and notice the new repository
  • start Gerrit
  • Possibly flush the project_list cache? Had an issue with the parentproject:integration query after deleting a repository ( T263682 ). Can be done using gerrit flush-caches --cache project_list

But:

  • the offline indexing takes age iirc (roughly an hour when we did it for Gerrit 3.2 upgrade).
  • online indexing does not seem to support deleting informations for a no more existing repository

Gerrit mailing list discussion (2020-09-14): https://groups.google.com/g/repo-discuss/c/ZPVSc5h2hNw

Event Timeline

Filled that task since I could not find a task to support renaming repositories. At least no task that express the feature request.

This should be supported with the online indexer I think (I remember testing this but it was on a different version and also a while ago)

Under 2.16+ you need to reindex the project index and changes.

I have bring it up to the Gerrit discussion mailing list at https://groups.google.com/g/repo-discuss/c/ZPVSc5h2hNw

hashar claimed this task.

From T201953, I have finally added to our Gerrit instance the rename-project plugin which provides a rename-project ssh command (as well as a REST API entry point).

I think the interest of this task was to detail the manual steps that would be required to complete a project renaming, notably flushing the project-list cache or reindexing the changes. The plugin handles that for us.

Thus I guess we can mark this one as solved (by the plugin) and remove the stalled state from all parent tasks.