stable

Clone or download

Read-only

Validate more strictly Post Action data

Part of story #12187 configure workflow pre & post actions at target state level How to test: Try to create invalid CI Build post actions: call PUT /tracker_workflow_transitions/:id/actions with Api Explorer with body: { "post_actions": [ { "id": null, "type": "run_job", "job_url": "" } ] } - You should get an error because "job_url" cannot be an invalid URL. with body: { "post_actions": [ { "id": 100000, "type": "run_job", "job_url": "https://example.com" } ]} - Assuming there is no row with id 100000 in table tracker_workflow_transition_postactions_cibuild, you should get an error because the ID is unknown with body: { "post_actions": [ { "id": 1, "type": "run_job", "job_url": "https://example.com" }, { "id": 1, "type": "run_job", "job_url": "https://example.com/2" } ]} - Assuming there is a row with id 1 in the DB, you should get an error because the ID 1 is duplicate for "run_job" type. Change-Id: I3b8d468a9cd9f1229e57d7d759736ed2ce6f4b6f

Modified Files

Name
M plugins/tracker/include/REST/v1/Workflow/TransitionsResource.class.php +25 −2 Go to diff View file
M plugins/tracker/include/workflow/PostAction/CIBuild/Transition_PostAction_CIBuild.class.php +5 −9 Go to diff View file
M plugins/tracker/include/workflow/PostAction/Update/Internal/CIBuildRepository.php +2 −3 Go to diff View file
M plugins/tracker/include/workflow/PostAction/Update/Internal/CIBuildUpdater.php +12 −3 Go to diff View file
A plugins/tracker/include/workflow/PostAction/Update/Internal/CIBuildValidator.php +89 −0 Go to diff View file
A plugins/tracker/include/workflow/PostAction/Update/Internal/DuplicateCIBuildPostAction.php +25 −0 Go to diff View file
A plugins/tracker/include/workflow/PostAction/Update/Internal/InvalidCIBuildPostActionException.php +25 −0 Go to diff View file
A plugins/tracker/include/workflow/PostAction/Update/Internal/PostActionIdCollection.php +41 −0 Go to diff View file
M plugins/tracker/include/workflow/PostAction/Update/Internal/PostActionUpdater.php +3 −0 Go to diff View file
A plugins/tracker/include/workflow/PostAction/Update/Internal/UnknownPostActionIdsException.php +40 −0 Go to diff View file
M plugins/tracker/include/workflow/PostAction/Update/PostActionCollection.php +31 −36 Go to diff View file
M plugins/tracker/include/workflow/PostAction/Update/PostActionCollectionUpdater.php +6 −0 Go to diff View file
R plugins/tracker/phpunit/Workflow/PostAction/Update/Internal/CIBuildRepositoryTest.php Go to diff View file
R plugins/tracker/phpunit/Workflow/PostAction/Update/Internal/CIBuildUpdaterTest.php Go to diff View file
A plugins/tracker/phpunit/Tracker/Workflow/PostAction/Update/Internal/CIBuildValidatorTest.php +106 −0 Go to diff View file
A plugins/tracker/phpunit/Tracker/Workflow/PostAction/Update/Internal/PostActionIdCollectionTest.php +45 −0 Go to diff View file
A plugins/tracker/phpunit/Tracker/Workflow/PostAction/Update/PostActionCollectionTest.php +83 −0 Go to diff View file
D plugins/tracker/phpunit/Workflow/PostAction/Update/PostActionCollectionTest.php +0 −49 Go to diff View file
M plugins/tracker/site-content/fr_FR/LC_MESSAGES/tuleap-tracker.po +13 −3 Go to diff View file
M plugins/tracker/site-content/tuleap-tracker.pot +10 −0 Go to diff View file