stable

Clone or download

Read-only

refactor: Create dedicated objects to retrieve pull request and pull request with its git reference

Part of story #32316 Update comments The object which retrieves the user's accessible pull request is needed to build the comment representation returned by `PATCH pull_request_comment/:id`. It will be done after, in a dedicated patch PullRequestWithGitReferenceRetriever is not needed after but I took the oportunity to create it and add missing unit test No functionnal change expected in REST route Change-Id: I38e26868168b5958cab4db90682dcf000932acfd

Modified Files

Name
M plugins/git/include/GitRepositoryFactory.class.php +4 −2 Go to diff View file
A plugins/git/include/RetrieveGitRepository.php +30 −0 Go to diff View file
M plugins/git/tests/unit/GitForkRepositoriesTest.php +2 −3 Go to diff View file
M plugins/git/tests/unit/Hook/Asynchronous/AsynchronousEventHandlerTest.php +2 −2 Go to diff View file
M plugins/git/tests/unit/Hook/Asynchronous/DefaultBranchPushParserTest.php +1 −1 Go to diff View file
A plugins/git/tests/unit/Stub/Hook/Asynchronous/RetrieveGitRepositoryStub.php +53 −0 Go to diff View file
M plugins/git/tests/unit/Stub/RetrieveGitRepositoryStub.php +12 −17 Go to diff View file
A plugins/pullrequest/include/PullRequest/GitReference/GetReferenceByPullRequestId.php +31 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/GitReference/GitPullRequestReferenceDAO.php +2 −5 Go to diff View file
M plugins/pullrequest/include/PullRequest/GitReference/GitPullRequestReferenceRetriever.php +1 −7 Go to diff View file
M plugins/pullrequest/include/PullRequest/GitReference/GitPullRequestReferenceUpdater.php +2 −2 Go to diff View file
A plugins/pullrequest/include/PullRequest/GitReference/UpdateGitPullRequestReference.php +41 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/REST/v1/AccessiblePullRequestRESTRetriever.php +66 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/FaultMapper.php +2 −1 Go to diff View file
A plugins/pullrequest/include/PullRequest/REST/v1/PullRequestWithGitReferenceRetriever.php +101 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestsResource.php +63 −110 Go to diff View file
A plugins/pullrequest/tests/unit/Builders/GitPullRequestReferenceTestBuilder.php +56 −0 Go to diff View file
M plugins/pullrequest/tests/unit/Builders/PullRequestTestBuilder.php +6 −0 Go to diff View file
A plugins/pullrequest/tests/unit/REST/v1/AccessiblePullRequestRESTRetrieverTest.php +115 −0 Go to diff View file
M plugins/pullrequest/tests/unit/REST/v1/Comment/PATCHCommentHandlerTest.php +1 −1 Go to diff View file
A plugins/pullrequest/tests/unit/REST/v1/PullRequestWithGitReferenceRetrieverTest.php +179 −0 Go to diff View file
M plugins/pullrequest/tests/unit/Stub/CheckUserCanAccessPullRequestStub.php +1 −1 Go to diff View file
A plugins/pullrequest/tests/unit/Stub/GetReferenceByPullRequestIdStub.php +64 −0 Go to diff View file
A plugins/pullrequest/tests/unit/Stub/UpdateGitPullRequestReferenceStub.php +57 −0 Go to diff View file