stable

Clone or download

Read-only

feat: Handle dangling expired uploaded archive

Expired project archive can still be in the File System for some reasons. That's why when the daily job command is launched it will also purge the expired file from the FS if needed. Same for the DB, if a saved file is expired and still in the DB then it will be also removed. How to test: - Comment `ProjectFileUploadFinisher.php L49` - Create at least 3 new projects (from the UI for example) => 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 3 lines - Go in the `project_file_upload` DB table. - Make one file considered as expired => change the expiration_date to 1710425915 for example. (file A) - Remove the second file from the DB. (file B) - Leave the third file untouched. (file C) - In your container launch : tuleap daily-job => File A is neither in the DB nor in the FS anymore => File B is not in the FS anymore. => File C is still in the DB and the FS. Part of story #36484 create a new project from an XML template Change-Id: I7e5c70c7a0898ae2ca9c0a200e0687cb704cbec7

Modified Files

Name
M src/common/CLI/Command/DailyJobCommand.php +9 −6 Go to diff View file
A src/common/Project/Registration/Template/Upload/DeleteUnusedFiles.php +30 −0 Go to diff View file
M src/common/Project/Registration/Template/Upload/ProjectArchiveOngoingUploadDao.php +11 −1 Go to diff View file
A src/common/Project/Registration/Template/Upload/ProjectArchiveUploadCleaner.php +45 −0 Go to diff View file
A src/common/Project/Registration/Template/Upload/SearchFileUploadIds.php +29 −0 Go to diff View file
M src/utils/tuleap.php +13 −7 Go to diff View file
A tests/unit/common/Project/Registration/Template/Upload/DeleteUnusedFilesStub.php +47 −0 Go to diff View file
A tests/unit/common/Project/Registration/Template/Upload/ProjectArchiveUploadCleanerTest.php +69 −0 Go to diff View file
A tests/unit/common/Project/Registration/Template/Upload/SearchFileUploadIdsStub.php +40 −0 Go to diff View file