]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19789 Return initial_perm_sync in /api/components/show
authorAntoine Vigneau <antoine.vigneau@sonarsource.com>
Thu, 3 Aug 2023 15:01:07 +0000 (17:01 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 4 Aug 2023 20:04:15 +0000 (20:04 +0000)
server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectDto.java
server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml
server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ComponentDtoToWsComponent.java
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/component/ws/show-example.json
sonar-ws/src/main/protobuf/ws-components.proto

index dac8567ad3d484bf9c53518e08c7aab2544b0f4f..b26f5fbb94fb292aa5efac75a2a223acc6cf28b2 100644 (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;
+  }
 }
index dd94c2f4f374b2bf4bc2320e6a207d29155940c1..17bfd0b7209f0380b685df3162449453dad4259b 100644 (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">
       private,
       tags,
       created_at,
-      updated_at
+      updated_at,
+      initial_perm_sync
     )
     VALUES (
     #{kee,jdbcType=VARCHAR},
     #{isPrivate,jdbcType=BOOLEAN},
     #{tagsString, jdbcType=VARCHAR},
     #{createdAt,jdbcType=BIGINT},
-    #{updatedAt,jdbcType=BIGINT}
+    #{updatedAt,jdbcType=BIGINT},
+    #{initialPermSync,jdbcType=VARCHAR}
     )
   </insert>
 
index a99b7cdba70601147e9903b1b450fc420c320441..6cdec2ca0ea31304e5b2bb8c39f94678a2dc390c 100644 (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());
index 8054a7745d05213a996bee294ac3d406d40b93e4..07e148edf8fa5dc3ba5fdb7e3d458af8f8343643 100644 (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()));
index 26799f51714fa97a29852b8b4f6a9bb9789e672d..9ff5afb9569c05903e4c91339ce925b943780313 100644 (file)
@@ -29,7 +29,8 @@
         "language",
         "plugin"
       ],
-      "visibility": "private"
+      "visibility": "private",
+      "initialPermSync": "FINISHED"
     }
   ]
 }
index d51a8a2805bec0eeed82b9b85b45d273ba9541c7..f25736afaee5a5c40d7de9cc5a4f9f27b39d1d08 100644 (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;