stable

Clone or download

Read-only

Each GitLab integration is unique

This is part of story #17183 close artifacts from commit messages A forgeupgrade has been added to move all the integration data in one table to have each integration unique (repository data + webhook + project). Each commit, tag and MR info must be duplicated for each integration of the GitLab repository Old tables are not removed, they will be purged (if necessary) once all is OK. What is done ? -------------- * REST route GET projects/:id/gitlab_repository uses the new SQL tables * Creation of the integration uses the new SQL tables * Deletion of the integration uses the new SQL tables * Edit integration API Token * Regenerate Webhook Secret * New webhook endpoint deals with Commit events * New webhook endpoint deals with Tag events * New webhook endpoint deals with MR events * Old webhook endpoint is able to do all the actions as previously done * Notifications are sent if needed What is new ? ------------- The big change is about the webhook configuration regeneration. When a regeneration is done for an integration, the will delete in all the case the webhook configuration on GitLab side and other intergrations of this same GitLab repository will need to be reconfigured. A visual warning is added to show that these integrations must regenerate their webhook configuration. Change-Id: If7be2225db1435dc83fac11a840247c559af9dc4

Modified Files

Name
M plugins/git/scripts/repositories/po/fr.po +3 −0 Go to diff View file
M plugins/git/scripts/repositories/src/components/GitRepository.vue +9 −1 Go to diff View file
M plugins/git/scripts/repositories/src/components/GitlabModal/CreateGitlabLinkModal/ListRepositoriesModal.test.ts +2 −0 Go to diff View file
M plugins/git/scripts/repositories/src/components/GitlabModal/EditAccessTokenGitlabModal/ConfirmReplaceTokenModal.test.ts +4 −4 Go to diff View file
M plugins/git/scripts/repositories/src/components/GitlabModal/EditAccessTokenGitlabModal/ConfirmReplaceTokenModal.vue +2 −3 Go to diff View file
M plugins/git/scripts/repositories/src/components/GitlabModal/RegenerateGitlabWebhookModal/RegenerateGitlabWebhook.test.ts +6 −4 Go to diff View file
M plugins/git/scripts/repositories/src/components/GitlabModal/RegenerateGitlabWebhookModal/RegenerateGitlabWebhook.vue +4 −3 Go to diff View file
M plugins/git/scripts/repositories/src/components/GitlabModal/UnlinkGitlabRepositoryModal/UnlinkRepositoryGitlabModal.vue +1 −3 Go to diff View file
M plugins/git/scripts/repositories/src/gitlab/gitlab-api-querier.test.ts +6 −10 Go to diff View file
M plugins/git/scripts/repositories/src/gitlab/gitlab-api-querier.ts +5 −8 Go to diff View file
M plugins/git/scripts/repositories/src/gitlab/gitlab-checker.test.ts +47 −1 Go to diff View file
M plugins/git/scripts/repositories/src/gitlab/gitlab-checker.ts +12 −0 Go to diff View file
M plugins/git/scripts/repositories/src/gitlab/gitlab-repository-formatter.ts +1 −0 Go to diff View file
M plugins/git/scripts/repositories/src/store/gitlab/actions.test.ts +4 −6 Go to diff View file
M plugins/git/scripts/repositories/src/store/gitlab/actions.ts +2 −3 Go to diff View file
M plugins/git/scripts/repositories/src/type.ts +9 −2 Go to diff View file
M plugins/git/themes/BurningParrot/repositories/_gitlab.scss +5 −0 Go to diff View file
M plugins/gitlab/db/install.sql +19 −24 Go to diff View file
A plugins/gitlab/db/mysql/2021/202105171414_each_repository_integration_is_unique.php +380 −0 Go to diff View file
M plugins/gitlab/db/uninstall.sql +6 −7 Go to diff View file
M plugins/gitlab/include/REST/v1/BotApiTokenUpdater.php +3 −17 Go to diff View file
M plugins/gitlab/include/REST/v1/ConcealedBotApiTokenPatchRepresentation.php +3 −10 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabProjectResource.php +14 −2 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabRepositoryBotApiTokenPatchRepresentation.php +2 −7 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabRepositoryRepresentation.php +29 −7 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabRepositoryResource.php +28 −36 Go to diff View file
M plugins/gitlab/include/REST/v1/GitlabRepositoryWebhookSecretPatchRepresentation.php +1 −6 Go to diff View file
M plugins/gitlab/include/REST/v1/WebhookSecretGenerator.php +3 −17 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepository.php +30 −7 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryCreator.php +16 −64 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryDao.php +53 −35 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryDeletor.php +18 −50 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryFactory.php +45 −12 Go to diff View file
M plugins/gitlab/include/Repository/GitlabRepositoryWebhookController.php +26 −28 Go to diff View file
A plugins/gitlab/include/Repository/IntegrationWebhookController.php +139 −0 Go to diff View file
M plugins/gitlab/include/Repository/Project/GitlabRepositoryProjectDao.php +6 −42 Go to diff View file
D plugins/gitlab/include/Repository/Project/GitlabRepositoryProjectRetriever.php +0 −62 Go to diff View file
M plugins/gitlab/include/Repository/Token/GitlabBotApiTokenDao.php +13 −13 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/Bot/InvalidCredentialsNotifier.php +34 −48 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostMergeRequest/CrossReferenceFromMergeRequestCreator.php +19 −30 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostMergeRequest/MergeRequestTuleapReferenceDao.php +13 −13 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostMergeRequest/PostMergeRequestWebhookActionProcessor.php +14 −26 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostMergeRequest/PreviouslySavedReferencesRetriever.php +2 −2 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/Commits/CommitTuleapReferenceDao.php +11 −11 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushCommitArtifactUpdater.php +2 −2 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushWebhookActionProcessor.php +34 −54 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/PostPush/PostPushWebhookCloseArtifactHandler.php +3 −3 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/TagPush/TagInfoDao.php +14 −14 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/TagPush/TagPushWebhookActionProcessor.php +6 −6 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/TagPush/TagPushWebhookCreateAction.php +36 −49 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/TagPush/TagPushWebhookDeleteAction.php +16 −24 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/WebhookCreator.php +2 −1 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/WebhookDao.php +30 −11 Go to diff View file
M plugins/gitlab/include/Repository/Webhook/WebhookDeletor.php +13 −3 Go to diff View file
D plugins/gitlab/include/Repository/Webhook/WebhookRepositoryRetriever.php +0 −64 Go to diff View file
M plugins/gitlab/include/gitlabPlugin.php +151 −16 Go to diff View file
M plugins/gitlab/site-content/fr_FR/LC_MESSAGES/tuleap-gitlab.po +3 −0 Go to diff View file
M plugins/gitlab/tests/rest/DatabaseInitialization.php +3 −7 Go to diff View file
M plugins/gitlab/tests/rest/Gitlab/ProjectTest.php +15 −13 Go to diff View file
M plugins/gitlab/tests/unit/REST/v1/BotApiTokenUpdaterTest.php +18 −106 Go to diff View file
M plugins/gitlab/tests/unit/REST/v1/WebhookSecretGeneratorTest.php +34 −122 Go to diff View file
M plugins/gitlab/tests/unit/Reference/GitlabCrossReferenceOrganizerTest.php +27 −9 Go to diff View file
M plugins/gitlab/tests/unit/Reference/GitlabReferenceBuilderTest.php +9 −3 Go to diff View file
M plugins/gitlab/tests/unit/Repository/GitlabRepositoryCreatorTest.php +17 −77 Go to diff View file
M plugins/gitlab/tests/unit/Repository/GitlabRepositoryDeletorTest.php +22 −102 Go to diff View file
M plugins/gitlab/tests/unit/Repository/GitlabRepositoryFactoryTest.php +16 −8 Go to diff View file
M plugins/gitlab/tests/unit/Repository/GitlabRepositoryTest.php +4 −2 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/Bot/CommentSenderTest.php +3 −1 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/Bot/InvalidCredentialsNotifierTest.php +25 −64 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostMergeRequest/CrossReferenceFromMergeRequestCreatorTest.php +23 −61 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostMergeRequest/PostMergeRequestWebhookActionProcessorTest.php +38 −101 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostMergeRequest/PostMergeRequestWebhookAuthorDataRetrieverTest.php +7 −2 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostMergeRequest/PreviouslySavedReferencesRetrieverTest.php +16 −5 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushCommitArtifactUpdaterTest.php +41 −4 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushTuleapArtifactCommentBuilderTest.php +52 −5 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushWebhookActionProcessorTest.php +19 −47 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/PostPush/PostPushWebhookCloseArtifactHandlerTest.php +67 −6 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/Secret/SecretCheckerTest.php +4 −1 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/TagPush/TagPushWebhookActionProcessorTest.php +10 −3 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/TagPush/TagPushWebhookCreateActionTest.php +18 −35 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/TagPush/TagPushWebhookDeleteActionTest.php +6 −69 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/WebhookActionsTest.php +4 −1 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/WebhookCreatorTest.php +120 −4 Go to diff View file
M plugins/gitlab/tests/unit/Repository/Webhook/WebhookDeletorTest.php +74 −0 Go to diff View file
D plugins/gitlab/tests/unit/Repository/Webhook/WebhookRepositoryRetrieverTest.php +0 −110 Go to diff View file