stable

Clone or download

Read-only

feat(git): Cannot create a Git repository until deletion is done

This is part of request #37910 Repository in deletion must not be recreated until deletion is completed Given a Git repository marked as deleted, then a repository with the same path cannot be recreated until the Git repository deletion system event is done. Otherwise it could lead to a broken new repository and the impossibility to correctly archive the old repository. This patch only deals with the backend part of the feature. A dedicated patch will be done for the UI. How to test ----------- * Create a Git repository. * Once the creation is finished, delete it. * Try to recreate it when the GIT_REPO_DELETE system event is not Done (or processed) => The repository creation must fail * Try to recreate it when the GIT_REPO_DELETE system event is Done => The repository creation is OK Change-Id: Iae7ffdba4351b733c4b9ff5dc2671d4a3984c351

Modified Files

Name
M plugins/git/include/Git/Repository/RepositoryCreator.php +2 −0 Go to diff View file
A plugins/git/include/Git/SystemEvent/OngoingDeletionDAO.php +49 −0 Go to diff View file
M plugins/git/include/GitRepositoryManager.class.php +29 −0 Go to diff View file
M plugins/git/include/REST/v1/RepositoryResource.class.php +6 −1 Go to diff View file
A plugins/git/include/exceptions/GitRepositoryInDeletionException.php +29 −0 Go to diff View file
M plugins/git/include/gitPlugin.php +3 −1 Go to diff View file
M plugins/git/site-content/fr_FR/LC_MESSAGES/tuleap-git.po +4 −0 Go to diff View file
M plugins/git/site-content/pt_BR/LC_MESSAGES/tuleap-git.po +4 −0 Go to diff View file
M plugins/git/tests/integration/GitXmlImporterTest.php +6 −1 Go to diff View file
M plugins/git/tests/unit/GitRepositoryManagerCreateTest.php +21 −1 Go to diff View file
M plugins/git/tests/unit/GitRepositoryManagerDeleteAllRepositoriesTest.php +3 −1 Go to diff View file
M plugins/git/tests/unit/GitRepositoryManagerForkTest.php +4 −0 Go to diff View file
M plugins/git/tests/unit/GitRepositoryManagerRepositoryNameTest.php +3 −1 Go to diff View file