Skip to content

Commit 71e336d

Browse files
authored
Merge for 2.29.0 release (#262)
## Usage and product changes Merge for 2.29.0 release
2 parents fe6a500 + 2c46a3f commit 71e336d

File tree

7 files changed

+89
-42
lines changed

7 files changed

+89
-42
lines changed

.circleci/config.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version: 2.1
66

77
orbs:
88
win: circleci/[email protected]
9+
macos: circleci/[email protected]
910

1011
executors:
1112
linux-arm64-amazonlinux-2:
@@ -32,11 +33,6 @@ executors:
3233
resource_class: macos.m1.medium.gen1
3334
working_directory: ~/typedb-console
3435

35-
mac-x86_64:
36-
macos:
37-
xcode: "13.4.1"
38-
working_directory: ~/typedb-console
39-
4036
win-x86_64:
4137
resource_class: windows.xlarge
4238
machine:
@@ -70,9 +66,16 @@ commands:
7066
mv "bazelisk-linux-<<parameters.arch>>" /usr/local/bin/bazel
7167
chmod a+x /usr/local/bin/bazel
7268
73-
install-bazel-brew:
69+
install-bazel-mac:
70+
parameters:
71+
bazel-arch:
72+
type: string
7473
steps:
75-
- run: brew install bazelisk
74+
- run: |
75+
brew install [email protected]
76+
curl -OL "https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-darwin-<<parameters.bazel-arch>>"
77+
sudo mv "bazelisk-darwin-<<parameters.bazel-arch>>" /usr/local/bin/bazel
78+
chmod a+x /usr/local/bin/bazel
7679
7780
jobs:
7881
deploy-artifact-snapshot-linux-x86_64:
@@ -98,10 +101,12 @@ jobs:
98101
bazel run --define version=$(git rev-parse HEAD) //:deploy-linux-arm64-targz -- snapshot
99102
100103
deploy-artifact-snapshot-mac-x86_64:
101-
executor: mac-x86_64
104+
executor: mac-arm64
102105
steps:
103106
- checkout
104-
- install-bazel-brew
107+
- macos/install-rosetta
108+
- install-bazel-mac:
109+
bazel-arch: amd64
105110
- run: |
106111
export DEPLOY_ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
107112
export DEPLOY_ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
@@ -111,7 +116,8 @@ jobs:
111116
executor: mac-arm64
112117
steps:
113118
- checkout
114-
- install-bazel-brew
119+
- install-bazel-mac:
120+
bazel-arch: arm64
115121
- run: |
116122
export DEPLOY_ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
117123
export DEPLOY_ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
@@ -148,10 +154,12 @@ jobs:
148154
bazel run --define version=$(cat VERSION) //:deploy-linux-arm64-targz --compilation_mode=opt -- release
149155
150156
deploy-artifact-release-mac-x86_64:
151-
executor: mac-x86_64
157+
executor: mac-arm64
152158
steps:
153159
- checkout
154-
- install-bazel-brew
160+
- macos/install-rosetta
161+
- install-bazel-mac:
162+
bazel-arch: amd64
155163
- run: |
156164
export DEPLOY_ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
157165
export DEPLOY_ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
@@ -161,7 +169,8 @@ jobs:
161169
executor: mac-arm64
162170
steps:
163171
- checkout
164-
- install-bazel-brew
172+
- install-bazel-mac:
173+
bazel-arch: arm64
165174
- run: |
166175
export DEPLOY_ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
167176
export DEPLOY_ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD

RELEASE_NOTES_LATEST.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
## Distribution
22

3-
Download from TypeDB Package Repository: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-console+version:2.28.4
3+
Download from TypeDB Package Repository: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-console+version:2.29.0
44

55

66
## New Features
7+
- **TypeQL queries executed via source command are asynchronous**
8+
TypeQL files executed via source command are asynchronous
9+
10+
11+
- **Directly specify password in the 'password-update' command**
12+
13+
It is now possible to invoke `password-update` command and specify the password together, instead of having to supply them in the following prompt. This new variant makes it possible to call it non-interactively.
14+
715

816
## Bugs Fixed
9-
- **Remove hard-coded value for transaction timeout**
10-
Removes a hard-coded value for transaction timeout, which prevented the user's setting from taking effect.
17+
1118

1219
## Code Refactors
1320

21+
1422
## Other Improvements
15-
- **Bump dependencies for rules-python & pin CircleCI windows executor**
16-
Bump dependencies for rules-python update. This fixes an error on windows builds in CircleCI.
17-
We also pin the image used for Windows builds on CircleCI to prevent updates from breaking the pipeline.
23+
- **Migrate CircleCI mac jobs to arm64 executors**
24+
Migrates the CircleCI mac jobs to arm64 executors
1825

19-
- **Turn off statistics reporting in CI**
20-
We turn off the statistics reporting in our CI builds not to send non-real diagnostics data.

TypeDBConsole.java

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import com.vaticle.typedb.driver.api.answer.ConceptMapGroup;
2323
import com.vaticle.typedb.driver.api.answer.JSON;
2424
import com.vaticle.typedb.driver.api.answer.ValueGroup;
25-
import com.vaticle.typedb.driver.api.concept.value.Value;
2625
import com.vaticle.typedb.driver.api.database.Database;
2726
import com.vaticle.typedb.driver.api.user.User;
27+
import com.vaticle.typedb.driver.common.Promise;
2828
import com.vaticle.typedb.driver.common.exception.TypeDBDriverException;
2929
import com.vaticle.typeql.lang.TypeQL;
3030
import com.vaticle.typeql.lang.common.TypeQLArg;
@@ -409,6 +409,17 @@ private boolean runInlineCommandMode(CLIOptions options, List<String> inlineComm
409409
} else if (command.isUserCreate()) {
410410
boolean success = runUserCreate(driver, isCloud, command.asUserCreate().user(), command.asUserCreate().password());
411411
if (!success) return false;
412+
} else if (command.isUserPasswordUpdate()) {
413+
REPLCommand.User.PasswordUpdate userPasswordUpdate = command.asUserPasswordUpdate();
414+
boolean passwordUpdateSuccessful = runUserPasswordUpdate(driver,
415+
isCloud,
416+
options.username,
417+
userPasswordUpdate.passwordOld(),
418+
userPasswordUpdate.passwordNew());
419+
if (passwordUpdateSuccessful) {
420+
printer.info("Please login again with your updated password.");
421+
break;
422+
} else return false;
412423
} else if (command.isUserDelete()) {
413424
boolean success = runUserDelete(driver, isCloud, command.asUserDelete().user());
414425
if (!success) return false;
@@ -708,7 +719,8 @@ private RunQueriesResult runSource(TypeDBTransaction tx, String file, boolean pr
708719
private RunQueriesResult runQueries(TypeDBTransaction tx, String queryString) {
709720
Optional<List<TypeQLQuery>> queries = parseQueries(queryString);
710721
if (queries.isEmpty()) return RunQueriesResult.error();
711-
queries.get().forEach(query -> runQuery(tx, query));
722+
List<Runnable> promiseResolvers = queries.get().stream().map(query -> runQuery(tx, query)).collect(toList());
723+
promiseResolvers.forEach(Runnable::run);
712724
boolean hasChanges = queries.get().stream().anyMatch(query -> query.type() == TypeQLArg.QueryType.WRITE);
713725
return new RunQueriesResult(true, hasChanges);
714726
}
@@ -722,34 +734,48 @@ private RunQueriesResult runQueriesPrintAnswers(TypeDBTransaction tx, String que
722734
}
723735

724736
@SuppressWarnings("CheckReturnValue")
725-
private void runQuery(TypeDBTransaction tx, TypeQLQuery query) {
737+
private Runnable runQuery(TypeDBTransaction tx, TypeQLQuery query) {
726738
if (query instanceof TypeQLDefine) {
727739
tx.query().define(query.asDefine()).resolve();
728740
printer.info("Concepts have been defined");
741+
return () -> {};
729742
} else if (query instanceof TypeQLUndefine) {
730743
tx.query().undefine(query.asUndefine()).resolve();
731744
printer.info("Concepts have been undefined");
745+
return () -> {};
732746
} else if (query instanceof TypeQLInsert) {
733-
Optional<ConceptMap> ignore = tx.query().insert(query.asInsert()).findFirst();
747+
return findFirstMayThrow(tx.query().insert(query.asInsert()));
734748
} else if (query instanceof TypeQLDelete) {
735-
tx.query().delete(query.asDelete()).resolve();
749+
return resolvePromiseMayThrow(tx.query().delete(query.asDelete()));
736750
} else if (query instanceof TypeQLUpdate) {
737-
Optional<ConceptMap> ignore = tx.query().update(query.asUpdate()).findFirst();
751+
return findFirstMayThrow(tx.query().update(query.asUpdate()));
738752
} else if (query instanceof TypeQLGet) {
739-
Optional<ConceptMap> ignore = tx.query().get(query.asGet()).findFirst();
753+
return findFirstMayThrow(tx.query().get(query.asGet()));
740754
} else if (query instanceof TypeQLGet.Aggregate) {
741-
Optional<Value> ignore = tx.query().get(query.asGetAggregate()).resolve();
755+
return resolvePromiseMayThrow(tx.query().get(query.asGetAggregate()));
742756
} else if (query instanceof TypeQLGet.Group) {
743-
Optional<ConceptMapGroup> ignore = tx.query().get(query.asGetGroup()).findFirst();
757+
return findFirstMayThrow(tx.query().get(query.asGetGroup()));
744758
} else if (query instanceof TypeQLGet.Group.Aggregate) {
745-
Optional<ValueGroup> ignore = tx.query().get(query.asGetGroupAggregate()).findFirst();
759+
return findFirstMayThrow(tx.query().get(query.asGetGroupAggregate()));
746760
} else if (query instanceof TypeQLFetch) {
747-
Optional<JSON> ignore = tx.query().fetch(query.asFetch()).findFirst();
761+
return findFirstMayThrow(tx.query().fetch(query.asFetch()));
748762
} else {
749763
throw new TypeDBConsoleException("Query is of unrecognized type: " + query);
750764
}
751765
}
752766

767+
private Runnable findFirstMayThrow(Stream<?> stream) {
768+
return () -> {
769+
Optional<?> ignore = stream.findFirst();
770+
};
771+
}
772+
773+
private Runnable resolvePromiseMayThrow(Promise<?> promise) {
774+
return () -> {
775+
Object ignore = promise.resolve();
776+
};
777+
}
778+
753779
private void runQueryPrintAnswers(TypeDBTransaction tx, TypeQLQuery query) {
754780
if (query instanceof TypeQLDefine) {
755781
tx.query().define(query.asDefine()).resolve();

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.28.4
1+
2.29.0

command/REPLCommand.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public User.Create asUserCreate() {
379379
public static class PasswordUpdate extends REPLCommand.User {
380380

381381
public static String token = "password-update";
382-
private static String helpCommand = User.token + " " + token;
382+
private static String helpCommand = User.token + " " + token + " [old-password new-password]";
383383
private static String description = "Update the password of the current user";
384384

385385
private final String passwordOld;
@@ -751,10 +751,17 @@ static REPLCommand readREPLCommand(String line, @Nullable LineReader passwordRea
751751
if (passwordReader == null) throw new TypeDBConsoleException(UNABLE_TO_READ_PASSWORD_INTERACTIVELY);
752752
String password = Utils.readPassword(passwordReader, "Password: ");
753753
command = new User.Create(name, password);
754-
} else if (tokens.length == 2 && tokens[0].equals(User.token) && tokens[1].equals(User.PasswordUpdate.token)) {
755-
if (passwordReader == null) throw new TypeDBConsoleException(UNABLE_TO_READ_PASSWORD_INTERACTIVELY);
756-
String passwordOld = Utils.readPassword(passwordReader, "Old password: ");
757-
String passwordNew = Utils.readPassword(passwordReader, "New password: ");
754+
} else if ((tokens.length == 2 || tokens.length == 4) && tokens[0].equals(User.token) && tokens[1].equals(User.PasswordUpdate.token)) {
755+
String passwordOld;
756+
String passwordNew;
757+
if (tokens.length == 2) {
758+
if (passwordReader == null) throw new TypeDBConsoleException(UNABLE_TO_READ_PASSWORD_INTERACTIVELY);
759+
passwordOld = Utils.readPassword(passwordReader, "Old password: ");
760+
passwordNew = Utils.readPassword(passwordReader, "New password: ");
761+
} else {
762+
passwordOld = tokens[2];
763+
passwordNew = tokens[3];
764+
}
758765
command = new User.PasswordUpdate(passwordOld, passwordNew);
759766
} else if (tokens.length == 3 && tokens[0].equals(User.token) && tokens[1].equals(User.PasswordSet.token)) {
760767
String name = tokens[2];

dependencies/maven/artifacts.snapshot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
@maven//:com_googlecode_java_diff_utils_diffutils_1_3_0
2929
@maven//:com_squareup_okhttp_okhttp_2_7_5
3030
@maven//:com_squareup_okio_okio_1_17_5
31-
@maven//:com_vaticle_typedb_typedb_cloud_runner_2_28_3
32-
@maven//:com_vaticle_typedb_typedb_common_2_28_1
33-
@maven//:com_vaticle_typedb_typedb_runner_2_28_3
31+
@maven//:com_vaticle_typedb_typedb_cloud_runner_0_0_0_5dac26a166b026e306f2e1cd86462785a85c997d
32+
@maven//:com_vaticle_typedb_typedb_common_2_28_6
33+
@maven//:com_vaticle_typedb_typedb_runner_0_0_0_bf02c9c734eec2cb71ddaaa9f7050e18c2a003eb
3434
@maven//:com_vdurmont_semver4j_3_1_0
3535
@maven//:commons_codec_commons_codec_1_13
3636
@maven//:commons_io_commons_io_2_3

dependencies/vaticle/repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def vaticle_typedb_driver():
1515
git_repository(
1616
name = "vaticle_typedb_driver",
1717
remote = "https://github.com/vaticle/typedb-driver",
18-
tag = "2.28.4", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_driver
18+
tag = "2.29.0", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_driver
1919
)

0 commit comments

Comments
 (0)