stable

Clone or download

Read-only

feat: add REST route to create a GitLab merge request

This is part of story #26801 create a merge request from artifact A new REST route is now available to create a merge request into GitLab based on an artifact and an integration. The payload must be like: { "gitlab_integration_id": 1, "artifact_id": 123, "reference": "main" } The token used to perform the GitLab API POST request is the one stored for the integration. The merge request target branch will always be the GitLab repository default branch. The merge request title will always be with the following pattern: "TULEAP-{artifact_id}: {artifact_title}" Change-Id: I10cf3972d2a056bcc5bac503b70edb9857943ed9

Modified Files

Name
A plugins/gitlab/include/Artifact/MergeRequestTitleCreatorFromArtifact.php +49 −0 Go to diff View file
M plugins/gitlab/include/REST/ResourcesInjector.php +2 −0 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabBranchResource.php +1 −1 Go to diff View file
A plugins/gitlab/include/REST/v1/GitlabMergeRequestCreator.php +128 −0 Go to diff View file
A plugins/gitlab/include/REST/v1/GitlabMergeRequestPOSTRepresentation.php +57 −0 Go to diff View file
A plugins/gitlab/include/REST/v1/GitlabMergeRequestResource.php +131 −0 Go to diff View file
A plugins/gitlab/tests/unit/Artifact/MergeRequestTitleCreatorFromArtifactTest.php +76 −0 Go to diff View file
A plugins/gitlab/tests/unit/REST/v1/GitlabMergeRequestCreatorTest.php +533 −0 Go to diff View file