You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "valepakh (via GitHub)" <gi...@apache.org> on 2023/05/26 10:43:09 UTC

[GitHub] [ignite-3] valepakh opened a new pull request, #2109: IGNITE-19521 Rework units list command

valepakh opened a new pull request, #2109:
URL: https://github.com/apache/ignite-3/pull/2109

   https://issues.apache.org/jira/browse/IGNITE-19521


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] valepakh commented on a diff in pull request #2109: IGNITE-19521 Rework units list command

Posted by "valepakh (via GitHub)" <gi...@apache.org>.
valepakh commented on code in PR #2109:
URL: https://github.com/apache/ignite-3/pull/2109#discussion_r1214173015


##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/call/unit/ItDeployUndeployCallsTest.java:
##########
@@ -92,19 +101,21 @@ void deployListStatusUndeploy() {
         // Then
         assertThat(deployOutput.hasError()).isFalse();
         assertThat(deployOutput.body()).isEqualTo(MessageUiComponent.from(UiElements.done()).render());
-        // And list is not empty
-        List<UnitStatusRecord> unisStatuses = listUnitCall.execute(urlInput).body();
-        assertThat(unisStatuses.size()).isEqualTo(1);
-        // And status is not empty
-        await().untilAsserted(() -> assertThat(unitStatusCall.execute(statusInput("test.id"))).isNotNull());
+
+        await().untilAsserted(() -> {
+            // And list is not empty
+            List<UnitStatusRecord> unisStatuses = listUnitCall.execute(listAllInput()).body();
+            assertThat(unisStatuses.size()).isEqualTo(1);
+            Assertions.assertThat(unisStatuses.get(0).versionToStatus()).containsExactly(entry("1.0.0", DEPLOYED));

Review Comment:
   It's impossible because it will clash with other `assertThat`, this is the overload with `Map` parameter.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] PakhomovAlexander commented on a diff in pull request #2109: IGNITE-19521 Rework units list command

Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander commented on code in PR #2109:
URL: https://github.com/apache/ignite-3/pull/2109#discussion_r1214089624


##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/call/unit/ItDeployUndeployCallsTest.java:
##########
@@ -92,19 +101,21 @@ void deployListStatusUndeploy() {
         // Then
         assertThat(deployOutput.hasError()).isFalse();
         assertThat(deployOutput.body()).isEqualTo(MessageUiComponent.from(UiElements.done()).render());
-        // And list is not empty
-        List<UnitStatusRecord> unisStatuses = listUnitCall.execute(urlInput).body();
-        assertThat(unisStatuses.size()).isEqualTo(1);
-        // And status is not empty
-        await().untilAsserted(() -> assertThat(unitStatusCall.execute(statusInput("test.id"))).isNotNull());
+
+        await().untilAsserted(() -> {
+            // And list is not empty
+            List<UnitStatusRecord> unisStatuses = listUnitCall.execute(listAllInput()).body();
+            assertThat(unisStatuses.size()).isEqualTo(1);
+            Assertions.assertThat(unisStatuses.get(0).versionToStatus()).containsExactly(entry("1.0.0", DEPLOYED));

Review Comment:
   Use static import here, please.



##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/call/unit/ItDeployUndeployCallsTest.java:
##########
@@ -208,17 +213,12 @@ void deployStatusCheck() {
         // Then
         assertThat(deployOutput.hasError()).isFalse();
         assertThat(deployOutput.body()).isEqualTo(MessageUiComponent.from(UiElements.done()).render());
-        // And list is not empty
+
         await().untilAsserted(() -> {
-            List<UnitStatusRecord> unisStatuses = listUnitCall.execute(urlInput).body();
+            // And list is not empty
+            List<UnitStatusRecord> unisStatuses = listUnitCall.execute(listAllInput()).body();

Review Comment:
   ```suggestion
               List<UnitStatusRecord> unitsStatuses = listUnitCall.execute(listAllInput()).body();
   ```



##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/call/unit/ItDeployUndeployCallsTest.java:
##########
@@ -208,17 +213,12 @@ void deployStatusCheck() {
         // Then
         assertThat(deployOutput.hasError()).isFalse();
         assertThat(deployOutput.body()).isEqualTo(MessageUiComponent.from(UiElements.done()).render());
-        // And list is not empty
+
         await().untilAsserted(() -> {
-            List<UnitStatusRecord> unisStatuses = listUnitCall.execute(urlInput).body();
+            // And list is not empty
+            List<UnitStatusRecord> unisStatuses = listUnitCall.execute(listAllInput()).body();
             assertThat(unisStatuses.size()).isEqualTo(1);
-            assertThat(unisStatuses.get(0).versionToStatus().size()).isEqualTo(1);
-            assertThat(unisStatuses.get(0).versionToStatus().get("1.1.0"))
-                    .isNotNull()
-                    .matches(deploymentStatus -> deploymentStatus == DEPLOYED);
-
-            // And status is not empty
-            assertThat(unitStatusCall.execute(statusInput("test.id"))).isNotNull();
+            Assertions.assertThat(unisStatuses.get(0).versionToStatus()).containsExactly(entry("1.1.0", DEPLOYED));

Review Comment:
   static import



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] Pochatkin commented on a diff in pull request #2109: IGNITE-19521 Rework units list command

Posted by "Pochatkin (via GitHub)" <gi...@apache.org>.
Pochatkin commented on code in PR #2109:
URL: https://github.com/apache/ignite-3/pull/2109#discussion_r1214162586


##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/call/unit/ItDeployUndeployCallsTest.java:
##########
@@ -92,19 +101,21 @@ void deployListStatusUndeploy() {
         // Then
         assertThat(deployOutput.hasError()).isFalse();
         assertThat(deployOutput.body()).isEqualTo(MessageUiComponent.from(UiElements.done()).render());
-        // And list is not empty
-        List<UnitStatusRecord> unisStatuses = listUnitCall.execute(urlInput).body();
-        assertThat(unisStatuses.size()).isEqualTo(1);
-        // And status is not empty
-        await().untilAsserted(() -> assertThat(unitStatusCall.execute(statusInput("test.id"))).isNotNull());
+
+        await().untilAsserted(() -> {
+            // And list is not empty
+            List<UnitStatusRecord> unisStatuses = listUnitCall.execute(listAllInput()).body();

Review Comment:
   unitsStatuses



##########
modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/metastore/status/UnitKey.java:
##########
@@ -45,17 +44,24 @@ static String[] fromBytes(String prefix, byte[] key) {
         }
 
         String content = s.substring(prefix.length());
+        if (content.isEmpty()) {
+            return new String[0];
+        }
         return Arrays.stream(content.split(DELIMITER))
                 .map(e -> new String(Base64.getDecoder().decode(e), StandardCharsets.UTF_8))
                 .toArray(String[]::new);
     }
 
-    static ByteArray toByteArray(String prefix, String... args) {
+    static ByteArray toByteArray(String prefix, String id, String... args) {
         Encoder encoder = Base64.getEncoder();
-        String collect = Arrays.stream(args).filter(Objects::nonNull)
+
+        // Always add a delimiter if id is present so that the lookup on id will hapen on exact match

Review Comment:
   happen



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] PakhomovAlexander merged pull request #2109: IGNITE-19521 Rework units list command

Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander merged PR #2109:
URL: https://github.com/apache/ignite-3/pull/2109


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org