Browse Source

SONAR-19789 Return initial_perm_sync in /api/components/show

tags/10.2.0.77647
Antoine Vigneau 9 months ago
parent
commit
97f8a1b245

+ 10
- 0
server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectDto.java View File

@@ -33,6 +33,7 @@ public class ProjectDto extends EntityDto {
private String tags;
private long createdAt;
private long updatedAt;
private String initialPermSync;

public long getCreatedAt() {
return createdAt;
@@ -113,4 +114,13 @@ public class ProjectDto extends EntityDto {
this.qualifier = qualifier;
return this;
}

public String getInitialPermSync() {
return initialPermSync;
}

public ProjectDto setInitialPermSync(@Nullable String initialPermSync) {
this.initialPermSync = initialPermSync;
return this;
}
}

+ 6
- 3
server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml View File

@@ -11,7 +11,8 @@
p.tags as tagsString,
p.private as isPrivate,
p.created_at as createdAt,
p.updated_at as updatedAt
p.updated_at as updatedAt,
p.initial_perm_sync as initialPermSync
</sql>

<select id="selectAllProjectUuids" resultType="String">
@@ -163,7 +164,8 @@
private,
tags,
created_at,
updated_at
updated_at,
initial_perm_sync
)
VALUES (
#{kee,jdbcType=VARCHAR},
@@ -174,7 +176,8 @@
#{isPrivate,jdbcType=BOOLEAN},
#{tagsString, jdbcType=VARCHAR},
#{createdAt,jdbcType=BIGINT},
#{updatedAt,jdbcType=BIGINT}
#{updatedAt,jdbcType=BIGINT},
#{initialPermSync,jdbcType=VARCHAR}
)
</insert>


+ 2
- 1
server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/ShowActionIT.java View File

@@ -478,7 +478,8 @@ public class ShowActionIT {
.setName("Java Markdown")
.setDescription("Java Markdown Project")
.setQualifier(Qualifiers.PROJECT),
p -> p.setTagsString("language, plugin"));
p -> p.setTagsString("language, plugin")
.setInitialPermSync("FINISHED"));
ComponentDto mainBranch = projectData.getMainBranchComponent();
userSession.addProjectPermission(USER, projectData.getProjectDto())
.registerBranches(projectData.getMainBranchDto());

+ 1
- 0
server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ComponentDtoToWsComponent.java View File

@@ -51,6 +51,7 @@ class ComponentDtoToWsComponent {
.setQualifier(project.getQualifier());

ofNullable(emptyToNull(project.getDescription())).ifPresent(wsComponent::setDescription);
ofNullable(emptyToNull(project.getInitialPermSync())).ifPresent(wsComponent::setInitialPermSync);
ofNullable(lastAnalysis).ifPresent(
analysis -> {
wsComponent.setAnalysisDate(formatDateTime(analysis.getCreatedAt()));

+ 2
- 1
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/component/ws/show-example.json View File

@@ -29,7 +29,8 @@
"language",
"plugin"
],
"visibility": "private"
"visibility": "private",
"initialPermSync": "FINISHED"
}
]
}

+ 1
- 0
sonar-ws/src/main/protobuf/ws-components.proto View File

@@ -114,6 +114,7 @@ message Component {
optional string version = 19;
optional string pullRequest = 20;
optional bool needIssueSync = 21;
optional string initialPermSync = 22;

message Tags {
repeated string tags = 1;

Loading…
Cancel
Save