Skip to content

Commit

Permalink
PLAT-1242 - remove condaEnv override option; simplify waitStatus addi…
Browse files Browse the repository at this point in the history
…tional steps logic;
  • Loading branch information
georgi-seqera committed Jan 24, 2025
1 parent 384d182 commit 764677c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public ProgressStepMessageSupplier(String sessionId, Long workspaceId) {

@Override
public String get() {

try {
DataStudioDto dataStudioDto = api().describeDataStudio(sessionId, workspaceId);

Expand All @@ -63,9 +62,9 @@ public String get() {
: String.format("\n %s - Error encountered: %s", currentProgressStep.getMessage(), dataStudioDto.getStatusInfo().getMessage());
}

return null;
return "";
} catch (Exception e) {
return null;
return "";
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,4 @@ public class DataStudioConfigurationOptions {
@CommandLine.Option(names = {"--mount-data"}, description = "Optional configuration override for 'mountData' setting (comma separate list of datalinkIds)", split = ",")
public List<String> mountData;

@CommandLine.Option(names = {"--conda-env"}, description = "Optional configuration override for 'condaEnvironment' setting (YAML conda packages configurations)")
public String condaEnvironment;

}
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ private DataStudioStartRequest getStartRequestWithOverridesApplied(DataStudioDto
dataStudioConfiguration.setMountData(dataStudioConfigOptions.mountData == null
? dataStudioConfiguration.getMountData()
: dataStudioConfigOptions.mountData);
dataStudioConfiguration.setCondaEnvironment(dataStudioConfigOptions.condaEnvironment == null
? dataStudioConfiguration.getCondaEnvironment()
: dataStudioConfigOptions.condaEnvironment);

String appliedDescription = description == null
? dataStudioDto.getDescription()
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/io/seqera/tower/cli/utils/ResponseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,7 @@ public static <S extends Enum<?>> Integer waitStatus(PrintWriter out, boolean sh
lastReported = status;
}
if (additionalProgressSteps != null) {
String progressStep = additionalProgressSteps.get();
if (progressStep != null) {
out.print(progressStep);
}
out.print(additionalProgressSteps.get());
}
out.flush();
}
Expand All @@ -187,10 +184,7 @@ public static <S extends Enum<?>> Integer waitStatus(PrintWriter out, boolean sh

if (showProgress) {
if (additionalProgressSteps != null) {
String progressStep = additionalProgressSteps.get();
if (progressStep != null) {
out.print(progressStep);
}
out.print(additionalProgressSteps.get());
}
out.print(currentPos == targetPos ? " [DONE]\n\n" : " [ERROR]\n\n");
out.flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ void testStart(OutputType format, MockServerClient mock) {
ExecOut out = exec(format, mock, "studios", "start", "-w", "75887156211589", "-i" ,"3e8370e7");

assertOutput(format, out, new DataStudioStartSubmitted("3e8370e7", 75887156211589L,
"[organization1 / workspace1]", "https://a3e8370e7.dev-tower.com", true));
"[organization1 / workspace1]", "http://localhost:"+mock.getPort()+"/orgs/organization1/workspaces/workspace1", true));
}

@ParameterizedTest
Expand Down Expand Up @@ -615,7 +615,7 @@ void testStartWithConfigOverride(OutputType format, MockServerClient mock) {
ExecOut out = exec(format, mock, "studios", "start", "-w", "75887156211589", "-i" ,"3e8370e7", "-c", "4", "--description", "Override description");

assertOutput(format, out, new DataStudioStartSubmitted("3e8370e7", 75887156211589L,
"[organization1 / workspace1]", "https://a3e8370e7.dev-tower.com", true));
"[organization1 / workspace1]", "http://localhost:"+mock.getPort()+"/orgs/organization1/workspaces/workspace1", true));
}

// Only run this test in json output format, since extra stdout output is printed out to console with --wait flag
Expand Down Expand Up @@ -676,7 +676,7 @@ void testStartWithWait(OutputType format, MockServerClient mock) {
ExecOut out = exec(format, mock, "studios", "start", "-w", "75887156211589", "-i" ,"3e8370e7", "--wait", "RUNNING");

assertOutput(format, out, new DataStudioStartSubmitted("3e8370e7", 75887156211589L,
"[organization1 / workspace1]", "https://a3e8370e7.dev-tower.com", true));
"[organization1 / workspace1]", "http://localhost:"+mock.getPort()+"/orgs/organization1/workspaces/workspace1", true));

// verify the API has been polled additionally for the status
mock.verify(request().withMethod("GET").withPath("/studios/3e8370e7"), VerificationTimes.exactly(4));
Expand Down

0 comments on commit 764677c

Please sign in to comment.