From 8b8338b32ba97cc2a0d518ee0bff0b8105bf95b0 Mon Sep 17 00:00:00 2001 From: yashin Date: Wed, 27 Jun 2018 18:20:12 +0800 Subject: [PATCH] gitlab rename to gitee --- README.md | 2 +- pom.xml | 58 ++++---- src/docker/docker-compose.yml | 12 +- .../GiteePushTrigger.java} | 122 ++++++++-------- .../cause/CauseData.java | 4 +- .../cause/GiteeWebHookCause.java | 2 +- .../connection/GiteeApiToken.java} | 10 +- .../connection/GiteeApiTokenImpl.java} | 6 +- .../connection/GiteeConnection.java} | 42 +++--- .../connection/GiteeConnectionConfig.java} | 42 +++--- .../connection/GiteeConnectionProperty.java} | 22 +-- .../GiteeEnvironmentContributor.java} | 6 +- .../gitee}/JacksonConfig.java | 2 +- .../gitee/api/GiteeClient.java} | 8 +- .../gitee/api/GiteeClientBuilder.java} | 18 +-- .../impl/AutodetectGiteeClientBuilder.java | 29 ++++ .../api/impl/AutodetectingGiteeClient.java} | 112 +++++++-------- .../gitee/api/impl/GiteeApiProxy.java} | 8 +- .../gitee/api/impl/ResteasyGiteeClient.java} | 14 +- .../api/impl/ResteasyGiteeClientBuilder.java} | 30 ++-- .../gitee/api/impl/V3GiteeApiProxy.java} | 10 +- .../gitee/api/impl/V3GiteeClientBuilder.java} | 10 +- .../gitee/api/impl/V4GiteeApiProxy.java} | 10 +- .../gitee/api/impl/V4GiteeClientBuilder.java} | 10 +- .../gitee}/api/model/Branch.java | 2 +- .../gitee}/api/model/BuildState.java | 2 +- .../gitee}/api/model/Commit.java | 2 +- .../gitee}/api/model/Label.java | 2 +- .../gitee}/api/model/MergeRequest.java | 4 +- .../gitee}/api/model/Namespace.java | 2 +- .../gitee}/api/model/Note.java | 2 +- .../gitee}/api/model/Pipeline.java | 2 +- .../gitee}/api/model/Project.java | 2 +- .../gitee}/api/model/User.java | 2 +- .../gitee}/hook/model/Action.java | 2 +- .../gitee}/hook/model/BranchData.java | 2 +- .../gitee}/hook/model/Commit.java | 2 +- .../gitee}/hook/model/MergeRequestHook.java | 2 +- .../gitee}/hook/model/MergeRequestLabel.java | 2 +- .../model/MergeRequestObjectAttributes.java | 3 +- .../gitee}/hook/model/NoteHook.java | 2 +- .../hook/model/NoteObjectAttributes.java | 2 +- .../model/PipelineEventObjectAttributes.java | 2 +- .../gitee}/hook/model/PipelineHook.java | 2 +- .../gitee}/hook/model/Project.java | 2 +- .../gitee}/hook/model/PushHook.java | 2 +- .../gitee}/hook/model/Repository.java | 2 +- .../gitee}/hook/model/State.java | 2 +- .../gitee}/hook/model/User.java | 2 +- .../gitee}/hook/model/WebHook.java | 2 +- .../GiteeBuildDescriptionRunListener.java} | 12 +- .../GiteeAcceptMergeRequestPublisher.java} | 14 +- .../GiteeCommitStatusPublisher.java} | 14 +- .../publisher/GiteeMessagePublisher.java} | 22 +-- .../publisher/GiteeVotePublisher.java} | 14 +- .../publisher/MergeRequestNotifier.java | 14 +- .../service/GiteeProjectBranchesService.java} | 32 ++--- .../service/GiteeProjectLabelsService.java} | 28 ++-- .../trigger/TriggerOpenMergeRequest.java | 2 +- .../trigger/branch/AntPathMatcherSet.java | 2 +- .../branch/ProjectBranchesProvider.java | 16 +-- .../exception/NoRevisionToBuildException.java | 2 +- .../trigger/filter/AllBranchesFilter.java | 2 +- .../trigger/filter/BranchFilter.java | 2 +- .../trigger/filter/BranchFilterConfig.java | 2 +- .../trigger/filter/BranchFilterFactory.java | 2 +- .../trigger/filter/BranchFilterType.java | 2 +- .../filter/MergeRequestLabelFilter.java | 2 +- .../filter/MergeRequestLabelFilterConfig.java | 2 +- .../MergeRequestLabelFilterFactory.java | 2 +- .../filter/MergeRequestLabelFilterImpl.java | 2 +- .../trigger/filter/NameBasedFilter.java | 2 +- .../filter/NopMergeRequestLabelFilter.java | 2 +- .../trigger/filter/RegexBasedFilter.java | 2 +- .../AbstractWebHookTriggerHandler.java | 24 ++-- .../trigger/handler/PendingBuildsHandler.java | 26 ++-- .../handler/WebHookTriggerHandler.java | 14 ++ .../merge/MergeRequestHookTriggerHandler.java | 9 ++ ...MergeRequestHookTriggerHandlerFactory.java | 8 +- .../MergeRequestHookTriggerHandlerImpl.java | 33 +++-- .../NopMergeRequestHookTriggerHandler.java | 8 +- .../note/NopNoteHookTriggerHandler.java | 8 +- .../handler/note/NoteHookTriggerHandler.java | 9 ++ .../note/NoteHookTriggerHandlerFactory.java | 2 +- .../note/NoteHookTriggerHandlerImpl.java | 18 +-- .../NopPipelineHookTriggerHandler.java | 17 +++ .../pipeline/PipelineHookTriggerHandler.java | 9 ++ .../PipelineHookTriggerHandlerFactory.java | 4 +- .../PipelineHookTriggerHandlerImpl.java | 36 ++--- .../push/NopPushHookTriggerHandler.java | 8 +- ...penMergeRequestPushHookTriggerHandler.java | 52 +++---- .../handler/push/PushHookTriggerHandler.java | 9 ++ .../push/PushHookTriggerHandlerFactory.java | 4 +- .../push/PushHookTriggerHandlerImpl.java | 20 +-- .../push/PushHookTriggerHandlerList.java | 8 +- .../trigger/label/ProjectLabelsProvider.java | 18 +-- .../util/ACLUtil.java | 2 +- .../util/BuildUtil.java | 2 +- .../util/CommitStatusUpdater.java | 67 +++++---- .../util/JsonUtil.java | 2 +- .../util/LoggerUtil.java | 2 +- .../util/ProjectIdUtil.java | 6 +- .../webhook/ActionResolver.java | 24 ++-- .../webhook/GiteeWebHook.java} | 8 +- .../webhook/WebHookAction.java | 2 +- .../webhook/build/BuildWebHookAction.java | 14 +- .../build/MergeRequestBuildAction.java | 16 +-- .../webhook/build/NoteBuildAction.java | 14 +- .../webhook/build/PipelineBuildAction.java | 12 +- .../webhook/build/PushBuildAction.java | 16 +-- .../status/BranchBuildPageRedirectAction.java | 4 +- .../webhook/status/BranchStatusPngAction.java | 4 +- .../status/BuildPageRedirectAction.java | 4 +- .../webhook/status/BuildStatusAction.java | 4 +- .../status/CommitBuildPageRedirectAction.java | 4 +- .../webhook/status/CommitStatusPngAction.java | 4 +- .../webhook/status/StatusJsonAction.java | 4 +- .../webhook/status/StatusPngAction.java | 2 +- .../AcceptGiteeMergeRequestStep.java} | 26 ++-- .../AddGiteeMergeRequestCommentStep.java} | 26 ++-- .../workflow/GiteeBuildsStep.java} | 20 +-- .../workflow/GiteeCommitStatusStep.java} | 18 +-- .../workflow/PendingBuildsAction.java | 2 +- .../UpdateGiteeCommitStatusStep.java} | 18 +-- .../impl/AutodetectGitLabClientBuilder.java | 29 ---- .../handler/WebHookTriggerHandler.java | 14 -- .../merge/MergeRequestHookTriggerHandler.java | 9 -- .../handler/note/NoteHookTriggerHandler.java | 9 -- .../NopPipelineHookTriggerHandler.java | 19 --- .../pipeline/PipelineHookTriggerHandler.java | 9 -- .../handler/push/PushHookTriggerHandler.java | 9 -- .../GiteeWebHookPollingAction}/index.jelly | 0 .../GiteePushTrigger}/config.jelly | 0 .../GiteePushTrigger}/help.jelly | 0 .../Messages.properties | 0 .../GitLabWebHookCause/description.jelly | 0 .../cause/Messages.properties | 0 .../GitLabApiTokenImpl/credentials.jelly | 0 .../GitLabConnectionConfig/config.jelly | 0 .../GitLabConnectionProperty/config.jelly | 0 .../connection/Messages.properties | 0 .../GiteeCommitStatusPublisher}/config.jelly | 0 .../GiteeMessagePublisher}/config.jelly | 0 .../publisher/Messages.properties | 0 .../webhook/status/failed.png | Bin .../webhook/status/running.png | Bin .../webhook/status/success.png | Bin .../webhook/status/unknown.png | Bin .../webhook/status/unstable.png | Bin .../AcceptGiteeMergeRequestStep}/config.jelly | 0 .../config.jelly | 0 .../workflow/GiteeBuildsStep}/config.jelly | 0 .../GiteeCommitStatusStep}/config.jelly | 0 .../UpdateGiteeCommitStatusStep}/config.jelly | 0 .../GiteeConnectionConfigSSLTest.java} | 12 +- .../GiteeConnectionConfigTest.java} | 46 +++--- .../GiteeEnvironmentContributorTest.java} | 37 ++--- .../gitee/api/GiteeClientBuilderTest.java | 41 ++++++ .../impl/AutodetectingGiteeClientTest.java} | 30 ++-- .../impl/ResteasyGiteeClientBuilderTest.java} | 16 +-- .../gitee}/api/impl/TestUtility.java | 18 +-- ...GiteeAcceptMergeRequestPublisherTest.java} | 12 +- .../GiteeCommitStatusPublisherTest.java} | 38 ++--- .../publisher/GiteeMessagePublisherTest.java} | 16 +-- .../publisher/GiteeVotePublisherTest.java} | 12 +- .../publisher/TestUtility.java | 22 +-- .../service/GiteeClientStub.java} | 12 +- .../GiteeProjectBranchesServiceTest.java} | 16 +-- .../GiteeProjectLabelsServiceTest.java} | 16 +-- .../testhelpers/GiteePushRequestSamples.java} | 6 +- ...teePushRequestSamples_7_10_5_489B413.java} | 12 +- ...iteePushRequestSamples_7_5_1_36679B5.java} | 12 +- ...iteePushRequestSamples_8_1_2_8C8Af7B.java} | 12 +- .../testing/gitee/rule/GiteeRule.java} | 50 ++++--- .../testing/gitee}/rule/ProjectRequest.java | 2 +- .../testing/integration/GiteeIT.java} | 38 ++--- .../trigger/filter/AllBranchesFilterTest.java | 2 +- .../filter/BranchFilterFactoryTest.java | 4 +- .../MergeRequestLabelFilterImplTest.java | 2 +- .../trigger/filter/NameBasedFilterTest.java | 2 +- .../trigger/filter/RegexBasedFilterTest.java | 2 +- .../handler/PendingBuildsHandlerTest.java | 132 +++++++++--------- ...ergeRequestHookTriggerHandlerImplTest.java | 44 +++--- .../note/NoteHookTriggerHandlerImplTest.java | 46 +++--- .../PipelineHookTriggerHandlerImplTest.java | 34 +++-- ...ushHookTriggerHandlerGiteeServerTest.java} | 40 +++--- .../push/PushHookTriggerHandlerImplTest.java | 40 +++--- .../util/BuildUtilTest.java | 4 +- .../util/CommitStatusUpdaterTest.java | 39 +++--- .../util/GiteeClientStub.java} | 12 +- .../util/ProjectIdUtilTest.java | 20 +-- .../webhook/ActionResolverTest.java | 20 +-- .../build/MergeRequestBuildActionTest.java | 28 ++-- .../webhook/build/NoteBuildActionTest.java | 28 ++-- .../build/PipelineBuildActionTest.java | 21 +-- .../webhook/build/PushBuildActionTest.java | 10 +- .../BranchBuildPageRedirectActionTest.java | 2 +- .../status/BranchStatusPngActionTest.java | 2 +- .../status/BuildPageRedirectActionTest.java | 2 +- .../webhook/status/BuildStatusActionTest.java | 2 +- .../CommitBuildPageRedirectActionTest.java | 2 +- .../status/CommitStatusPngActionTest.java | 2 +- .../webhook/status/StatusJsonActionTest.java | 2 +- .../webhook/status/StatusPngActionTest.java | 2 +- .../gitlab/api/GitLabClientBuilderTest.java | 41 ------ .../publisher/GetSingleProject.json | 0 .../ActionResolverTest_postMergeRequest.json | 0 .../webhook/ActionResolverTest_postNote.json | 0 .../webhook/ActionResolverTest_postPush.json | 0 .../ActionResolverTest_postPushTag.json | 0 .../webhook/build/MergeRequestEvent.json | 0 .../MergeRequestEvent_alreadyBuiltMR.json | 0 ..._alreadyBuiltMR_differentTargetBranch.json | 0 .../build/MergeRequestEvent_approvedMR.json | 0 .../build/MergeRequestEvent_closedMR.json | 0 .../webhook/build/NoteEvent.json | 0 .../build/NoteEvent_alreadyBuiltMR.json | 0 ..._alreadyBuiltMR_differentTargetBranch.json | 0 .../webhook/build/PipelineEvent.json | 0 .../webhook/build/PipelineFailureEvent.json | 0 .../webhook/build/PushEvent.json | 0 .../build/PushEvent_missingRepositoryUrl.json | 0 222 files changed, 1320 insertions(+), 1352 deletions(-) rename src/main/java/com/dabsquared/{gitlabjenkins/GitLabPushTrigger.java => giteejenkins/GiteePushTrigger.java} (80%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/cause/CauseData.java (99%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/cause/GiteeWebHookCause.java (92%) rename src/main/java/com/dabsquared/{gitlabjenkins/connection/GitLabApiToken.java => giteejenkins/connection/GiteeApiToken.java} (64%) rename src/main/java/com/dabsquared/{gitlabjenkins/connection/GitLabApiTokenImpl.java => giteejenkins/connection/GiteeApiTokenImpl.java} (73%) rename src/main/java/com/dabsquared/{gitlabjenkins/connection/GitLabConnection.java => giteejenkins/connection/GiteeConnection.java} (69%) rename src/main/java/com/dabsquared/{gitlabjenkins/connection/GitLabConnectionConfig.java => giteejenkins/connection/GiteeConnectionConfig.java} (80%) rename src/main/java/com/dabsquared/{gitlabjenkins/connection/GitLabConnectionProperty.java => giteejenkins/connection/GiteeConnectionProperty.java} (65%) rename src/main/java/com/dabsquared/{gitlabjenkins/environment/GitLabEnvironmentContributor.java => giteejenkins/environment/GiteeEnvironmentContributor.java} (84%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/JacksonConfig.java (95%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/GitLabClient.java => giteejenkins/gitee/api/GiteeClient.java} (88%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/GitLabClientBuilder.java => giteejenkins/gitee/api/GiteeClientBuilder.java} (54%) create mode 100644 src/main/java/com/dabsquared/giteejenkins/gitee/api/impl/AutodetectGiteeClientBuilder.java rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClient.java => giteejenkins/gitee/api/impl/AutodetectingGiteeClient.java} (69%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/GitLabApiProxy.java => giteejenkins/gitee/api/impl/GiteeApiProxy.java} (88%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/ResteasyGitLabClient.java => giteejenkins/gitee/api/impl/ResteasyGiteeClient.java} (88%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/ResteasyGitLabClientBuilder.java => giteejenkins/gitee/api/impl/ResteasyGiteeClientBuilder.java} (89%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/V3GitLabApiProxy.java => giteejenkins/gitee/api/impl/V3GiteeApiProxy.java} (95%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/V3GitLabClientBuilder.java => giteejenkins/gitee/api/impl/V3GiteeClientBuilder.java} (60%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/V4GitLabApiProxy.java => giteejenkins/gitee/api/impl/V4GiteeApiProxy.java} (95%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/V4GitLabClientBuilder.java => giteejenkins/gitee/api/impl/V4GiteeClientBuilder.java} (60%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/Branch.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/BuildState.java (66%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/Commit.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/Label.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/MergeRequest.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/Namespace.java (95%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/Note.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/Pipeline.java (91%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/Project.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/model/User.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/Action.java (63%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/BranchData.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/Commit.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/MergeRequestHook.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/MergeRequestLabel.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/MergeRequestObjectAttributes.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/NoteHook.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/NoteObjectAttributes.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/PipelineEventObjectAttributes.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/PipelineHook.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/Project.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/PushHook.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/Repository.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/State.java (65%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/User.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/hook/model/WebHook.java (96%) rename src/main/java/com/dabsquared/{gitlabjenkins/listener/GitLabBuildDescriptionRunListener.java => giteejenkins/listener/GiteeBuildDescriptionRunListener.java} (67%) rename src/main/java/com/dabsquared/{gitlabjenkins/publisher/GitLabAcceptMergeRequestPublisher.java => giteejenkins/publisher/GiteeAcceptMergeRequestPublisher.java} (77%) rename src/main/java/com/dabsquared/{gitlabjenkins/publisher/GitLabCommitStatusPublisher.java => giteejenkins/publisher/GiteeCommitStatusPublisher.java} (86%) rename src/main/java/com/dabsquared/{gitlabjenkins/publisher/GitLabMessagePublisher.java => giteejenkins/publisher/GiteeMessagePublisher.java} (89%) rename src/main/java/com/dabsquared/{gitlabjenkins/publisher/GitLabVotePublisher.java => giteejenkins/publisher/GiteeVotePublisher.java} (80%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/publisher/MergeRequestNotifier.java (80%) rename src/main/java/com/dabsquared/{gitlabjenkins/service/GitLabProjectBranchesService.java => giteejenkins/service/GiteeProjectBranchesService.java} (64%) rename src/main/java/com/dabsquared/{gitlabjenkins/service/GitLabProjectLabelsService.java => giteejenkins/service/GiteeProjectLabelsService.java} (68%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/TriggerOpenMergeRequest.java (68%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/branch/AntPathMatcherSet.java (91%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/branch/ProjectBranchesProvider.java (90%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/exception/NoRevisionToBuildException.java (63%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/AllBranchesFilter.java (77%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/BranchFilter.java (68%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/BranchFilterConfig.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/BranchFilterFactory.java (92%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/BranchFilterType.java (69%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/MergeRequestLabelFilter.java (76%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/MergeRequestLabelFilterConfig.java (94%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/MergeRequestLabelFilterFactory.java (89%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/MergeRequestLabelFilterImpl.java (96%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/NameBasedFilter.java (97%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/NopMergeRequestLabelFilter.java (82%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/RegexBasedFilter.java (88%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/AbstractWebHookTriggerHandler.java (88%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/PendingBuildsHandler.java (77%) create mode 100644 src/main/java/com/dabsquared/giteejenkins/trigger/handler/WebHookTriggerHandler.java create mode 100644 src/main/java/com/dabsquared/giteejenkins/trigger/handler/merge/MergeRequestHookTriggerHandler.java rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/merge/MergeRequestHookTriggerHandlerFactory.java (92%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/merge/MergeRequestHookTriggerHandlerImpl.java (88%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/merge/NopMergeRequestHookTriggerHandler.java (55%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/note/NopNoteHookTriggerHandler.java (54%) create mode 100644 src/main/java/com/dabsquared/giteejenkins/trigger/handler/note/NoteHookTriggerHandler.java rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/note/NoteHookTriggerHandlerFactory.java (88%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/note/NoteHookTriggerHandlerImpl.java (88%) create mode 100644 src/main/java/com/dabsquared/giteejenkins/trigger/handler/pipeline/NopPipelineHookTriggerHandler.java create mode 100644 src/main/java/com/dabsquared/giteejenkins/trigger/handler/pipeline/PipelineHookTriggerHandler.java rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/pipeline/PipelineHookTriggerHandlerFactory.java (86%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/pipeline/PipelineHookTriggerHandlerImpl.java (83%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/push/NopPushHookTriggerHandler.java (54%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/push/OpenMergeRequestPushHookTriggerHandler.java (82%) create mode 100644 src/main/java/com/dabsquared/giteejenkins/trigger/handler/push/PushHookTriggerHandler.java rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/push/PushHookTriggerHandlerFactory.java (92%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/push/PushHookTriggerHandlerImpl.java (87%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/push/PushHookTriggerHandlerList.java (71%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/label/ProjectLabelsProvider.java (88%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/ACLUtil.java (94%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/BuildUtil.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/CommitStatusUpdater.java (72%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/JsonUtil.java (98%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/LoggerUtil.java (81%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/ProjectIdUtil.java (88%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/ActionResolver.java (88%) rename src/main/java/com/dabsquared/{gitlabjenkins/webhook/GitLabWebHook.java => giteejenkins/webhook/GiteeWebHook.java} (85%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/WebHookAction.java (77%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/BuildWebHookAction.java (79%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/MergeRequestBuildAction.java (81%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/NoteBuildAction.java (75%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PipelineBuildAction.java (86%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PushBuildAction.java (89%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BranchBuildPageRedirectAction.java (73%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BranchStatusPngAction.java (72%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BuildPageRedirectAction.java (89%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BuildStatusAction.java (95%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/CommitBuildPageRedirectAction.java (73%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/CommitStatusPngAction.java (72%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/StatusJsonAction.java (92%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/StatusPngAction.java (96%) rename src/main/java/com/dabsquared/{gitlabjenkins/workflow/AcceptGitLabMergeRequestStep.java => giteejenkins/workflow/AcceptGiteeMergeRequestStep.java} (81%) rename src/main/java/com/dabsquared/{gitlabjenkins/workflow/AddGitLabMergeRequestCommentStep.java => giteejenkins/workflow/AddGiteeMergeRequestCommentStep.java} (81%) rename src/main/java/com/dabsquared/{gitlabjenkins/workflow/GitLabBuildsStep.java => giteejenkins/workflow/GiteeBuildsStep.java} (90%) rename src/main/java/com/dabsquared/{gitlabjenkins/workflow/GitLabCommitStatusStep.java => giteejenkins/workflow/GiteeCommitStatusStep.java} (88%) rename src/main/java/com/dabsquared/{gitlabjenkins => giteejenkins}/workflow/PendingBuildsAction.java (93%) rename src/main/java/com/dabsquared/{gitlabjenkins/workflow/UpdateGitLabCommitStatusStep.java => giteejenkins/workflow/UpdateGiteeCommitStatusStep.java} (80%) delete mode 100644 src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java delete mode 100644 src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/WebHookTriggerHandler.java delete mode 100644 src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/merge/MergeRequestHookTriggerHandler.java delete mode 100644 src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/note/NoteHookTriggerHandler.java delete mode 100644 src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/pipeline/NopPipelineHookTriggerHandler.java delete mode 100644 src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/pipeline/PipelineHookTriggerHandler.java delete mode 100644 src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/push/PushHookTriggerHandler.java rename src/main/resources/com/dabsquared/{gitlabjenkins/GitLabPushTrigger/GitLabWebHookPollingAction => giteejenkins/GiteePushTrigger/GiteeWebHookPollingAction}/index.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/GitLabPushTrigger => giteejenkins/GiteePushTrigger}/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/GitLabPushTrigger => giteejenkins/GiteePushTrigger}/help.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/Messages.properties (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/cause/GitLabWebHookCause/description.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/cause/Messages.properties (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/connection/GitLabApiTokenImpl/credentials.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/connection/GitLabConnectionConfig/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/connection/GitLabConnectionProperty/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/connection/Messages.properties (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/publisher/GitLabCommitStatusPublisher => giteejenkins/publisher/GiteeCommitStatusPublisher}/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/publisher/GitLabMessagePublisher => giteejenkins/publisher/GiteeMessagePublisher}/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/publisher/Messages.properties (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/failed.png (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/running.png (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/success.png (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/unknown.png (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/unstable.png (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/workflow/AcceptGitLabMergeRequestStep => giteejenkins/workflow/AcceptGiteeMergeRequestStep}/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/workflow/AddGitLabMergeRequestCommentStep => giteejenkins/workflow/AddGiteeMergeRequestCommentStep}/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/workflow/GitLabBuildsStep => giteejenkins/workflow/GiteeBuildsStep}/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/workflow/GitLabCommitStatusStep => giteejenkins/workflow/GiteeCommitStatusStep}/config.jelly (100%) rename src/main/resources/com/dabsquared/{gitlabjenkins/workflow/UpdateGitLabCommitStatusStep => giteejenkins/workflow/UpdateGiteeCommitStatusStep}/config.jelly (100%) rename src/test/java/com/dabsquared/{gitlabjenkins/connection/GitLabConnectionConfigSSLTest.java => giteejenkins/connection/GiteeConnectionConfigSSLTest.java} (88%) rename src/test/java/com/dabsquared/{gitlabjenkins/connection/GitLabConnectionConfigTest.java => giteejenkins/connection/GiteeConnectionConfigTest.java} (80%) rename src/test/java/com/dabsquared/{gitlabjenkins/environment/GitLabEnvironmentContributorTest.java => giteejenkins/environment/GiteeEnvironmentContributorTest.java} (74%) create mode 100644 src/test/java/com/dabsquared/giteejenkins/gitee/api/GiteeClientBuilderTest.java rename src/test/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java => giteejenkins/gitee/api/impl/AutodetectingGiteeClientTest.java} (73%) rename src/test/java/com/dabsquared/{gitlabjenkins/gitlab/api/impl/ResteasyGitLabClientBuilderTest.java => giteejenkins/gitee/api/impl/ResteasyGiteeClientBuilderTest.java} (54%) rename src/test/java/com/dabsquared/{gitlabjenkins/gitlab => giteejenkins/gitee}/api/impl/TestUtility.java (76%) rename src/test/java/com/dabsquared/{gitlabjenkins/publisher/GitLabAcceptMergeRequestPublisherTest.java => giteejenkins/publisher/GiteeAcceptMergeRequestPublisherTest.java} (86%) rename src/test/java/com/dabsquared/{gitlabjenkins/publisher/GitLabCommitStatusPublisherTest.java => giteejenkins/publisher/GiteeCommitStatusPublisherTest.java} (91%) rename src/test/java/com/dabsquared/{gitlabjenkins/publisher/GitLabMessagePublisherTest.java => giteejenkins/publisher/GiteeMessagePublisherTest.java} (92%) rename src/test/java/com/dabsquared/{gitlabjenkins/publisher/GitLabVotePublisherTest.java => giteejenkins/publisher/GiteeVotePublisherTest.java} (88%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/publisher/TestUtility.java (80%) rename src/test/java/com/dabsquared/{gitlabjenkins/service/GitLabClientStub.java => giteejenkins/service/GiteeClientStub.java} (92%) rename src/test/java/com/dabsquared/{gitlabjenkins/service/GitLabProjectBranchesServiceTest.java => giteejenkins/service/GiteeProjectBranchesServiceTest.java} (77%) rename src/test/java/com/dabsquared/{gitlabjenkins/service/GitLabProjectLabelsServiceTest.java => giteejenkins/service/GiteeProjectLabelsServiceTest.java} (77%) rename src/test/java/com/dabsquared/{gitlabjenkins/testhelpers/GitLabPushRequestSamples.java => giteejenkins/testhelpers/GiteePushRequestSamples.java} (59%) rename src/test/java/com/dabsquared/{gitlabjenkins/testhelpers/GitLabPushRequestSamples_7_10_5_489b413.java => giteejenkins/testhelpers/GiteePushRequestSamples_7_10_5_489B413.java} (90%) rename src/test/java/com/dabsquared/{gitlabjenkins/testhelpers/GitLabPushRequestSamples_7_5_1_36679b5.java => giteejenkins/testhelpers/GiteePushRequestSamples_7_5_1_36679B5.java} (90%) rename src/test/java/com/dabsquared/{gitlabjenkins/testhelpers/GitLabPushRequestSamples_8_1_2_8c8af7b.java => giteejenkins/testhelpers/GiteePushRequestSamples_8_1_2_8C8Af7B.java} (90%) rename src/test/java/com/dabsquared/{gitlabjenkins/testing/gitlab/rule/GitLabRule.java => giteejenkins/testing/gitee/rule/GiteeRule.java} (74%) rename src/test/java/com/dabsquared/{gitlabjenkins/testing/gitlab => giteejenkins/testing/gitee}/rule/ProjectRequest.java (95%) rename src/test/java/com/dabsquared/{gitlabjenkins/testing/integration/GitLabIT.java => giteejenkins/testing/integration/GiteeIT.java} (87%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/AllBranchesFilterTest.java (89%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/BranchFilterFactoryTest.java (89%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/MergeRequestLabelFilterImplTest.java (97%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/NameBasedFilterTest.java (97%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/filter/RegexBasedFilterTest.java (95%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/PendingBuildsHandlerTest.java (50%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/merge/MergeRequestHookTriggerHandlerImplTest.java (85%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/note/NoteHookTriggerHandlerImplTest.java (73%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/pipeline/PipelineHookTriggerHandlerImplTest.java (74%) rename src/test/java/com/dabsquared/{gitlabjenkins/trigger/handler/push/PushHookTriggerHandlerGitlabServerTest.java => giteejenkins/trigger/handler/push/PushHookTriggerHandlerGiteeServerTest.java} (79%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/trigger/handler/push/PushHookTriggerHandlerImplTest.java (80%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/BuildUtilTest.java (99%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/CommitStatusUpdaterTest.java (75%) rename src/test/java/com/dabsquared/{gitlabjenkins/util/GitLabClientStub.java => giteejenkins/util/GiteeClientStub.java} (88%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/util/ProjectIdUtilTest.java (62%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/ActionResolverTest.java (91%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/MergeRequestBuildActionTest.java (87%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/NoteBuildActionTest.java (83%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PipelineBuildActionTest.java (70%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PushBuildActionTest.java (91%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BranchBuildPageRedirectActionTest.java (86%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BranchStatusPngActionTest.java (85%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BuildPageRedirectActionTest.java (98%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/BuildStatusActionTest.java (99%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/CommitBuildPageRedirectActionTest.java (86%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/CommitStatusPngActionTest.java (85%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/StatusJsonActionTest.java (98%) rename src/test/java/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/status/StatusPngActionTest.java (98%) delete mode 100644 src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilderTest.java rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/publisher/GetSingleProject.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/ActionResolverTest_postMergeRequest.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/ActionResolverTest_postNote.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/ActionResolverTest_postPush.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/ActionResolverTest_postPushTag.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/MergeRequestEvent.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/MergeRequestEvent_alreadyBuiltMR.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/MergeRequestEvent_alreadyBuiltMR_differentTargetBranch.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/MergeRequestEvent_approvedMR.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/MergeRequestEvent_closedMR.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/NoteEvent.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/NoteEvent_alreadyBuiltMR.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/NoteEvent_alreadyBuiltMR_differentTargetBranch.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PipelineEvent.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PipelineFailureEvent.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PushEvent.json (100%) rename src/test/resources/com/dabsquared/{gitlabjenkins => giteejenkins}/webhook/build/PushEvent_missingRepositoryUrl.json (100%) diff --git a/README.md b/README.md index 983d06b..d7f86c9 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Version 1.2.0 of the plugin introduced improved logging for debugging purposes. 1. Go to Jenkins -> Manage Jenkins -> System Log 2. Add new log recorder 3. Enter 'Gitlab plugin' or whatever you want for the name -4. On the next page, enter 'com.dabsquared.gitlabjenkins' for Logger, set log level to FINEST, and save +4. On the next page, enter 'com.dabsquared.giteejenkins' for Logger, set log level to FINEST, and save 5. Then click on your Gitlab plugin log, click 'Clear this log' if necessary, and then use GitLab to trigger some actions 6. Refresh the log page and you should see output diff --git a/pom.xml b/pom.xml index a416fa5..efeefad 100644 --- a/pom.xml +++ b/pom.xml @@ -13,10 +13,10 @@ false - gitlab-plugin + gitee-plugin 1.5.7-SNAPSHOT - GitLab Plugin - https://wiki.jenkins-ci.org/display/JENKINS/GitLab+Plugin + Gitee Plugin + hpi @@ -48,9 +48,9 @@ - scm:git:ssh://github.com:jenkinsci/gitlab-plugin.git - scm:git:git@github.com:jenkinsci/gitlab-plugin.git - https://github.com/jenkinsci/gitlab-plugin + scm:git:ssh://gitee.com:yashin/Gitee-Plugin.git + scm:git:git@gitee.com:yashin/Gitee-Plugin.git + https://gitee.com/yashin/Gitee-Plugin HEAD @@ -307,7 +307,7 @@ integration-test - 8.17.4 + 8.17.4 9.5-1 @@ -332,8 +332,8 @@ - gitlab.http.port - ${gitlab.http.port} + gitee.http.port + ${gitee.http.port} postgres.port @@ -357,10 +357,10 @@ - gitlab.http.port + gitee.http.port - gitlab.ssh.port + gitee.ssh.port postgres.port @@ -380,12 +380,12 @@ sameersbn/postgresql:${postgres.version} - it-gitlab-postgres + it-gitee-postgres alias - gitlabhq_production - gitlab + giteehq_production + gitee password pg_trgm @@ -396,38 +396,38 @@ sameersbn/redis - it-gitlab-redis + it-gitee-redis alias - sameersbn/gitlab:${gitlab.version} - it-gitlab-gitlab + sameersbn/gitee:${gitee.version} + it-gitee-gitee alias - it-gitlab-postgres:postgresql - it-gitlab-redis:redisio + it-gitee-postgres:postgresql + it-gitee-redis:redisio - ${gitlab.http.port}:80 - ${gitlab.ssh.port}:22 + ${gitee.http.port}:80 + ${gitee.ssh.port}:22 false Asia/Kolkata - Kolkata - ${gitlab.http.port} - ${gitlab.ssh.port} - long-and-random-alpha-numeric-string - long-and-random-alphanumeric-string - long-and-random-alpha-numeric-string - 172.17.0.1 + Kolkata + ${gitee.http.port} + ${gitee.ssh.port} + long-and-random-alpha-numeric-string + long-and-random-alphanumeric-string + long-and-random-alpha-numeric-string + 172.17.0.1 - http://localhost:${gitlab.http.port}/ + http://localhost:${gitee.http.port}/ diff --git a/src/docker/docker-compose.yml b/src/docker/docker-compose.yml index 64f6e5d..0bf0ebb 100644 --- a/src/docker/docker-compose.yml +++ b/src/docker/docker-compose.yml @@ -7,16 +7,16 @@ services: ports: - "5432:5432" environment: - - DB_USER=gitlab + - DB_USER=gitee - DB_PASS=password - DB_NAME=gitlabhq_production - DB_EXTENSION=pg_trgm volumes: - - /srv/docker/gitlab/postgresql:/var/lib/postgresql + - /srv/docker/gitee/postgresql:/var/lib/postgresql gitlab: restart: always - image: sameersbn/gitlab:9.4.1 + image: sameersbn/gitee:9.4.1 depends_on: - redis - postgresql @@ -29,7 +29,7 @@ services: - DB_ADAPTER=postgresql - DB_HOST=postgresql - DB_PORT=5432 - - DB_USER=gitlab + - DB_USER=gitee - DB_PASS=password - DB_NAME=gitlabhq_production @@ -80,13 +80,13 @@ services: - IMAP_SSL=true - IMAP_STARTTLS=false volumes: - - /srv/docker/gitlab/gitlab:/home/git/data + - /srv/docker/gitee/gitee:/home/git/data redis: restart: always image: sameersbn/redis:latest volumes: - - /srv/docker/gitlab/redis:/var/lib/redis + - /srv/docker/gitee/redis:/var/lib/redis jenkins: restart: always diff --git a/src/main/java/com/dabsquared/gitlabjenkins/GitLabPushTrigger.java b/src/main/java/com/dabsquared/giteejenkins/GiteePushTrigger.java similarity index 80% rename from src/main/java/com/dabsquared/gitlabjenkins/GitLabPushTrigger.java rename to src/main/java/com/dabsquared/giteejenkins/GiteePushTrigger.java index 1075b41..529bd31 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/GitLabPushTrigger.java +++ b/src/main/java/com/dabsquared/giteejenkins/GiteePushTrigger.java @@ -1,31 +1,31 @@ -package com.dabsquared.gitlabjenkins; +package com.dabsquared.giteejenkins; -import com.dabsquared.gitlabjenkins.connection.GitLabConnection; -import com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig; -import com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty; -import com.dabsquared.gitlabjenkins.gitlab.hook.model.MergeRequestHook; -import com.dabsquared.gitlabjenkins.gitlab.hook.model.NoteHook; -import com.dabsquared.gitlabjenkins.gitlab.hook.model.PipelineHook; -import com.dabsquared.gitlabjenkins.gitlab.hook.model.PushHook; -import com.dabsquared.gitlabjenkins.publisher.GitLabAcceptMergeRequestPublisher; -import com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher; -import com.dabsquared.gitlabjenkins.publisher.GitLabMessagePublisher; -import com.dabsquared.gitlabjenkins.publisher.GitLabVotePublisher; -import com.dabsquared.gitlabjenkins.trigger.TriggerOpenMergeRequest; -import com.dabsquared.gitlabjenkins.trigger.branch.ProjectBranchesProvider; -import com.dabsquared.gitlabjenkins.trigger.filter.BranchFilter; -import com.dabsquared.gitlabjenkins.trigger.filter.BranchFilterFactory; -import com.dabsquared.gitlabjenkins.trigger.filter.BranchFilterType; -import com.dabsquared.gitlabjenkins.trigger.filter.MergeRequestLabelFilter; -import com.dabsquared.gitlabjenkins.trigger.filter.MergeRequestLabelFilterConfig; -import com.dabsquared.gitlabjenkins.trigger.filter.MergeRequestLabelFilterFactory; -import com.dabsquared.gitlabjenkins.trigger.handler.merge.MergeRequestHookTriggerHandler; -import com.dabsquared.gitlabjenkins.trigger.handler.note.NoteHookTriggerHandler; -import com.dabsquared.gitlabjenkins.trigger.handler.pipeline.PipelineHookTriggerHandler; -import com.dabsquared.gitlabjenkins.trigger.handler.push.PushHookTriggerHandler; -import com.dabsquared.gitlabjenkins.trigger.label.ProjectLabelsProvider; -import com.dabsquared.gitlabjenkins.webhook.GitLabWebHook; +import com.dabsquared.giteejenkins.connection.GiteeConnection; +import com.dabsquared.giteejenkins.connection.GiteeConnectionConfig; +import com.dabsquared.giteejenkins.connection.GiteeConnectionProperty; +import com.dabsquared.giteejenkins.gitee.hook.model.MergeRequestHook; +import com.dabsquared.giteejenkins.gitee.hook.model.NoteHook; +import com.dabsquared.giteejenkins.gitee.hook.model.PipelineHook; +import com.dabsquared.giteejenkins.gitee.hook.model.PushHook; +import com.dabsquared.giteejenkins.publisher.GiteeAcceptMergeRequestPublisher; +import com.dabsquared.giteejenkins.publisher.GiteeCommitStatusPublisher; +import com.dabsquared.giteejenkins.publisher.GiteeMessagePublisher; +import com.dabsquared.giteejenkins.publisher.GiteeVotePublisher; +import com.dabsquared.giteejenkins.trigger.TriggerOpenMergeRequest; +import com.dabsquared.giteejenkins.trigger.branch.ProjectBranchesProvider; +import com.dabsquared.giteejenkins.trigger.filter.BranchFilter; +import com.dabsquared.giteejenkins.trigger.filter.BranchFilterFactory; +import com.dabsquared.giteejenkins.trigger.filter.BranchFilterType; +import com.dabsquared.giteejenkins.trigger.filter.MergeRequestLabelFilter; +import com.dabsquared.giteejenkins.trigger.filter.MergeRequestLabelFilterConfig; +import com.dabsquared.giteejenkins.trigger.filter.MergeRequestLabelFilterFactory; +import com.dabsquared.giteejenkins.trigger.handler.merge.MergeRequestHookTriggerHandler; +import com.dabsquared.giteejenkins.trigger.handler.note.NoteHookTriggerHandler; +import com.dabsquared.giteejenkins.trigger.handler.pipeline.PipelineHookTriggerHandler; +import com.dabsquared.giteejenkins.trigger.handler.push.PushHookTriggerHandler; +import com.dabsquared.giteejenkins.trigger.label.ProjectLabelsProvider; +import com.dabsquared.giteejenkins.webhook.GiteeWebHook; import hudson.Extension; import hudson.Util; import hudson.init.InitMilestone; @@ -61,19 +61,19 @@ import java.io.IOException; import java.io.ObjectStreamException; import java.security.SecureRandom; -import static com.dabsquared.gitlabjenkins.trigger.filter.BranchFilterConfig.BranchFilterConfigBuilder.branchFilterConfig; -import static com.dabsquared.gitlabjenkins.trigger.handler.merge.MergeRequestHookTriggerHandlerFactory.newMergeRequestHookTriggerHandler; -import static com.dabsquared.gitlabjenkins.trigger.handler.note.NoteHookTriggerHandlerFactory.newNoteHookTriggerHandler; -import static com.dabsquared.gitlabjenkins.trigger.handler.pipeline.PipelineHookTriggerHandlerFactory.newPipelineHookTriggerHandler; -import static com.dabsquared.gitlabjenkins.trigger.handler.push.PushHookTriggerHandlerFactory.newPushHookTriggerHandler; +import static com.dabsquared.giteejenkins.trigger.filter.BranchFilterConfig.BranchFilterConfigBuilder.branchFilterConfig; +import static com.dabsquared.giteejenkins.trigger.handler.merge.MergeRequestHookTriggerHandlerFactory.newMergeRequestHookTriggerHandler; +import static com.dabsquared.giteejenkins.trigger.handler.note.NoteHookTriggerHandlerFactory.newNoteHookTriggerHandler; +import static com.dabsquared.giteejenkins.trigger.handler.pipeline.PipelineHookTriggerHandlerFactory.newPipelineHookTriggerHandler; +import static com.dabsquared.giteejenkins.trigger.handler.push.PushHookTriggerHandlerFactory.newPushHookTriggerHandler; /** - * Triggers a build when we receive a GitLab WebHook. + * Triggers a build when we receive a Gitee WebHook. * * @author Daniel Brooks */ -public class GitLabPushTrigger extends Trigger> { +public class GiteePushTrigger extends Trigger> { private static final SecureRandom RANDOM = new SecureRandom(); @@ -112,18 +112,18 @@ public class GitLabPushTrigger extends Trigger> { private transient MergeRequestLabelFilter mergeRequestLabelFilter; /** - * @deprecated use {@link #GitLabPushTrigger()} with setters to configure an instance of this class. + * @deprecated use {@link #GiteePushTrigger()} with setters to configure an instance of this class. */ @Deprecated @GeneratePojoBuilder(intoPackage = "*.builder.generated", withFactoryMethod = "*") - public GitLabPushTrigger(boolean triggerOnPush, boolean triggerOnMergeRequest, boolean triggerOnAcceptedMergeRequest, boolean triggerOnClosedMergeRequest, - TriggerOpenMergeRequest triggerOpenMergeRequestOnPush, boolean triggerOnNoteRequest, String noteRegex, - boolean skipWorkInProgressMergeRequest, boolean ciSkip, - boolean setBuildDescription, boolean addNoteOnMergeRequest, boolean addCiMessage, boolean addVoteOnMergeRequest, - boolean acceptMergeRequestOnSuccess, BranchFilterType branchFilterType, - String includeBranchesSpec, String excludeBranchesSpec, String targetBranchRegex, - MergeRequestLabelFilterConfig mergeRequestLabelFilterConfig, String secretToken, boolean triggerOnPipelineEvent, - boolean triggerOnApprovedMergeRequest, String pendingBuildName, boolean cancelPendingBuildsOnUpdate) { + public GiteePushTrigger(boolean triggerOnPush, boolean triggerOnMergeRequest, boolean triggerOnAcceptedMergeRequest, boolean triggerOnClosedMergeRequest, + TriggerOpenMergeRequest triggerOpenMergeRequestOnPush, boolean triggerOnNoteRequest, String noteRegex, + boolean skipWorkInProgressMergeRequest, boolean ciSkip, + boolean setBuildDescription, boolean addNoteOnMergeRequest, boolean addCiMessage, boolean addVoteOnMergeRequest, + boolean acceptMergeRequestOnSuccess, BranchFilterType branchFilterType, + String includeBranchesSpec, String excludeBranchesSpec, String targetBranchRegex, + MergeRequestLabelFilterConfig mergeRequestLabelFilterConfig, String secretToken, boolean triggerOnPipelineEvent, + boolean triggerOnApprovedMergeRequest, String pendingBuildName, boolean cancelPendingBuildsOnUpdate) { this.triggerOnPush = triggerOnPush; this.triggerOnMergeRequest = triggerOnMergeRequest; this.triggerOnAcceptedMergeRequest = triggerOnAcceptedMergeRequest; @@ -155,14 +155,14 @@ public class GitLabPushTrigger extends Trigger> { } @DataBoundConstructor - public GitLabPushTrigger() { } + public GiteePushTrigger() { } @Initializer(after = InitMilestone.JOB_LOADED) public static void migrateJobs() throws IOException { - GitLabPushTrigger.DescriptorImpl oldConfig = Trigger.all().get(GitLabPushTrigger.DescriptorImpl.class); + GiteePushTrigger.DescriptorImpl oldConfig = Trigger.all().get(GiteePushTrigger.DescriptorImpl.class); if (!oldConfig.jobsMigrated) { - GitLabConnectionConfig gitLabConfig = (GitLabConnectionConfig) Jenkins.getInstance().getDescriptor(GitLabConnectionConfig.class); - gitLabConfig.getConnections().add(new GitLabConnection( + GiteeConnectionConfig giteeConfig = (GiteeConnectionConfig) Jenkins.getInstance().getDescriptor(GiteeConnectionConfig.class); + giteeConfig.getConnections().add(new GiteeConnection( oldConfig.gitlabHostUrl, oldConfig.gitlabHostUrl, oldConfig.gitlabApiToken, @@ -171,33 +171,33 @@ public class GitLabPushTrigger extends Trigger> { 10, 10)); - String defaultConnectionName = gitLabConfig.getConnections().get(0).getName(); + String defaultConnectionName = giteeConfig.getConnections().get(0).getName(); for (AbstractProject project : Jenkins.getInstance().getAllItems(AbstractProject.class)) { - GitLabPushTrigger trigger = project.getTrigger(GitLabPushTrigger.class); + GiteePushTrigger trigger = project.getTrigger(GiteePushTrigger.class); if (trigger != null) { if (trigger.addCiMessage) { - project.getPublishersList().add(new GitLabCommitStatusPublisher("jenkins", false)); + project.getPublishersList().add(new GiteeCommitStatusPublisher("jenkins", false)); } - project.addProperty(new GitLabConnectionProperty(defaultConnectionName)); + project.addProperty(new GiteeConnectionProperty(defaultConnectionName)); project.save(); } } - gitLabConfig.save(); + giteeConfig.save(); oldConfig.jobsMigrated = true; oldConfig.save(); } if (!oldConfig.jobsMigrated2) { for (AbstractProject project : Jenkins.getInstance().getAllItems(AbstractProject.class)) { - GitLabPushTrigger trigger = project.getTrigger(GitLabPushTrigger.class); + GiteePushTrigger trigger = project.getTrigger(GiteePushTrigger.class); if (trigger != null) { if (trigger.addNoteOnMergeRequest) { - project.getPublishersList().add(new GitLabMessagePublisher()); + project.getPublishersList().add(new GiteeMessagePublisher()); } if (trigger.addVoteOnMergeRequest) { - project.getPublishersList().add(new GitLabVotePublisher()); + project.getPublishersList().add(new GiteeVotePublisher()); } if (trigger.acceptMergeRequestOnSuccess) { - project.getPublishersList().add(new GitLabAcceptMergeRequestPublisher()); + project.getPublishersList().add(new GiteeAcceptMergeRequestPublisher()); } project.save(); } @@ -492,13 +492,13 @@ public class GitLabPushTrigger extends Trigger> { return super.readResolve(); } - public static GitLabPushTrigger getFromJob(Job job) { - GitLabPushTrigger trigger = null; + public static GiteePushTrigger getFromJob(Job job) { + GiteePushTrigger trigger = null; if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { ParameterizedJobMixIn.ParameterizedJob p = (ParameterizedJobMixIn.ParameterizedJob) job; for (Trigger t : p.getTriggers().values()) { - if (t instanceof GitLabPushTrigger) { - trigger = (GitLabPushTrigger) t; + if (t instanceof GiteePushTrigger) { + trigger = (GiteePushTrigger) t; } } } @@ -506,7 +506,7 @@ public class GitLabPushTrigger extends Trigger> { } @Extension - @Symbol("gitlab") + @Symbol("gitee") public static class DescriptorImpl extends TriggerDescriptor { private transient final SequentialExecutionQueue queue = new SequentialExecutionQueue(Jenkins.MasterComputer.threadPoolForRemoting); @@ -543,7 +543,7 @@ public class GitLabPushTrigger extends Trigger> { private StringBuilder retrieveProjectUrl(Job project) { return new StringBuilder() .append(Jenkins.getInstance().getRootUrl()) - .append(GitLabWebHook.WEBHOOK_URL) + .append(GiteeWebHook.WEBHOOK_URL) .append(retrieveParentUrl(project)) .append('/').append(Util.rawEncode(project.getName())); } diff --git a/src/main/java/com/dabsquared/gitlabjenkins/cause/CauseData.java b/src/main/java/com/dabsquared/giteejenkins/cause/CauseData.java similarity index 99% rename from src/main/java/com/dabsquared/gitlabjenkins/cause/CauseData.java rename to src/main/java/com/dabsquared/giteejenkins/cause/CauseData.java index b49c843..3e6655d 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/cause/CauseData.java +++ b/src/main/java/com/dabsquared/giteejenkins/cause/CauseData.java @@ -1,6 +1,6 @@ -package com.dabsquared.gitlabjenkins.cause; +package com.dabsquared.giteejenkins.cause; -import com.dabsquared.gitlabjenkins.gitlab.api.model.MergeRequest; +import com.dabsquared.giteejenkins.gitee.api.model.MergeRequest; import hudson.markup.EscapedMarkupFormatter; import jenkins.model.Jenkins; import net.karneim.pojobuilder.GeneratePojoBuilder; diff --git a/src/main/java/com/dabsquared/gitlabjenkins/cause/GiteeWebHookCause.java b/src/main/java/com/dabsquared/giteejenkins/cause/GiteeWebHookCause.java similarity index 92% rename from src/main/java/com/dabsquared/gitlabjenkins/cause/GiteeWebHookCause.java rename to src/main/java/com/dabsquared/giteejenkins/cause/GiteeWebHookCause.java index d228bb1..eb11adc 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/cause/GiteeWebHookCause.java +++ b/src/main/java/com/dabsquared/giteejenkins/cause/GiteeWebHookCause.java @@ -1,4 +1,4 @@ -package com.dabsquared.gitlabjenkins.cause; +package com.dabsquared.giteejenkins.cause; import hudson.triggers.SCMTrigger; diff --git a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabApiToken.java b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeApiToken.java similarity index 64% rename from src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabApiToken.java rename to src/main/java/com/dabsquared/giteejenkins/connection/GiteeApiToken.java index cdcb00a..b784052 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabApiToken.java +++ b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeApiToken.java @@ -1,4 +1,4 @@ -package com.dabsquared.gitlabjenkins.connection; +package com.dabsquared.giteejenkins.connection; import com.cloudbees.plugins.credentials.CredentialsNameProvider; import com.cloudbees.plugins.credentials.NameWith; @@ -9,14 +9,14 @@ import hudson.util.Secret; /** * @author Robin Müller */ -@NameWith(GitLabApiToken.NameProvider.class) -public interface GitLabApiToken extends StandardCredentials { +@NameWith(GiteeApiToken.NameProvider.class) +public interface GiteeApiToken extends StandardCredentials { Secret getApiToken(); - class NameProvider extends CredentialsNameProvider { + class NameProvider extends CredentialsNameProvider { @Override - public String getName(GitLabApiToken c) { + public String getName(GiteeApiToken c) { String description = Util.fixEmptyAndTrim(c.getDescription()); return Messages.GitLabApiToken_name() + (description != null ? " (" + description + ")" : ""); } diff --git a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabApiTokenImpl.java b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeApiTokenImpl.java similarity index 73% rename from src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabApiTokenImpl.java rename to src/main/java/com/dabsquared/giteejenkins/connection/GiteeApiTokenImpl.java index 7987968..a12eec5 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabApiTokenImpl.java +++ b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeApiTokenImpl.java @@ -1,4 +1,4 @@ -package com.dabsquared.gitlabjenkins.connection; +package com.dabsquared.giteejenkins.connection; import com.cloudbees.plugins.credentials.CredentialsScope; import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; @@ -9,12 +9,12 @@ import org.kohsuke.stapler.DataBoundConstructor; /** * @author Robin Müller */ -public final class GitLabApiTokenImpl extends BaseStandardCredentials implements GitLabApiToken { +public final class GiteeApiTokenImpl extends BaseStandardCredentials implements GiteeApiToken { private Secret apiToken; @DataBoundConstructor - public GitLabApiTokenImpl(CredentialsScope scope, String id, String description, Secret apiToken) { + public GiteeApiTokenImpl(CredentialsScope scope, String id, String description, Secret apiToken) { super(scope, id, description); this.apiToken = apiToken; } diff --git a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnection.java b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnection.java similarity index 69% rename from src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnection.java rename to src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnection.java index 4ca7555..41e2d0f 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnection.java +++ b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnection.java @@ -1,4 +1,4 @@ -package com.dabsquared.gitlabjenkins.connection; +package com.dabsquared.giteejenkins.connection; import com.cloudbees.plugins.credentials.CredentialsMatchers; @@ -9,9 +9,9 @@ import com.cloudbees.plugins.credentials.SystemCredentialsProvider; import com.cloudbees.plugins.credentials.common.StandardCredentials; import com.cloudbees.plugins.credentials.domains.Domain; import com.cloudbees.plugins.credentials.domains.DomainRequirement; -import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient; -import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder; -import com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectGitLabClientBuilder; +import com.dabsquared.giteejenkins.gitee.api.GiteeClient; +import com.dabsquared.giteejenkins.gitee.api.GiteeClientBuilder; +import com.dabsquared.giteejenkins.gitee.api.impl.AutodetectGiteeClientBuilder; import hudson.init.InitMilestone; import hudson.init.Initializer; import hudson.model.Item; @@ -29,30 +29,30 @@ import java.util.List; import java.util.UUID; import static com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials; -import static com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder.getGitLabClientBuilderById; +import static com.dabsquared.giteejenkins.gitee.api.GiteeClientBuilder.getGitLabClientBuilderById; /** * @author Robin Müller */ -public class GitLabConnection { +public class GiteeConnection { private final String name; private final String url; private transient String apiToken; // TODO make final when migration code gets removed private String apiTokenId; - private GitLabClientBuilder clientBuilder; + private GiteeClientBuilder clientBuilder; private final boolean ignoreCertificateErrors; private final Integer connectionTimeout; private final Integer readTimeout; - private transient GitLabClient apiCache; + private transient GiteeClient apiCache; - public GitLabConnection(String name, String url, String apiTokenId, boolean ignoreCertificateErrors, Integer connectionTimeout, Integer readTimeout) { + public GiteeConnection(String name, String url, String apiTokenId, boolean ignoreCertificateErrors, Integer connectionTimeout, Integer readTimeout) { this( name, url, apiTokenId, - new AutodetectGitLabClientBuilder(), + new AutodetectGiteeClientBuilder(), ignoreCertificateErrors, connectionTimeout, readTimeout @@ -60,7 +60,7 @@ public class GitLabConnection { } @DataBoundConstructor - public GitLabConnection(String name, String url, String apiTokenId, String clientBuilderId, boolean ignoreCertificateErrors, Integer connectionTimeout, Integer readTimeout) { + public GiteeConnection(String name, String url, String apiTokenId, String clientBuilderId, boolean ignoreCertificateErrors, Integer connectionTimeout, Integer readTimeout) { this( name, url, @@ -73,7 +73,7 @@ public class GitLabConnection { } @Restricted(NoExternalUse.class) - public GitLabConnection(String name, String url, String apiTokenId, GitLabClientBuilder clientBuilder, boolean ignoreCertificateErrors, Integer connectionTimeout, Integer readTimeout) { + public GiteeConnection(String name, String url, String apiTokenId, GiteeClientBuilder clientBuilder, boolean ignoreCertificateErrors, Integer connectionTimeout, Integer readTimeout) { this.name = name; this.url = url; this.apiTokenId = apiTokenId; @@ -111,7 +111,7 @@ public class GitLabConnection { return readTimeout; } - public GitLabClient getClient() { + public GiteeClient getClient() { if (apiCache == null) { apiCache = clientBuilder.buildClient(url, getApiToken(apiTokenId), ignoreCertificateErrors, connectionTimeout, readTimeout); } @@ -124,8 +124,8 @@ public class GitLabConnection { lookupCredentials(StandardCredentials.class, (Item) null, ACL.SYSTEM, new ArrayList()), CredentialsMatchers.withId(apiTokenId)); if (credentials != null) { - if (credentials instanceof GitLabApiToken) { - return ((GitLabApiToken) credentials).getApiToken().getPlainText(); + if (credentials instanceof GiteeApiToken) { + return ((GiteeApiToken) credentials).getApiToken().getPlainText(); } if (credentials instanceof StringCredentials) { return ((StringCredentials) credentials).getSecret().getPlainText(); @@ -135,12 +135,12 @@ public class GitLabConnection { } - protected GitLabConnection readResolve() { + protected GiteeConnection readResolve() { if (connectionTimeout == null || readTimeout == null) { - return new GitLabConnection(name, url, apiTokenId, new AutodetectGitLabClientBuilder(), ignoreCertificateErrors, 10, 10); + return new GiteeConnection(name, url, apiTokenId, new AutodetectGiteeClientBuilder(), ignoreCertificateErrors, 10, 10); } if (clientBuilder == null) { - return new GitLabConnection(name, url, apiTokenId, new AutodetectGitLabClientBuilder(), ignoreCertificateErrors, connectionTimeout, readTimeout); + return new GiteeConnection(name, url, apiTokenId, new AutodetectGiteeClientBuilder(), ignoreCertificateErrors, connectionTimeout, readTimeout); } return this; @@ -148,15 +148,15 @@ public class GitLabConnection { @Initializer(after = InitMilestone.PLUGINS_STARTED) public static void migrate() throws IOException { - GitLabConnectionConfig descriptor = (GitLabConnectionConfig) Jenkins.getInstance().getDescriptor(GitLabConnectionConfig.class); - for (GitLabConnection connection : descriptor.getConnections()) { + GiteeConnectionConfig descriptor = (GiteeConnectionConfig) Jenkins.getInstance().getDescriptor(GiteeConnectionConfig.class); + for (GiteeConnection connection : descriptor.getConnections()) { if (connection.apiTokenId == null && connection.apiToken != null) { for (CredentialsStore credentialsStore : CredentialsProvider.lookupStores(Jenkins.getInstance())) { if (credentialsStore instanceof SystemCredentialsProvider.StoreImpl) { List domains = credentialsStore.getDomains(); connection.apiTokenId = UUID.randomUUID().toString(); credentialsStore.addCredentials(domains.get(0), - new GitLabApiTokenImpl(CredentialsScope.SYSTEM, connection.apiTokenId, "GitLab API Token", Secret.fromString(connection.apiToken))); + new GiteeApiTokenImpl(CredentialsScope.SYSTEM, connection.apiTokenId, "GitLab API Token", Secret.fromString(connection.apiToken))); } } } diff --git a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfig.java b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnectionConfig.java similarity index 80% rename from src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfig.java rename to src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnectionConfig.java index e1efd6d..b1aa876 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfig.java +++ b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnectionConfig.java @@ -1,4 +1,4 @@ -package com.dabsquared.gitlabjenkins.connection; +package com.dabsquared.giteejenkins.connection; import com.cloudbees.plugins.credentials.Credentials; @@ -7,8 +7,8 @@ import com.cloudbees.plugins.credentials.common.AbstractIdCredentialsListBoxMode import com.cloudbees.plugins.credentials.common.StandardCredentials; import com.cloudbees.plugins.credentials.common.StandardListBoxModel; import com.cloudbees.plugins.credentials.domains.URIRequirementBuilder; -import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient; -import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder; +import com.dabsquared.giteejenkins.gitee.api.GiteeClient; +import com.dabsquared.giteejenkins.gitee.api.GiteeClientBuilder; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.model.Item; @@ -30,27 +30,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder.getAllGitLabClientBuilders; +import static com.dabsquared.giteejenkins.gitee.api.GiteeClientBuilder.getAllGitLabClientBuilders; /** * @author Robin Müller */ @Extension -public class GitLabConnectionConfig extends GlobalConfiguration { +public class GiteeConnectionConfig extends GlobalConfiguration { private Boolean useAuthenticatedEndpoint = true; - private List connections = new ArrayList<>(); - private transient Map connectionMap = new HashMap<>(); + private List connections = new ArrayList<>(); + private transient Map connectionMap = new HashMap<>(); - public GitLabConnectionConfig() { + public GiteeConnectionConfig() { load(); refreshConnectionMap(); } @Override public boolean configure(StaplerRequest req, JSONObject json) throws FormException { - connections = req.bindJSONToList(GitLabConnection.class, json.get("connections")); + connections = req.bindJSONToList(GiteeConnection.class, json.get("connections")); useAuthenticatedEndpoint = json.getBoolean("useAuthenticatedEndpoint"); refreshConnectionMap(); save(); @@ -65,24 +65,24 @@ public class GitLabConnectionConfig extends GlobalConfiguration { this.useAuthenticatedEndpoint = useAuthenticatedEndpoint; } - public List getConnections() { + public List getConnections() { return connections; } - public void addConnection(GitLabConnection connection) { + public void addConnection(GiteeConnection connection) { connections.add(connection); connectionMap.put(connection.getName(), connection); } - public void setConnections(List newConnections) { + public void setConnections(List newConnections) { connections = new ArrayList<>(); connectionMap = new HashMap<>(); - for (GitLabConnection connection: newConnections){ + for (GiteeConnection connection: newConnections){ addConnection(connection); } } - public GitLabClient getClient(String connectionName) { + public GiteeClient getClient(String connectionName) { if (!connectionMap.containsKey(connectionName)) { return null; } @@ -138,7 +138,7 @@ public class GitLabConnectionConfig extends GlobalConfiguration { @QueryParameter int connectionTimeout, @QueryParameter int readTimeout) { try { - new GitLabConnection("", url, apiTokenId, clientBuilderId, ignoreCertificateErrors, connectionTimeout, readTimeout).getClient().getCurrentUser(); + new GiteeConnection("", url, apiTokenId, clientBuilderId, ignoreCertificateErrors, connectionTimeout, readTimeout).getClient().getCurrentUser(); return FormValidation.ok(Messages.connection_success()); } catch (WebApplicationException e) { return FormValidation.error(Messages.connection_error(e.getMessage())); @@ -155,7 +155,7 @@ public class GitLabConnectionConfig extends GlobalConfiguration { Jenkins.getActiveInstance(), StandardCredentials.class, URIRequirementBuilder.fromUri(url).build(), - new GitLabCredentialMatcher()); + new GiteeCredentialMatcher()); if (name != null && connectionMap.containsKey(name)) { String apiTokenId = connectionMap.get(name).getApiTokenId(); options.includeCurrentValue(apiTokenId); @@ -172,7 +172,7 @@ public class GitLabConnectionConfig extends GlobalConfiguration { public ListBoxModel doFillClientBuilderIdItems() { ListBoxModel model = new ListBoxModel(); - for (GitLabClientBuilder builder : getAllGitLabClientBuilders()) { + for (GiteeClientBuilder builder : getAllGitLabClientBuilders()) { model.add(builder.id()); } @@ -181,23 +181,23 @@ public class GitLabConnectionConfig extends GlobalConfiguration { private void refreshConnectionMap() { connectionMap.clear(); - for (GitLabConnection connection : connections) { + for (GiteeConnection connection : connections) { connectionMap.put(connection.getName(), connection); } } - private static class GitLabCredentialMatcher implements CredentialsMatcher { + private static class GiteeCredentialMatcher implements CredentialsMatcher { @Override public boolean matches(@NonNull Credentials credentials) { try { - return credentials instanceof GitLabApiToken || credentials instanceof StringCredentials; + return credentials instanceof GiteeApiToken || credentials instanceof StringCredentials; } catch (Throwable e) { return false; } } } //For backwards compatibility. ReadResolve is called on startup - protected GitLabConnectionConfig readResolve() { + protected GiteeConnectionConfig readResolve() { if (useAuthenticatedEndpoint == null) { setUseAuthenticatedEndpoint(false); } diff --git a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionProperty.java b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnectionProperty.java similarity index 65% rename from src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionProperty.java rename to src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnectionProperty.java index f24993e..7bd24bd 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionProperty.java +++ b/src/main/java/com/dabsquared/giteejenkins/connection/GiteeConnectionProperty.java @@ -1,7 +1,7 @@ -package com.dabsquared.gitlabjenkins.connection; +package com.dabsquared.giteejenkins.connection; -import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient; +import com.dabsquared.giteejenkins.gitee.api.GiteeClient; import hudson.Extension; import hudson.model.Job; import hudson.model.JobProperty; @@ -18,12 +18,12 @@ import org.kohsuke.stapler.StaplerRequest; /** * @author Robin Müller */ -public class GitLabConnectionProperty extends JobProperty> { +public class GiteeConnectionProperty extends JobProperty> { private String gitLabConnection; @DataBoundConstructor - public GitLabConnectionProperty(String gitLabConnection) { + public GiteeConnectionProperty(String gitLabConnection) { this.gitLabConnection = gitLabConnection; } @@ -31,16 +31,16 @@ public class GitLabConnectionProperty extends JobProperty> { return gitLabConnection; } - public GitLabClient getClient() { + public GiteeClient getClient() { if (StringUtils.isNotEmpty(gitLabConnection)) { - GitLabConnectionConfig connectionConfig = (GitLabConnectionConfig) Jenkins.getInstance().getDescriptor(GitLabConnectionConfig.class); + GiteeConnectionConfig connectionConfig = (GiteeConnectionConfig) Jenkins.getInstance().getDescriptor(GiteeConnectionConfig.class); return connectionConfig != null ? connectionConfig.getClient(gitLabConnection) : null; } return null; } - public static GitLabClient getClient(Run build) { - final GitLabConnectionProperty connectionProperty = build.getParent().getProperty(GitLabConnectionProperty.class); + public static GiteeClient getClient(Run build) { + final GiteeConnectionProperty connectionProperty = build.getParent().getProperty(GiteeConnectionProperty.class); if (connectionProperty != null) { return connectionProperty.getClient(); } @@ -63,13 +63,13 @@ public class GitLabConnectionProperty extends JobProperty> { @Override public JobProperty newInstance(StaplerRequest req, JSONObject formData) throws FormException { - return req.bindJSON(GitLabConnectionProperty.class, formData); + return req.bindJSON(GiteeConnectionProperty.class, formData); } public ListBoxModel doFillGitLabConnectionItems() { ListBoxModel options = new ListBoxModel(); - GitLabConnectionConfig descriptor = (GitLabConnectionConfig) Jenkins.getInstance().getDescriptor(GitLabConnectionConfig.class); - for (GitLabConnection connection : descriptor.getConnections()) { + GiteeConnectionConfig descriptor = (GiteeConnectionConfig) Jenkins.getInstance().getDescriptor(GiteeConnectionConfig.class); + for (GiteeConnection connection : descriptor.getConnections()) { options.add(connection.getName(), connection.getName()); } return options; diff --git a/src/main/java/com/dabsquared/gitlabjenkins/environment/GitLabEnvironmentContributor.java b/src/main/java/com/dabsquared/giteejenkins/environment/GiteeEnvironmentContributor.java similarity index 84% rename from src/main/java/com/dabsquared/gitlabjenkins/environment/GitLabEnvironmentContributor.java rename to src/main/java/com/dabsquared/giteejenkins/environment/GiteeEnvironmentContributor.java index bba34c5..8cec7fa 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/environment/GitLabEnvironmentContributor.java +++ b/src/main/java/com/dabsquared/giteejenkins/environment/GiteeEnvironmentContributor.java @@ -1,6 +1,6 @@ -package com.dabsquared.gitlabjenkins.environment; +package com.dabsquared.giteejenkins.environment; -import com.dabsquared.gitlabjenkins.cause.GiteeWebHookCause; +import com.dabsquared.giteejenkins.cause.GiteeWebHookCause; import hudson.EnvVars; import hudson.Extension; import hudson.matrix.MatrixRun; @@ -16,7 +16,7 @@ import java.io.IOException; * @author Robin Müller */ @Extension -public class GitLabEnvironmentContributor extends EnvironmentContributor { +public class GiteeEnvironmentContributor extends EnvironmentContributor { @Override public void buildEnvironmentFor(@Nonnull Run r, @Nonnull EnvVars envs, @Nonnull TaskListener listener) throws IOException, InterruptedException { GiteeWebHookCause cause = null; diff --git a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/JacksonConfig.java b/src/main/java/com/dabsquared/giteejenkins/gitee/JacksonConfig.java similarity index 95% rename from src/main/java/com/dabsquared/gitlabjenkins/gitlab/JacksonConfig.java rename to src/main/java/com/dabsquared/giteejenkins/gitee/JacksonConfig.java index 2bf37e6..6f26020 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/JacksonConfig.java +++ b/src/main/java/com/dabsquared/giteejenkins/gitee/JacksonConfig.java @@ -1,4 +1,4 @@ -package com.dabsquared.gitlabjenkins.gitlab; +package com.dabsquared.giteejenkins.gitee; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java b/src/main/java/com/dabsquared/giteejenkins/gitee/api/GiteeClient.java similarity index 88% rename from src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java rename to src/main/java/com/dabsquared/giteejenkins/gitee/api/GiteeClient.java index b65a160..0bb05de 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java +++ b/src/main/java/com/dabsquared/giteejenkins/gitee/api/GiteeClient.java @@ -1,11 +1,11 @@ -package com.dabsquared.gitlabjenkins.gitlab.api; +package com.dabsquared.giteejenkins.gitee.api; -import com.dabsquared.gitlabjenkins.gitlab.api.model.*; -import com.dabsquared.gitlabjenkins.gitlab.hook.model.State; +import com.dabsquared.giteejenkins.gitee.api.model.*; +import com.dabsquared.giteejenkins.gitee.hook.model.State; import java.util.List; -public interface GitLabClient { +public interface GiteeClient { String getHostUrl(); Project createProject(String projectName); diff --git a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilder.java b/src/main/java/com/dabsquared/giteejenkins/gitee/api/GiteeClientBuilder.java similarity index 54% rename from src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilder.java rename to src/main/java/com/dabsquared/giteejenkins/gitee/api/GiteeClientBuilder.java index 8bba0e5..47885e5 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilder.java +++ b/src/main/java/com/dabsquared/giteejenkins/gitee/api/GiteeClientBuilder.java @@ -1,4 +1,4 @@ -package com.dabsquared.gitlabjenkins.gitlab.api; +package com.dabsquared.giteejenkins.gitee.api; import hudson.ExtensionPoint; @@ -15,9 +15,9 @@ import java.util.NoSuchElementException; import static java.util.Collections.sort; @Restricted(NoExternalUse.class) -public abstract class GitLabClientBuilder implements Comparable, ExtensionPoint, Serializable { - public static GitLabClientBuilder getGitLabClientBuilderById(String id) { - for (GitLabClientBuilder provider : getAllGitLabClientBuilders()) { +public abstract class GiteeClientBuilder implements Comparable, ExtensionPoint, Serializable { + public static GiteeClientBuilder getGitLabClientBuilderById(String id) { + for (GiteeClientBuilder provider : getAllGitLabClientBuilders()) { if (provider.id().equals(id)) { return provider; } @@ -26,8 +26,8 @@ public abstract class GitLabClientBuilder implements Comparable getAllGitLabClientBuilders() { - List builders = new ArrayList<>(Jenkins.getInstance().getExtensionList(GitLabClientBuilder.class)); + public static List getAllGitLabClientBuilders() { + List builders = new ArrayList<>(Jenkins.getInstance().getExtensionList(GiteeClientBuilder.class)); sort(builders); return builders; } @@ -35,7 +35,7 @@ public abstract class GitLabClientBuilder implements Comparable candidates = new ArrayList<>(getAllGitLabClientBuilders()); + candidates.remove(this); + return new AutodetectingGiteeClient(candidates, url, token, ignoreCertificateErrors, connectionTimeout, readTimeout); + } +} diff --git a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClient.java b/src/main/java/com/dabsquared/giteejenkins/gitee/api/impl/AutodetectingGiteeClient.java similarity index 69% rename from src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClient.java rename to src/main/java/com/dabsquared/giteejenkins/gitee/api/impl/AutodetectingGiteeClient.java index 6510f0a..f985f2c 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClient.java +++ b/src/main/java/com/dabsquared/giteejenkins/gitee/api/impl/AutodetectingGiteeClient.java @@ -1,27 +1,27 @@ -package com.dabsquared.gitlabjenkins.gitlab.api.impl; +package com.dabsquared.giteejenkins.gitee.api.impl; -import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient; -import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder; -import com.dabsquared.gitlabjenkins.gitlab.api.model.*; -import com.dabsquared.gitlabjenkins.gitlab.hook.model.State; +import com.dabsquared.giteejenkins.gitee.api.GiteeClient; +import com.dabsquared.giteejenkins.gitee.api.GiteeClientBuilder; +import com.dabsquared.giteejenkins.gitee.api.model.*; +import com.dabsquared.giteejenkins.gitee.hook.model.State; import javax.ws.rs.NotFoundException; import java.util.List; import java.util.NoSuchElementException; -final class AutodetectingGitLabClient implements GitLabClient { - private final Iterable builders; +final class AutodetectingGiteeClient implements GiteeClient { + private final Iterable builders; private final String url; private final String token; private final boolean ignoreCertificateErrors; private final int connectionTimeout; private final int readTimeout; - private GitLabClient delegate; + private GiteeClient delegate; - AutodetectingGitLabClient(Iterable builders, String url, String token, boolean ignoreCertificateErrors, int connectionTimeout, int readTimeout) { + AutodetectingGiteeClient(Iterable builders, String url, String token, boolean ignoreCertificateErrors, int connectionTimeout, int readTimeout) { this.builders = builders; this.url = url; this.token = token; @@ -38,9 +38,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public Project createProject(final String projectName) { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Project execute(GitLabClient client) { + Project execute(GiteeClient client) { return client.createProject(projectName); } }); @@ -49,9 +49,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public MergeRequest createMergeRequest(final Integer projectId, final String sourceBranch, final String targetBranch, final String title) { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - MergeRequest execute(GitLabClient client) { + MergeRequest execute(GiteeClient client) { return client.createMergeRequest(projectId, sourceBranch, targetBranch, title); } }); @@ -60,9 +60,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public Project getProject(final String projectName) { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Project execute(GitLabClient client) { + Project execute(GiteeClient client) { return client.getProject(projectName); } }); @@ -71,9 +71,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public Project updateProject(final String projectId, final String name, final String path) { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Project execute(GitLabClient client) { + Project execute(GiteeClient client) { return client.updateProject(projectId, name, path); } }); @@ -82,9 +82,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public void deleteProject(final String projectId) { execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Void execute(GitLabClient client) { + Void execute(GiteeClient client) { client.deleteProject(projectId); return null; } @@ -94,9 +94,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public void addProjectHook(final String projectId, final String url, final Boolean pushEvents, final Boolean mergeRequestEvents, final Boolean noteEvents) { execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Void execute(GitLabClient client) { + Void execute(GiteeClient client) { client.addProjectHook(projectId, url, pushEvents, mergeRequestEvents, noteEvents); return null; } @@ -106,9 +106,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public void changeBuildStatus(final String projectId, final String sha, final BuildState state, final String ref, final String context, final String targetUrl, final String description) { execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Void execute(GitLabClient client) { + Void execute(GiteeClient client) { client.changeBuildStatus(projectId, sha, state, ref, context, targetUrl, description); return null; } @@ -118,9 +118,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public void changeBuildStatus(final Integer projectId, final String sha, final BuildState state, final String ref, final String context, final String targetUrl, final String description) { execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Void execute(GitLabClient client) { + Void execute(GiteeClient client) { client.changeBuildStatus(projectId, sha, state, ref, context, targetUrl, description); return null; } @@ -130,9 +130,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public void getCommit(final String projectId, final String sha) { execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Void execute(GitLabClient client) { + Void execute(GiteeClient client) { client.getCommit(projectId, sha); return null; } @@ -142,9 +142,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public void acceptMergeRequest(final MergeRequest mr, final String mergeCommitMessage, final boolean shouldRemoveSourceBranch) { execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Void execute(GitLabClient client) { + Void execute(GiteeClient client) { client.acceptMergeRequest(mr, mergeCommitMessage, shouldRemoveSourceBranch); return null; } @@ -155,9 +155,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public void createMergeRequestNote(final MergeRequest mr, final String body) { execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Void execute(GitLabClient client) { + Void execute(GiteeClient client) { client.createMergeRequestNote(mr, body); return null; } @@ -168,9 +168,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public List getMergeRequests(final String projectId, final State state, final int page, final int perPage) { return execute( - new GitLabOperation>() { + new GiteeOperation>() { @Override - List execute(GitLabClient client) { + List execute(GiteeClient client) { return client.getMergeRequests(projectId, state, page, perPage); } }); @@ -179,9 +179,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public List getBranches(final String projectId) { return execute( - new GitLabOperation>() { + new GiteeOperation>() { @Override - List execute(GitLabClient client) { + List execute(GiteeClient client) { return client.getBranches(projectId); } }); @@ -190,9 +190,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public Branch getBranch(final String projectId, final String branch) { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - Branch execute(GitLabClient client) { + Branch execute(GiteeClient client) { return client.getBranch(projectId, branch); } }); @@ -201,9 +201,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public User getCurrentUser() { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - User execute(GitLabClient client) { + User execute(GiteeClient client) { return client.getCurrentUser(); } }); @@ -212,9 +212,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public User addUser(final String email, final String username, final String name, final String password) { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - User execute(GitLabClient client) { + User execute(GiteeClient client) { return client.addUser(email, username, name, password); } }); @@ -223,9 +223,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public User updateUser(final String userId, final String email, final String username, final String name, final String password) { return execute( - new GitLabOperation() { + new GiteeOperation() { @Override - User execute(GitLabClient client) { + User execute(GiteeClient client) { return client.updateUser(userId, email, username, name, password); } }); @@ -234,9 +234,9 @@ final class AutodetectingGitLabClient implements GitLabClient { @Override public List