stable

Clone or download

Read-only

feat: Activate project after archive import

Once the archive is successfully imported, the project is "activated" => if platform does not require administrators approval, the project is active, site admin receive an email, project admins receive an email. => if platform requires administrators approval, the project is pending, site admin receive an email A confirmation email will be sent to project admins when the archive import is successful, so that they can now that its approval is ongoing. This will be done in a dedicated contribution. In order to be able to be activated, the import should properly end first. Currently it is stopped since async worker does not have a current user, and therefore there is a redirect (!) deep down in the stack trace (See `\AgileDashboard_XMLController::importProject`, `checkUserIsAdmin`). Now the user id who uploaded the archive is now part of the worker payload, but to retrieve it we need to pass the request to the finisher, we end up updating every usage of `\Tuleap\Tus\TusFinisherDataStore::finishUpload`. Part of story #36484 create a new project from an XML template Change-Id: Ib99e5d22da12cb170f08e472da2a2876f4c84ca4

Modified Files

Name
M plugins/docman/include/REST/v1/Files/EmptyFileToUploadFinisher.php +1 −1 Go to diff View file
M plugins/docman/include/Upload/Document/DocumentUploadFinisher.php +7 −1 Go to diff View file
M plugins/docman/include/Upload/Version/VersionUploadFinisher.php +2 −1 Go to diff View file
M plugins/docman/tests/unit/Upload/Document/DocumentUploadFinisherTest.php +2 −1 Go to diff View file
M plugins/docman/tests/unit/Upload/Version/VersionUploadFinisherTest.php +4 −3 Go to diff View file
M plugins/frs/include/FRS/Upload/EmptyFileToUploadFinisher.php +1 −1 Go to diff View file
M plugins/frs/include/FRS/Upload/Tus/FileUploadFinisher.php +7 −1 Go to diff View file
M plugins/frs/tests/unit/FRS/Upload/EmptyFileToUploadFinisherTest.php +1 −1 Go to diff View file
M plugins/frs/tests/unit/FRS/Upload/Tus/FileUploadFinisherTest.php +1 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Field/File/Upload/Tus/FileUploadFinisher.php +2 −1 Go to diff View file
M plugins/tracker/tests/unit/Tracker/FormElement/Field/File/Upload/Tus/FileUploadFinisherTest.php +2 −1 Go to diff View file
A src/common/Project/ActivateProject.php +31 −0 Go to diff View file
A src/common/Project/NotifySiteAdmin.php +30 −0 Go to diff View file
M src/common/Project/ProjectCreationNotifier.php +1 −1 Go to diff View file
M src/common/Project/ProjectCreator.class.php +1 −1 Go to diff View file
M src/common/Project/ProjectManager.class.php +4 −9 Go to diff View file
A src/common/Project/Registration/Template/Upload/ActivateProjectAfterArchiveImport.php +28 −0 Go to diff View file
M src/common/Project/Registration/Template/Upload/EnqueueProjectCreationFromArchive.php +2 −2 Go to diff View file
M src/common/Project/Registration/Template/Upload/ExtractArchiveAndCreateProject.php +40 −7 Go to diff View file
M src/common/Project/Registration/Template/Upload/FinishFileUploadPostAction.php +1 −1 Go to diff View file
A src/common/Project/Registration/Template/Upload/ProjectAfterArchiveImportActivation.php +54 −0 Go to diff View file
M src/common/Project/Registration/Template/Upload/ProjectCreationFromArchiveTask.php +3 −3 Go to diff View file
M src/common/Project/Registration/Template/Upload/Tus/ProjectFileUploadFinisher.php +15 −2 Go to diff View file
M src/common/Queue/WorkerEventProcessorFinder.php +30 −0 Go to diff View file
M src/common/Request/RouteCollector.php +1 −0 Go to diff View file
M src/common/Tus/TusFinisherDataStore.php +3 −1 Go to diff View file
M src/common/Tus/TusServer.php +1 −1 Go to diff View file
A src/common/User/ForceLogin.php +30 −0 Go to diff View file
M src/common/User/UserManager.class.php +3 −2 Go to diff View file
M src/utils/export_project_xml.php +1 −1 Go to diff View file
M src/www/admin/approve-pending.php +1 −1 Go to diff View file
A tests/lib/Stubs/Project/ActivateProjectStub.php +66 −0 Go to diff View file
A tests/lib/Stubs/Project/NotifySiteAdminStub.php +50 −0 Go to diff View file
A tests/lib/Stubs/Project/Registration/Template/Upload/ActivateProjectAfterArchiveImportStub.php +50 −0 Go to diff View file
A tests/lib/Stubs/User/ForceLoginStub.php +53 −0 Go to diff View file
M tests/unit/common/Project/Registration/Template/Upload/EnqueueProjectCreationFromArchiveTest.php +1 −1 Go to diff View file
M tests/unit/common/Project/Registration/Template/Upload/ExtractArchiveAndCreateProjectTest.php +135 −5 Go to diff View file
M tests/unit/common/Project/Registration/Template/Upload/FinishFileUploadPostActionStub.php +8 −1 Go to diff View file
A tests/unit/common/Project/Registration/Template/Upload/ProjectAfterArchiveImportActivationTest.php +114 −0 Go to diff View file
M tests/unit/common/Project/Registration/Template/Upload/ProjectCreationFromArchiveTaskTest.php +2 −2 Go to diff View file
M tests/unit/common/Project/Registration/Template/Upload/Tus/ProjectFileUploadFinisherTest.php +62 −10 Go to diff View file
M tests/unit/common/Queue/WorkerEventProcessorFinderTest.php +7 −1 Go to diff View file
M tests/unit/common/Tus/TusServerTest.php +4 −7 Go to diff View file