stable

Clone or download

Read-only

feat: Cleanup dangling project created from an archive

Before the "real" import of the project from archive, a dummy project is created with the status `X`. For several reasons the import can go wrong and the project is never really created and the project status is never updated. These dangling projects should be marked as deleted (D) and the shortname should be renamed to `import_failure_<project_id>. How to test: - Comment `ProjectFileUploadFinisher.php L56` ($this->finish_file_upload_post_action->process...)) - Comment `ProjectFileUploadFinisher.php L62` ($this->file_ongoing_upload_dao->deleteById($file_information);) - Create at least 2 new projects (from the UI for example)( project A and project B ) => the project archives are in the FS of your container (e.g in /var/tmp/project/ongoing-upload directory) => The project_file_upload` DB table contains at least 2 lines => The `groups` DB table contains 2 project with the `X` status - Go in the `project_file_upload` DB table. - Make one file considered as expired => change the expiration_date to 1710425915 for example. (archive related to project A) - Leave the second file untouched. (archive related to project B) - In your container launch : tuleap daily-job - Go in the `groups` table => Project A is marked as deleted => Project B is still marked as `X` since the aassociated archive is not expired. The cleanup of `project_file_archive` and the file system should works as before Part of story #36484 create a new project from an XML template Change-Id: I4db3c7c8e6806e997d5d549bc6ca71a08077f0a5

Modified Files

Name
A src/common/Project/ProjectByStatus.php +34 −0 Go to diff View file
M src/common/Project/ProjectManager.class.php +10 −12 Go to diff View file
A src/common/Project/ProjectRename.php +31 −0 Go to diff View file
M src/common/Project/Registration/Template/Upload/ProjectArchiveOngoingUploadDao.php +3 −3 Go to diff View file
M src/common/Project/Registration/Template/Upload/ProjectArchiveUploadCleaner.php +57 −5 Go to diff View file
R src/common/Project/Registration/Template/Upload/SearchFileUploadIds.php Go to diff View file
A src/common/Project/UpdateProjectStatus.php +35 −0 Go to diff View file
M src/utils/tuleap.php +7 −2 Go to diff View file
A tests/lib/Stubs/Project/ProjectByStatusStub.php +43 −0 Go to diff View file
A tests/lib/Stubs/Project/ProjectRenameStub.php +51 −0 Go to diff View file
A tests/lib/Stubs/Project/UpdateProjectStatusStub.php +50 −0 Go to diff View file
M tests/unit/common/Project/Registration/Template/Upload/ProjectArchiveUploadCleanerTest.php +28 −5 Go to diff View file
R tests/unit/common/Project/Registration/Template/Upload/SearchFileUploadIdsStub.php Go to diff View file