Skip to content

Commit e372e35

Browse files
[PLAT-1567] - Studio rename start-as-new command to add-as-new to reflect better the functionality. (#492)
1 parent 5f11aff commit e372e35

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

conf/reflect-config.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,12 @@
15431543
"allDeclaredFields":true,
15441544
"queryAllDeclaredMethods":true
15451545
},
1546+
{
1547+
"name":"io.seqera.tower.cli.commands.studios.AddAsNewCmd",
1548+
"allDeclaredFields":true,
1549+
"queryAllDeclaredMethods":true,
1550+
"methods":[{"name":"<init>","parameterTypes":[] }]
1551+
},
15461552
{
15471553
"name":"io.seqera.tower.cli.commands.studios.AddCmd",
15481554
"allDeclaredFields":true,
@@ -1591,12 +1597,6 @@
15911597
"queryAllDeclaredMethods":true,
15921598
"methods":[{"name":"<init>","parameterTypes":[] }]
15931599
},
1594-
{
1595-
"name":"io.seqera.tower.cli.commands.studios.StartAsNewCmd",
1596-
"allDeclaredFields":true,
1597-
"queryAllDeclaredMethods":true,
1598-
"methods":[{"name":"<init>","parameterTypes":[] }]
1599-
},
16001600
{
16011601
"name":"io.seqera.tower.cli.commands.studios.StartCmd",
16021602
"allDeclaredFields":true,

src/main/java/io/seqera/tower/cli/commands/StudiosCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import io.seqera.tower.cli.commands.studios.CheckpointsCmd;
2222
import io.seqera.tower.cli.commands.studios.DeleteCmd;
2323
import io.seqera.tower.cli.commands.studios.ListCmd;
24-
import io.seqera.tower.cli.commands.studios.StartAsNewCmd;
24+
import io.seqera.tower.cli.commands.studios.AddAsNewCmd;
2525
import io.seqera.tower.cli.commands.studios.StartCmd;
2626
import io.seqera.tower.cli.commands.studios.TemplatesCmd;
2727
import io.seqera.tower.cli.commands.studios.StopCmd;
@@ -38,7 +38,7 @@
3838
AddCmd.class,
3939
TemplatesCmd.class,
4040
CheckpointsCmd.class,
41-
StartAsNewCmd.class,
41+
AddAsNewCmd.class,
4242
StopCmd.class,
4343
DeleteCmd.class,
4444
}

src/main/java/io/seqera/tower/cli/commands/studios/StartAsNewCmd.java renamed to src/main/java/io/seqera/tower/cli/commands/studios/AddAsNewCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
import java.util.Objects;
3636

3737
@CommandLine.Command(
38-
name = "start-as-new",
39-
description = "Start a new studio from an existing one."
38+
name = "add-as-new",
39+
description = "Add a new studio from an existing one."
4040
)
41-
public class StartAsNewCmd extends AbstractStudiosCmd{
41+
public class AddAsNewCmd extends AbstractStudiosCmd{
4242

4343
@CommandLine.Mixin
4444
public ParentStudioRefOptions parentStudioRefOptions;

src/main/java/io/seqera/tower/cli/commands/studios/ParentStudioRefOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public class ParentStudioRefOptions {
2525
public ParentStudioRef studio;
2626

2727
public static class ParentStudioRef {
28-
@CommandLine.Option(names = {"-pid", "--parentId"}, description = "Parent Studio session ID.")
28+
@CommandLine.Option(names = {"-pid", "--parent-id"}, description = "Parent Studio session ID.")
2929
public String sessionId;
3030

31-
@CommandLine.Option(names = {"-pn", "--parentName"}, description = "Parent Studio name.")
31+
@CommandLine.Option(names = {"-pn", "--parent-name"}, description = "Parent Studio name.")
3232
public String name;
3333
}
3434
}

src/test/java/io/seqera/tower/cli/studios/StudiosCmdTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ void testAddWithAutoStartAndWait(OutputType format, MockServerClient mock){
12001200

12011201
@ParameterizedTest
12021202
@EnumSource(OutputType.class)
1203-
void testStartAsNew(OutputType format, MockServerClient mock) throws JsonProcessingException {
1203+
void testAddAsNew(OutputType format, MockServerClient mock) throws JsonProcessingException {
12041204

12051205
mock.when(
12061206
request().withMethod("GET").withPath("/user-info"), exactly(2)
@@ -1236,7 +1236,7 @@ void testStartAsNew(OutputType format, MockServerClient mock) throws JsonProcess
12361236
response().withStatusCode(200).withBody(loadResource("studios/studios_start_as_new_response")).withContentType(MediaType.APPLICATION_JSON)
12371237
);
12381238

1239-
ExecOut out = exec(format, mock, "studios", "start-as-new", "-pid", "3e8370e7", "-n", "child-studio-a66d", "-w", "75887156211589", "--cpu", "4");
1239+
ExecOut out = exec(format, mock, "studios", "add-as-new", "-pid", "3e8370e7", "-n", "child-studio-a66d", "-w", "75887156211589", "--cpu", "4");
12401240

12411241
assertOutput(format, out, new StudiosCreated("8aebf1b8",75887156211589L, "[organization1 / workspace1]",
12421242
"http://localhost:"+mock.getPort()+"/orgs/organization1/workspaces/workspace1", false));
@@ -1297,7 +1297,7 @@ void testStartAsNew(OutputType format, MockServerClient mock) throws JsonProcess
12971297

12981298
@ParameterizedTest
12991299
@EnumSource(OutputType.class)
1300-
void testStartAsNewUsingParentName(OutputType format, MockServerClient mock) {
1300+
void testAddAsNewUsingParentName(OutputType format, MockServerClient mock) {
13011301

13021302
mock.when(
13031303
request().withMethod("GET").withPath("/user-info"), exactly(2)
@@ -1339,15 +1339,15 @@ void testStartAsNewUsingParentName(OutputType format, MockServerClient mock) {
13391339
response().withStatusCode(200).withBody(loadResource("studios/studios_start_as_new_response")).withContentType(MediaType.APPLICATION_JSON)
13401340
);
13411341

1342-
ExecOut out = exec(format, mock, "studios", "start-as-new", "-pn", "studio-a66d", "-n", "child-studio-a66d", "-w", "75887156211589", "--cpu", "4");
1342+
ExecOut out = exec(format, mock, "studios", "add-as-new", "-pn", "studio-a66d", "-n", "child-studio-a66d", "-w", "75887156211589", "--cpu", "4");
13431343

13441344
assertOutput(format, out, new StudiosCreated("8aebf1b8", 75887156211589L, "[organization1 / workspace1]",
13451345
"http://localhost:"+mock.getPort()+"/orgs/organization1/workspaces/workspace1", false));
13461346
}
13471347

13481348
@ParameterizedTest
13491349
@EnumSource(OutputType.class)
1350-
void testStartAsNewUsingParentCheckpointId(OutputType format, MockServerClient mock) {
1350+
void testAddAsNewUsingParentCheckpointId(OutputType format, MockServerClient mock) {
13511351

13521352
mock.when(
13531353
request().withMethod("GET").withPath("/user-info"), exactly(2)
@@ -1387,15 +1387,15 @@ void testStartAsNewUsingParentCheckpointId(OutputType format, MockServerClient m
13871387
response().withStatusCode(200).withBody(loadResource("studios/studios_start_as_new_response")).withContentType(MediaType.APPLICATION_JSON)
13881388
);
13891389

1390-
ExecOut out = exec(format, mock, "studios", "start-as-new", "-pn", "studio-a66d", "-n", "child-studio-a66d", "-w", "75887156211589", "--parent-checkpoint-id", "1");
1390+
ExecOut out = exec(format, mock, "studios", "add-as-new", "-pn", "studio-a66d", "-n", "child-studio-a66d", "-w", "75887156211589", "--parent-checkpoint-id", "1");
13911391

13921392
assertOutput(format, out, new StudiosCreated("8aebf1b8", 75887156211589L, "[organization1 / workspace1]",
13931393
"http://localhost:"+mock.getPort()+"/orgs/organization1/workspaces/workspace1", false));
13941394
}
13951395

13961396
@ParameterizedTest
13971397
@EnumSource(OutputType.class)
1398-
void testStartAsNewThrowsInvalidDataStudioParentCheckpointException(OutputType format, MockServerClient mock) {
1398+
void testAddAsNewThrowsInvalidDataStudioParentCheckpointException(OutputType format, MockServerClient mock) {
13991399

14001400
mock.when(
14011401
request().withMethod("GET").withPath("/user-info"), exactly(2)
@@ -1437,7 +1437,7 @@ void testStartAsNewThrowsInvalidDataStudioParentCheckpointException(OutputType f
14371437
response().withStatusCode(200).withBody(loadResource("studios/studios_start_as_new_response")).withContentType(MediaType.APPLICATION_JSON)
14381438
);
14391439

1440-
ExecOut out = exec(format, mock, "studios", "start-as-new", "-pn", "studio-a66d", "-n", "child-studio-a66d", "-w", "75887156211589", "--parent-checkpoint-id", "1111");
1440+
ExecOut out = exec(format, mock, "studios", "add-as-new", "--parent-name", "studio-a66d", "-n", "child-studio-a66d", "-w", "75887156211589", "--parent-checkpoint-id", "1111");
14411441

14421442
assertEquals(errorMessage(out.app, new InvalidDataStudioParentCheckpointException("1111")), out.stdErr);
14431443
assertEquals("", out.stdOut);

0 commit comments

Comments
 (0)