stable

Clone or download

Read-only

POST baselines/comparison

Part of epic #12142 Baseline v1 POST baselines/comparison with following body: { name: "comparison name", comment: "comparison comment", base_baseline_id: 3, compared_to_baseline_id: 4 } All attributes are mandatory except comment. ==> respond 201 ==> respond 401 if not authenticated ==> respond 403 if not authorized. Authorized users are: - super admin - admin on baselines project - has BASELINE_ADMIN role ==> respond 404 if no baseline match with id base_baseline_id or compared_to_baseline_id. ==> respond 404 if baseline which id matches with base_baseline_id or compared_to_baseline_id is not authorized for current user. ==> respond 400 if baselines are not on same artifact Change-Id: I5ac09eb2e9ea3540965a2fcef83d870fec291519

Modified Files

Name
M db/install.sql +11 −1 Go to diff View file
M db/uninstall.sql +1 −0 Go to diff View file
M doc/data_model.graphml +151 −90 Go to diff View file
M doc/data_model.png Binary file Go to diff View file
A include/Adapter/ComparisonRepositoryAdapter.php +80 −0 Go to diff View file
M include/Domain/BaselineArtifact.php +5 −0 Go to diff View file
A include/Domain/Comparison.php +46 −0 Go to diff View file
A include/Domain/ComparisonRepository.php +34 −0 Go to diff View file
A include/Domain/ComparisonService.php +61 −0 Go to diff View file
A include/Domain/InvalidComparisonException.php +31 −0 Go to diff View file
A include/Domain/TransientComparison.php +74 −0 Go to diff View file
M include/REST/BaselineRestResourcesInjector.php +1 −0 Go to diff View file
A include/REST/ComparisonController.php +102 −0 Go to diff View file
A include/REST/ComparisonRepresentation.php +70 −0 Go to diff View file
A include/REST/ComparisonsResource.php +84 −0 Go to diff View file
M include/Support/ContainerBuilderFactory.php +3 −0 Go to diff View file
A phpunit/Adapter/ComparisonRepositoryAdapterTest.php +111 −0 Go to diff View file
A phpunit/Domain/ComparisonServiceTest.php +73 −0 Go to diff View file
M phpunit/Factory/BaselineArtifactFactory.php +3 −1 Go to diff View file
A phpunit/Factory/TransientComparisonBuilder.php +76 −0 Go to diff View file
A phpunit/Factory/TransientComparisonFactory.php +56 −0 Go to diff View file
A phpunit/REST/ComparisonControllerIntTest.php +115 −0 Go to diff View file
M phpunit/REST/IntegrationTestCaseWithStubs.php +9 −2 Go to diff View file
M phpunit/Stub/BaselineRepositoryStub.php +3 −0 Go to diff View file
A phpunit/Stub/ComparisonRepositoryStub.php +66 −0 Go to diff View file
M site-content/fr_FR/LC_MESSAGES/tuleap-baseline.po +16 −2 Go to diff View file
M tests/rest/BaselinesResourceTest.php +30 −0 Go to diff View file