stable

Clone or download

Read-only

Warn project admins that GitLab credentials are invalid

Revoke the access token used by Tuleap to access to a GitLab repository. Push a commit (or create/update a merge request) in the repository. => a comment is not added => an email is sent to every git administrators of every projects that have the given repository integrated This email is sent only for the first GitLab event. If you repush a comment or re-create/update a merge request, then no additional notification will be sent, until the token is renewed and rexpired again. Note: only project administrators are warned for now. Furthermore, the message content is quite minimal, no fancy html. Part of story #17182: reference tuleap artifacts in gitlab merge requests Change-Id: I96e36302d7e5f1b74a3b85b35509f46bdcc80541

Modified Files

Name
M plugins/gitlab/composer.json +5 −0 Go to diff View file
M plugins/gitlab/db/install.sql +2 −1 Go to diff View file
A plugins/gitlab/db/mysql/2021/202101261555_add_is_email_already_send_for_invalid_token_column.php +46 −0 Go to diff View file
M plugins/gitlab/include/API/Credentials.php +4 −4 Go to diff View file
M plugins/gitlab/include/API/GitlabHTTPClientFactory.php +1 −1 Go to diff View file
M plugins/gitlab/include/REST/v1/BotApiTokenUpdater.php +5 −1 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabRepositoryResource.php +2 −1 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryCreator.php +1 −1 Go to diff View file
A plugins/gitlab/include/Repository/Token/GitlabBotApiToken.php +66 −0 Go to diff View file
M plugins/gitlab/include/Repository/Token/GitlabBotApiTokenDao.php +21 −3 Go to diff View file
M plugins/gitlab/include/Repository/Token/GitlabBotApiTokenRetriever.php +7 −5 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/Bot/CommentSender.php +26 −8 Go to diff View file
A plugins/gitlab/include/Repository/Webhook/Bot/InvalidCredentialsNotifier.php +124 −0 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostMergeRequest/PostMergeRequestBotCommenter.php +1 −0 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushCommitBotCommenter.php +1 −0 Go to diff View file
M plugins/gitlab/include/gitlabPlugin.php +36 −10 Go to diff View file
M plugins/gitlab/tests/unit/API/ClientWrapperTest.php +5 −5 Go to diff View file
M plugins/gitlab/tests/unit/API/GitlabProjectBuilderTest.php +3 −2 Go to diff View file
M plugins/gitlab/tests/unit/REST/v1/BotApiTokenUpdaterTest.php +4 −4 Go to diff View file
M plugins/gitlab/tests/unit/REST/v1/WebhookSecretGeneratorTest.php +4 −5 Go to diff View file
M plugins/gitlab/tests/unit/Repository/GitlabRepositoryCreatorTest.php +6 −5 Go to diff View file
M plugins/gitlab/tests/unit/Repository/GitlabRepositoryDeletorTest.php +2 −3 Go to diff View file
A plugins/gitlab/tests/unit/Repository/Token/GitlabBotApiTokenTest.php +54 −0 Go to diff View file
A plugins/gitlab/tests/unit/Repository/Webhook/Bot/CommentSenderTest.php +123 −0 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/Bot/CredentialsRetrieverTest.php +4 −3 Go to diff View file
A plugins/gitlab/tests/unit/Repository/Webhook/Bot/InvalidCredentialsNotifierTest.php +210 −0 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostMergeRequest/PostMergeRequestBotCommenterTest.php +5 −5 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushCommitBotCommenterTest.php +5 −5 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/WebhookCreatorTest.php +45 −38 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/WebhookDeletorTest.php +2 −2 Go to diff View file
A plugins/gitlab/tests/unit/Test/Builder/CredentialsTestBuilder.php +69 −0 Go to diff View file