stable

Clone or download

Read-only

feat: Prevent usage of outgoing client requests in transaction

When we are in the middle of a transaction, we don't want a request to be performed to an external service. Transaction can be rollbacked or transaction will take time to commit, external service should based its behavior on committed data. No functional change. If you try to add a transaction in `ArtifactCreator::create`, then the creation of the artifact via the modal in kanban should fail. This remove the last enclosing transactions. It also moves addReverseLinks method call outside of the transaction since it start its own transaction. Part of request #36805: Kanban item not found when creating a card in Kanban Change-Id: Ib8fd0db2fd417067d512cc0ef9ab66705404b947

Modified Files

Name
M plugins/program_management/include/Adapter/Program/Backlog/TopBacklog/ProcessTopBacklogChange.php +44 −50 Go to diff View file
M plugins/program_management/include/REST/v1/ProgramIncrementResource.php +8 −15 Go to diff View file
M plugins/program_management/include/REST/v1/ProjectResource.php +0 −3 Go to diff View file
M plugins/program_management/include/program_managementPlugin.php +4 −4 Go to diff View file
M plugins/program_management/tests/rest/v1/Helper/ProgramDataBuilder.php +2 −1 Go to diff View file
M plugins/program_management/tests/unit/Adapter/Program/Backlog/TopBacklog/ProcessTopBacklogChangeTest.php +0 −2 Go to diff View file
M plugins/pullrequest/include/PullRequest/Notification/PullRequestNotificationSupport.php +2 −1 Go to diff View file
M plugins/tracker/include/REST/Artifact/PUTHandler.php +9 −13 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactsResource.class.php +0 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/ArtifactsDeletion/ArtifactDeletorBuilder.php +2 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/PostCreation/ActionsQueuer.php +2 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Creation/TrackerArtifactCreator.class.php +5 −7 Go to diff View file
M plugins/tracker/include/trackerPlugin.php +3 −2 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/PUTHandlerTest.php +0 −2 Go to diff View file
M plugins/tracker_functions/include/tracker_functionsPlugin.php +0 −1 Go to diff View file
A src/common/DB/CheckThereIsAnOngoingTransaction.php +26 −0 Go to diff View file
A src/common/DB/ThereIsAnOngoingTransactionChecker.php +33 −0 Go to diff View file
A src/common/Http/Client/OngoingTransactionCheckerPlugin.php +42 −0 Go to diff View file
M src/common/Http/HttpClientFactory.php +11 −1 Go to diff View file
M src/common/Queue/EnqueueTask.php +2 −1 Go to diff View file
M src/common/Queue/Noop/PersistentQueue.php +2 −2 Go to diff View file
M src/common/Queue/PersistentQueue.php +2 −2 Go to diff View file
A src/common/Queue/PersistentQueueNoTransactionWrapper.php +51 −0 Go to diff View file
M src/common/Queue/QueueFactory.php +15 −7 Go to diff View file
M src/common/Queue/Redis/RedisPersistentQueue.php +8 −20 Go to diff View file
M src/common/Queue/Worker.php +2 −1 Go to diff View file
M src/common/system_event/include/SystemEvent_SYSTEM_CHECK.class.php +2 −1 Go to diff View file
A tests/integration/tests/DB/ThereIsAnOngoingTransactionCheckerTest.php +55 −0 Go to diff View file
A tests/lib/Stubs/DB/CheckThereIsAnOngoingTransactionStub.php +49 −0 Go to diff View file
A tests/unit/common/Http/Client/OngoingTransactionCheckerPluginTest.php +83 −0 Go to diff View file
A tests/unit/common/Queue/PersistentQueueNoTransactionWrapperTest.php +83 −0 Go to diff View file
A tests/unit/common/Queue/QueueFactoryTest.php +54 −0 Go to diff View file
M tests/unit/common/Queue/QueueSupervisorTest.php +2 −2 Go to diff View file