Skip to content

Commit 935196b

Browse files
v1.0.3 (#280)
* .envrc patch * update loading spinner impelmentation to be more reactive * Resolve #279 * Resolves #276 * Resolves #272 * Resolves #271 * Resolves #281 * Resolves #282 * Resolves #273 * Resolves #270 * resolve #260 * Resolves #259 * version * chore: update checksums and version for 1.0.3-beta.1 (#283) Co-authored-by: toptobes <96998732+toptobes@users.noreply.github.com> * Resolves #262 * add "astra db endpoints list"; update some tests * bump version * chore: update checksums and version for v1.0.3 (#284) Co-authored-by: toptobes <96998732+toptobes@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 37f2ea8 commit 935196b

231 files changed

Lines changed: 2512 additions & 827 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ if nix --version &> /dev/null; then
77
fi
88

99
PATH_add scripts
10+
11+
unset DEVELOPER_DIR

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ Some commands, namely the ones that build on `cqlsh`, `dsbulk`, and `pulsar-shel
482482
astra db cqlsh mydb -k my_keyspace -f ./my_script.cql
483483
484484
# v1.x
485-
echo "SELECT * FROM my_table" | astra db cqlsh exec mydb -k my_keyspace
485+
echo "SELECT * FROM my_table" | astra db cqlsh exec mydb -k my_keyspace -e
486486
astra db cqlsh exec mydb -k my_keyspace "SELECT * FROM my_table"
487487
astra db cqlsh exec mydb -k my_keyspace -f ./my_script.cql
488488
```

build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
}
1717

1818
group = "com.dtsx.astra.cli"
19-
version = "1.0.2"
19+
version = "1.0.3"
2020

2121
val mockitoAgent = configurations.create("mockitoAgent")
2222

@@ -150,7 +150,8 @@ tasks.test {
150150

151151
jvmArgs = listOf(
152152
"--enable-native-access=ALL-UNNAMED",
153-
"-javaagent:${mockitoAgent.asPath}"
153+
"-javaagent:${mockitoAgent.asPath}",
154+
"-Duser.timezone=CST"
154155
)
155156
}
156157

lombok.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lombok.accessors.fluent = true

scripts/install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ function Get-Env {
117117
}
118118

119119
# Version (updated automatically by CI)
120-
$ASTRA_CLI_VERSION = "1.0.2"
120+
$ASTRA_CLI_VERSION = "1.0.3"
121121

122122
# Checksum constant (updated automatically by CI)
123-
$WINDOWS_X86_64_CHECKSUM = "ef4f7feca7c83cdf040810b877f3736239be368739b46f1a8f5da6a7783131f6"
123+
$WINDOWS_X86_64_CHECKSUM = "bac92ad514cedd07e21e9e5435f7361751c679a6d28b9ee8f4df000e88cc12d3"
124124

125125
if ($env:ASTRA_HOME) {
126126
$ASTRA_CLI_DIR = "$env:ASTRA_HOME\cli"

scripts/install.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ renderCommand() {
4545
printf "${BLUE}\$${RESET} %s\n" "$1"
4646
}
4747

48-
# Version (updated automatically by CI)
49-
ASTRA_CLI_VERSION="1.0.2"
48+
# Constants
49+
ASTRA_CLI_VERSION="1.0.3"
5050

5151
# Checksum constants (updated automatically by CI)
52-
LINUX_X86_64_CHECKSUM="9803787e9139ca51f52ae757a26116d2405dffba0a32a8f61093bead71ee78c6"
53-
LINUX_ARM64_CHECKSUM="ea94a1a729c5880139c703753b470eb61b7ac8edea2e75d30c3af0f345b7c713"
54-
MACOS_X86_64_CHECKSUM="8b873dfa3c75eaa17af8fde12f30f291558a0a2a5546f775b0ef207b49450edd"
55-
MACOS_ARM64_CHECKSUM="d868138f6714f3ed8f681283de8ff1a4c1318e592733821fbb6e75ae32547d0e"
52+
LINUX_X86_64_CHECKSUM="4e7fc02419f14baf5da3905323b8e2fc5bf192cda4fea8c550f0eeb93a286f7c"
53+
LINUX_ARM64_CHECKSUM="0fde0ddf84b30cf5f6e9a17cda744d4168c67aa8dd6bd5a14ff2f183e519c5f8"
54+
MACOS_X86_64_CHECKSUM="9d0edff05e251d64fd9ec54e39f51dc9b2503c8ff38768e2d2a1df0ca73cc417"
55+
MACOS_ARM64_CHECKSUM="508ca826cadebba997dbd1a8937840e2ba3f86a29e84960864cc9a78f45f9d8c"
5656

5757
if [ -n "${ASTRA_HOME:-}" ]; then
5858
ASTRA_CLI_DIR_RESOLVER="custom"

src/main/java/com/dtsx/astra/cli/AstraCli.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import lombok.Cleanup;
4141
import lombok.Getter;
4242
import lombok.SneakyThrows;
43-
import lombok.experimental.Accessors;
4443
import lombok.val;
4544
import org.apache.commons.lang3.ArrayUtils;
4645
import org.apache.commons.lang3.tuple.Pair;
@@ -54,6 +53,7 @@
5453

5554
import java.nio.file.FileSystems;
5655
import java.nio.file.Files;
56+
import java.sql.DataTruncation;
5757
import java.util.Arrays;
5858
import java.util.Optional;
5959
import java.util.StringJoiner;
@@ -142,7 +142,7 @@ public static void main(String... args) {
142142
CliPropertiesImpl.mkAndLoadSysProps(cliEnv, MemoizedCliProperties::new),
143143
OutputType.HUMAN,
144144
new AstraColors(Ansi.AUTO),
145-
new AstraLogger(Level.REGULAR, getCtx, false, Optional.empty(), Optional.empty()),
145+
new AstraLogger(Level.REGULAR, cliEnv, getCtx, false, Optional.empty(), Optional.empty()),
146146
new AstraConsole(System.in, mkPrintWriter(System.out, "stdout"), mkPrintWriter(System.err, "stderr"), null, getCtx, false),
147147
new AstraHome(getCtx),
148148
FileSystems.getDefault(),
@@ -155,7 +155,6 @@ public static void main(String... args) {
155155
}
156156

157157
@Getter
158-
@Accessors(fluent = true)
159158
private static @Nullable Supplier<CliContext> unsafeGlobalCliContext;
160159

161160
@SneakyThrows
@@ -182,8 +181,8 @@ public static int run(Ref<CliContext> ctxRef, String... args) {
182181
.setOverwrittenOptionsAllowed(true);
183182

184183
ctxRef.nowAndOnUpdate((ctx) -> {
185-
cmd.setOut(ctx.console().getOut());
186-
cmd.setErr(ctx.console().getErr());
184+
cmd.setOut(ctx.console().stdout());
185+
cmd.setErr(ctx.console().stderr());
187186
});
188187

189188
cmd.getSubcommands().get("help").getCommandSpec().usageMessage().hidden(true);
@@ -236,26 +235,26 @@ public static <T> T exit(int exitCode) {
236235

237236
public static class SetupExampleProvider implements ExampleProvider {
238237
@Override
239-
public Pair<String, String> get(CliContext ctx) {
238+
public Pair<String, String[]> get(CliContext ctx) {
240239
if (System.getProperty("cli.testing") == null) { // keeps output deterministic for testing
241240
try {
242241
val configFileExists = Files.exists(AstraConfig.resolveDefaultAstraConfigFile(ctx));
243242

244243
if (!configFileExists) {
245-
return Pair.of("Setup the Astra CLI", "${cli.name} setup");
244+
return Pair.of("Setup the Astra CLI", new String[] { "${cli.name} setup" });
246245
}
247246

248247
val autocompleteSetup = System.getenv(ConstEnvVars.COMPLETIONS_SETUP) != null;
249248

250249
if (!autocompleteSetup && ctx.isNotWindows()) {
251-
return Pair.of("Put this in your shell profile to generate completions and more!", "eval \"$(${cli.path} shellenv)\"");
250+
return Pair.of("Put this in your shell profile to generate completions and more!", new String[] { "eval \"$(${cli.path} shellenv)\"" });
252251
}
253252
} catch (Exception e) {
254253
ctx.log().exception("Error resolving main example for AstraCli", e);
255254
}
256255
}
257256

258-
return Pair.of("Create a new profile", "${cli.name} setup");
257+
return Pair.of("Create a new profile", new String[] { "${cli.name} setup"});
259258
}
260259
}
261260
}

src/main/java/com/dtsx/astra/cli/commands/AbstractCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ public final void run() {
126126
ctx.properties(),
127127
common.outputType(),
128128
new AstraColors(ansi),
129-
new AstraLogger(level, () -> ctx, common.shouldDumpLogs(), common.dumpLogsTo(), common.enableSpinner()),
130-
new AstraConsole(ctx.console().getIn(), ctx.console().getOut(), ctx.console().getErr(), ctx.console().getReadLineImpl(), () -> ctx, common.noInput()),
129+
new AstraLogger(level, ctx.env(), () -> ctx, common.shouldDumpLogs(), common.dumpLogsTo(), common.enableSpinner()),
130+
new AstraConsole(ctx.console().stdin(), ctx.console().stdout(), ctx.console().stderr(), ctx.console().readLineImpl(), () -> ctx, common.noInput()),
131131
ctx.home(),
132132
ctx.fs(),
133133
ctx.gateways(),

src/main/java/com/dtsx/astra/cli/commands/CommonOptions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import static com.dtsx.astra.cli.commands.AbstractCmd.SHOW_CUSTOM_DEFAULT;
1717

18-
@Accessors(fluent = true)
1918
@AllArgsConstructor
2019
@NoArgsConstructor
2120
public class CommonOptions extends HelpMixin { // I don't like extending here but mixins don't compose w/ arg groups :(

0 commit comments

Comments
 (0)