stable

Clone or download

Read-only

Merging a pull request does not close referenced artifacts

closes request #27883 Merging a pull request does not close referenced artifacts This patch refactors both the way pull request and git commit author are retrieved when we close an artifact - changesets are done by workflow manager - as author can be forged or not found on tuleap side, permissions are not checked, we only check that project is still accessible - author email is deducted from git commit (for every commit), when we don't find user, like in gitlab, we'll display the author name Change-Id: I9adabc7a59f4f5647f493da7d1ca6f37111d24ff

Modified Files

Name
A plugins/git/include/CommitMetadata/AuthorRetriever.php +47 −0 Go to diff View file
A plugins/git/include/CommitMetadata/RetrieveAuthor.php +30 −0 Go to diff View file
M plugins/git/include/Git_Exec.class.php +22 −0 Go to diff View file
M plugins/git/include/Hook/Asynchronous/DefaultBranchPushProcessorBuilder.php +4 −1 Go to diff View file
M plugins/git/include/Hook/Asynchronous/GitRepositoryRetriever.php +15 −21 Go to diff View file
M plugins/git/include/Hook/DefaultBranchPush/DefaultBranchPushProcessor.php +5 −2 Go to diff View file
M plugins/git/include/gitPlugin.php +0 −1 Go to diff View file
A plugins/git/tests/unit/CommitMetadata/AuthorRetrieverTest.php +92 −0 Go to diff View file
M plugins/git/tests/unit/Git_ExecTest.php +43 −12 Go to diff View file
M plugins/git/tests/unit/Hook/Asynchronous/AsynchronousEventHandlerTest.php +4 −1 Go to diff View file
M plugins/git/tests/unit/Hook/Asynchronous/GitRepositoryRetrieverTest.php +18 −26 Go to diff View file
M plugins/git/tests/unit/Hook/DefaultBranchPush/DefaultBranchPushProcessorTest.php +12 −2 Go to diff View file
A plugins/git/tests/unit/Stub/RetrieveAuthorStub.php +46 −0 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushBadSemanticComment.php +2 −1 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushWebhookCloseArtifactHandler.php +4 −3 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushBadSemanticCommentTest.php +4 −3 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Closure/ArtifactClosingReferencesHandler.php +9 −7 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Closure/BadSemanticComment.php +5 −3 Go to diff View file
M plugins/tracker/tests/unit/Artifact/Closure/ArtifactClosingReferencesHandlerTest.php +12 −9 Go to diff View file
M plugins/tracker/tests/unit/Artifact/Closure/BadSemanticCommentTest.php +2 −1 Go to diff View file
M src/common/Event/Events/PotentialReferencesReceived.php +0 −1 Go to diff View file
M src/common/Reference/TextWithPotentialReferences.php +3 −0 Go to diff View file
R plugins/gitlab/include/Repository/Webhook/PostPush/UserClosingTheArtifact.php Go to diff View file
R plugins/gitlab/tests/unit/Repository/Webhook/PostPush/UserClosingTheArtifactTest.php Go to diff View file