Skip to content

Commit

Permalink
feat:流水线插件代码库开启默认分支保护 TencentBlueKing#9814
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Dec 15, 2023
1 parent 16c9b6e commit fa1d08f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1968,90 +1968,6 @@ class GitService @Autowired constructor(
)
}

override fun listMergeRequest(
token: String,
tokenType: TokenTypeEnum,
gitProjectId: String,
gitListMergeRequest: GitListMergeRequest
): Result<List<GitMrInfo>> {
val mrInfoList = with(gitListMergeRequest) {
if (tokenType == TokenTypeEnum.OAUTH) {
GitOauthApi().listMergeRequest(
host = gitConfig.gitApiUrl,
token = token,
projectName = gitProjectId,
sourceBranch = sourceBranch,
targetBranch = targetBranch,
state = state,
page = page,
perPage = perPage
)
} else {
GitApi().listMergeRequest(
host = gitConfig.gitApiUrl,
token = token,
projectName = gitProjectId,
sourceBranch = sourceBranch,
targetBranch = targetBranch,
state = state,
page = page,
perPage = perPage
)
}
}
return Result(mrInfoList)
}

override fun createBranch(
token: String,
tokenType: TokenTypeEnum,
gitProjectId: String,
gitCreateBranch: GitCreateBranch
): Result<Boolean> {
if (tokenType == TokenTypeEnum.OAUTH) {
GitOauthApi().createBranch(
host = gitConfig.gitApiUrl,
token = token,
projectName = gitProjectId,
branch = gitCreateBranch.branchName,
ref = gitCreateBranch.ref
)
} else {
GitApi().createBranch(
host = gitConfig.gitApiUrl,
token = token,
projectName = gitProjectId,
branch = gitCreateBranch.branchName,
ref = gitCreateBranch.ref
)
}
return Result(true)
}

override fun createMergeRequest(
token: String,
tokenType: TokenTypeEnum,
gitProjectId: String,
gitCreateMergeRequest: GitCreateMergeRequest
): Result<GitMrInfo> {
val mrInfo = if (tokenType == TokenTypeEnum.OAUTH) {
GitOauthApi().createMergeRequest(
host = gitConfig.gitApiUrl,
token = token,
projectName = gitProjectId,
gitCreateMergeRequest = gitCreateMergeRequest
)
} else {
GitApi().createMergeRequest(
host = gitConfig.gitApiUrl,
token = token,
projectName = gitProjectId,
gitCreateMergeRequest = gitCreateMergeRequest
)
}
return Result(mrInfo)
}

override fun getProtectBranchRuleId(
token: String,
tokenType: TokenTypeEnum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,27 +371,6 @@ interface IGitService {
ignoreWhiteSpace: Boolean?
): Result<List<GitDiff>>

fun createBranch(
token: String,
tokenType: TokenTypeEnum,
gitProjectId: String,
gitCreateBranch: GitCreateBranch
): Result<Boolean>

fun listMergeRequest(
token: String,
tokenType: TokenTypeEnum,
gitProjectId: String,
gitListMergeRequest: GitListMergeRequest
): Result<List<GitMrInfo>>

fun createMergeRequest(
token: String,
tokenType: TokenTypeEnum,
gitProjectId: String,
gitCreateMergeRequest: GitCreateMergeRequest
): Result<GitMrInfo>

fun getProtectBranchRuleId(
token: String,
tokenType: TokenTypeEnum,
Expand Down

0 comments on commit fa1d08f

Please sign in to comment.