stable

Clone or download

Read-only

Deal with closes artifact closure keyword

This is part of story #17183 close artifacts from commit messages The behaviour must be the same as the one done for "resolves". When the keyword "closes", followed by a Tuleap reference is found, then the provided artifact will be closed with a comment : * If the artifact is found * If the artifact is in a project the GitLab repository is integrated in Both keywords without an S (close and resolve) are no more taken into account. How to test: - Have 2 projects: => 1 with a GitLab repository integrated (Project A) => 1 without any GitLab repository (Project B) - Have 5 artifacts: => One open in project A (art #11) => One open in project A (art #12) => One closed in project A (art #13) => One without any status semantic in project A (art #14) => One open in project B (art #666) - Commit with a message like: "close TULEAP-11 closes TULEAP-12 closes TULEAP-13 closes TULEAP-14 closes TULEAP-666" Expected results: - art #11 should not be closed - art #12 should be closed with a new follow-up "closed by @user with gitlab_commit #namespace/myRepo/ab686" - art #13 should be still closed, without any follow-up but there is a log in gilab_syslog "artifact #14 already closed, can not be closed by gitlab commit" - art #14 should be stilled open, with a new follow-up "attempts to close this artifact from GitLab but no status semantic defined." - art #666 is still opened, there is no new follow-up Change-Id: I8ecc598676ec041cf127278a0f150a924898ead3

Modified Files

Name
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushTuleapArtifactCommentBuilder.php +10 −2 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/WebhookTuleapReferencesParser.php +9 −6 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushCommitArtifactUpdaterTest.php +3 −3 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushTuleapArtifactCommentBuilderTest.php +12 −3 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/WebhookTuleapReferencesParserTest.php +91 −15 Go to diff View file