stable

Clone or download

Read-only

Create REST endpoint to integrate a GitLab repository

This is part of story #17178 reference my gitlab repositories in my tuleap project A new REST endpoint is now available: POST gitlab_repository. The expected JSON body content must be like: { "project_id": 122, "gitlab_server_url" : "https://example.com", "gitlab_user_api_token" : "my_token", "gitlab_internal_id" : 145896 } If this is the first time the GitLab repository is integrated, then the whole intgeration process is done: * Add data in repository table * Add integration in project * Create a secret for the repository * Add a new post push webhook in the GitLab project. If this GitLab repository is already integrated in at least one Tuleap project, then only a new entry in repository_project table is added. Change-Id: Ia195fbd6844235e67a022c4f410f86771b09e457

Modified Files

Name
A plugins/gitlab/include/API/ClientWrapper.php +128 −0 Go to diff View file
A plugins/gitlab/include/API/Credentials.php +53 −0 Go to diff View file
A plugins/gitlab/include/API/GitlabHTTPClientFactory.php +51 −0 Go to diff View file
A plugins/gitlab/include/API/GitlabProject.php +108 −0 Go to diff View file
A plugins/gitlab/include/API/GitlabProjectBuilder.php +93 −0 Go to diff View file
A plugins/gitlab/include/API/GitlabRequestException.php +46 −0 Go to diff View file
A plugins/gitlab/include/API/GitlabResponseAPIException.php +29 −0 Go to diff View file
A plugins/gitlab/include/REST/v1/GitlabRepositoryPOSTRepresentation.php +62 −0 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabRepositoryResource.php +129 −7 Go to diff View file
A plugins/gitlab/include/Repository/GitlabRepositoryAlreadyIntegratedInProjectException.php +30 −0 Go to diff View file
A plugins/gitlab/include/Repository/GitlabRepositoryCreator.php +164 −0 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryDao.php +21 −0 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryFactory.php +16 −0 Go to diff View file
M plugins/gitlab/include/Repository/Project/GitlabRepositoryProjectDao.php +23 −0 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/Secret/SecretDao.php +11 −0 Go to diff View file
A plugins/gitlab/include/Repository/Webhook/Secret/SecretGenerator.php +62 −0 Go to diff View file
A plugins/gitlab/include/Repository/Webhook/WebhookCreator.php +75 −0 Go to diff View file
A plugins/gitlab/tests/unit/API/GitlabProjectBuilderTest.php +227 −0 Go to diff View file
A plugins/gitlab/tests/unit/Repository/GitlabRepositoryCreatorTest.php +216 −0 Go to diff View file