大声道撒旦
This commit is contained in:
parent
5598468fab
commit
c92c157864
@ -37,9 +37,6 @@ public class RepositoryBranch extends Entity<Long> {
|
||||
@Column(name = "last_commit_time")
|
||||
private LocalDateTime lastCommitTime;
|
||||
|
||||
@Column(name = "is_protected")
|
||||
private Boolean isProtected = false;
|
||||
|
||||
@Column(name = "developers_can_push")
|
||||
private Boolean developersCanPush = true;
|
||||
|
||||
@ -58,6 +55,6 @@ public class RepositoryBranch extends Entity<Long> {
|
||||
@Column(name = "project_id", nullable = false)
|
||||
private Long projectId;
|
||||
|
||||
@Column(name = "external_system_id")
|
||||
@Column(name = "external_system_id", nullable = false)
|
||||
private Long externalSystemId;
|
||||
}
|
||||
@ -130,7 +130,8 @@ public class GitServiceIntegrationImpl implements IGitServiceIntegration {
|
||||
entity,
|
||||
String.class
|
||||
);
|
||||
log.info("GitLab API raw response for project {}: {}", projectId, rawResponse.getBody());
|
||||
log.info("First branch from GitLab API: {}",
|
||||
rawResponse.getBody() != null ? rawResponse.getBody().split("},")[0] + "}" : null);
|
||||
|
||||
// 然后解析为对象
|
||||
ResponseEntity<List<GitBranchResponse>> response = restTemplate.exchange(
|
||||
@ -140,12 +141,7 @@ public class GitServiceIntegrationImpl implements IGitServiceIntegration {
|
||||
new ParameterizedTypeReference<>() {}
|
||||
);
|
||||
|
||||
List<GitBranchResponse> branches = response.getBody();
|
||||
if (branches != null && !branches.isEmpty()) {
|
||||
log.info("First branch details: {}", branches.get(0));
|
||||
}
|
||||
|
||||
return branches != null ? branches : Collections.emptyList();
|
||||
return response.getBody() != null ? response.getBody() : Collections.emptyList();
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to fetch git branches for system: {} and project: {}", system.getName(), projectId, e);
|
||||
return Collections.emptyList();
|
||||
|
||||
@ -18,8 +18,6 @@ public class GitBranchResponse {
|
||||
@JsonProperty("default")
|
||||
private Boolean isDefaultBranch;
|
||||
|
||||
private Boolean isProtected;
|
||||
|
||||
@JsonProperty("can_push")
|
||||
private Boolean canPush;
|
||||
|
||||
|
||||
@ -203,7 +203,6 @@ public class RepositoryBranchServiceImpl extends BaseServiceImpl<RepositoryBranc
|
||||
branch.setProjectId(projectId);
|
||||
branch.setName(remoteBranch.getName());
|
||||
branch.setIsDefaultBranch(remoteBranch.getIsDefaultBranch());
|
||||
branch.setIsProtected(remoteBranch.getIsProtected());
|
||||
branch.setCanPush(remoteBranch.getCanPush());
|
||||
branch.setDevelopersCanPush(remoteBranch.getDevelopersCanPush());
|
||||
branch.setDevelopersCanMerge(remoteBranch.getDevelopersCanMerge());
|
||||
|
||||
@ -351,7 +351,6 @@ CREATE TABLE deploy_repo_branch
|
||||
project_id BIGINT NOT NULL COMMENT '所属项目ID',
|
||||
external_system_id BIGINT NOT NULL COMMENT '外部系统ID',
|
||||
is_default_branch BIT DEFAULT 0 COMMENT '是否为默认分支:0-否,1-是',
|
||||
is_protected BIT DEFAULT 0 COMMENT '是否受保护:0-否,1-是',
|
||||
can_push BIT DEFAULT 1 COMMENT '是否可推送:0-否,1-是',
|
||||
developers_can_push BIT DEFAULT 1 COMMENT '开发者是否可推送:0-否,1-是',
|
||||
developers_can_merge BIT DEFAULT 1 COMMENT '开发者是否可合并:0-否,1-是',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user