stable

Clone or download

Read-only

Fix performance issue on artifacts with workflow

Management of workflow since the introduction of artifact based post actions is slow. A basic workflow on 4 values (4x4 transitions) can lead to 1900+ SQL queries at display and 800+ queries at write (artifact update). This commit solves this perf issue with 2 strategies: - caching of the already computed values. Some may argue it hides the underlying problem but given the current architecture of the tracker it's hard to do it without an entire rebuild of the way fields are managed. - pre-fetching of the values. The code is desgined after fetching of single transitions. However, most of the time we need to fetch the entire worfklow (all transitions, all post actions, etc) so it's more efficient to fetch everything at once. With this patch, an artifact web view display went from 1870 SQL queries to 299 (for the record, same artifact without workflow requires 278 SQL queries) and update from 311 to 150. Fix request #17191 Artifacts in trackers with workflow generate way to much SQL requests Change-Id: Id793411db456cd905efcb109797df42b27fb58ce

Modified Files

Name
M plugins/agiledashboard/include/AgileDashboard/Workflow/AddToTopBacklogPostActionDao.php +16 −0 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/Workflow/AddToTopBacklogPostActionFactory.php +49 −8 Go to diff View file
M plugins/agiledashboard/include/agiledashboardPlugin.php +13 −5 Go to diff View file
M plugins/agiledashboard/tests/unit/AgileDashboard/Workflow/AddToTopBacklogPostActionFactoryTest.php +54 −7 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/CampaignsResource.class.php +1 −10 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/ExecutionsResource.class.php +1 −11 Go to diff View file
M plugins/timetracking/include/Timetracking/REST/v1/ProjectResource.php +1 −11 Go to diff View file
M plugins/tracker/db/install.sql +1 −1 Go to diff View file
A plugins/tracker/db/mysql/updates/2020/202010121049_improve_workflow_transition_index.php +47 −0 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactsResource.class.php +1 −8 Go to diff View file
M plugins/tracker/include/REST/v1/ProjectTrackersResource.class.php +1 −10 Go to diff View file
M plugins/tracker/include/REST/v1/TrackersResource.class.php +2 −16 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Artifact.php +4 −28 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/View/Edit.class.php +2 −14 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Container_Fieldset.class.php +2 −13 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field.class.php +2 −13 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +2 −13 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/CIBuild/Transition_PostAction_CIBuildDao.class.php +14 −0 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/CIBuild/Transition_PostAction_CIBuildFactory.class.php +62 −31 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/Field/Transition_PostAction_Field.class.php +1 −3 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/Field/Transition_PostAction_FieldFactory.class.php +56 −27 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/Field/dao/Transition_PostAction_FieldDao.class.php +14 −0 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/FrozenFields/FrozenFieldsDao.php +20 −1 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/FrozenFields/FrozenFieldsFactory.php +17 −32 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/FrozenFields/FrozenFieldsRetriever.php +51 −1 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/HiddenFieldsets/HiddenFieldsetsDao.php +20 −1 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/HiddenFieldsets/HiddenFieldsetsFactory.php +16 −35 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/HiddenFieldsets/HiddenFieldsetsRetriever.php +49 −2 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/PostActionSubFactories.class.php +14 −5 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/PostActionSubFactory.class.php +8 −5 Go to diff View file
M plugins/tracker/include/Workflow/PostAction/Transition_PostActionFactory.class.php +11 −8 Go to diff View file
M plugins/tracker/include/Workflow/SimpleMode/TransitionReplicatorBuilder.php +2 −8 Go to diff View file
M plugins/tracker/include/Workflow/Transition.class.php +1 −2 Go to diff View file
M plugins/tracker/include/Workflow/TransitionFactory.class.php +62 −73 Go to diff View file
M plugins/tracker/include/Workflow/WorkflowFactory.class.php +22 −35 Go to diff View file
M plugins/tracker/include/Workflow/Workflow_TransitionDao.class.php +3 −3 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Workflow/PostAction/FrozenFields/FrozenFieldsFactoryTest.php +11 −27 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Workflow/PostAction/FrozenFields/FrozenFieldsRetrieverTest.php +41 −11 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Workflow/PostAction/HiddenFieldsets/HiddenFieldsetsFactoryTest.php +16 −27 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Workflow/PostAction/HiddenFieldsets/HiddenFieldsetsRetrieverTest.php +47 −7 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Workflow/TransitionFactoryTest.php +34 −13 Go to diff View file
M plugins/tracker/tests/unit/TrackerTest.php +3 −3 Go to diff View file
M plugins/tracker/tests/unit/Workflow/PostAction/CIBuild/Transition_PostAction_CIBuildFactoryTest.php +43 −4 Go to diff View file
M plugins/tracker/tests/unit/Workflow/PostAction/Field/Transition_PostAction_FieldFactoryTest.php +24 −1 Go to diff View file
M plugins/tracker/tests/unit/Workflow/TransitionFactoryTest.php +9 −5 Go to diff View file