Skip to content

Commit 0e7efb7

Browse files
authored
Merge for 2.28.6-rc0 release (#678)
## Usage and product changes Merge for 2.28.6-rc0 release
2 parents 6cfb17d + 2df397c commit 0e7efb7

File tree

78 files changed

+1609
-213
lines changed

Some content is hidden

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

78 files changed

+1609
-213
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ commands:
119119
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip39 -- snapshot
120120
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip310 -- snapshot
121121
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip311 -- snapshot
122+
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip312 -- snapshot
122123
123124
test-pip-snapshot-unix:
124125
steps:
@@ -161,6 +162,7 @@ commands:
161162
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip39 --compilation_mode=opt -- release
162163
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip310 --compilation_mode=opt -- release
163164
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip311 --compilation_mode=opt -- release
165+
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip312 --compilation_mode=opt -- release
164166
165167
166168
#########################
@@ -609,7 +611,6 @@ jobs:
609611
bazel-arch: amd64
610612
- deploy-crate-snapshot-unix
611613
- deploy-maven-snapshot-unix
612-
- install-npm-apt
613614
- deploy-npm-snapshot-unix
614615

615616
deploy-snapshot-dotnet-any:
@@ -766,7 +767,6 @@ jobs:
766767
bazel-arch: amd64
767768
- deploy-crate-release-unix
768769
- deploy-maven-release-unix
769-
- install-npm-apt
770770
- deploy-npm-release-unix
771771

772772
deploy-release-dotnet-any:

.circleci/windows/python/deploy_release.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ IF %errorlevel% NEQ 0 EXIT /b %errorlevel%
3737

3838
bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip311 --compilation_mode=opt -- release
3939
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%
40+
41+
bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip312 --compilation_mode=opt -- release
42+
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

.circleci/windows/python/deploy_snapshot.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ IF %errorlevel% NEQ 0 EXIT /b %errorlevel%
3838

3939
bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip311 -- snapshot
4040
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%
41+
42+
bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip312 -- snapshot
43+
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

.factory/automation.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ config:
2626
build:
2727
quality:
2828
filter:
29-
owner: vaticle
29+
owner: typedb
3030
branch: [master, development]
3131
dependency-analysis:
3232
image: vaticle-ubuntu-22.04
@@ -125,7 +125,7 @@ build:
125125
machine: 8-core-32-gb
126126
image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
127127
filter:
128-
owner: vaticle
128+
owner: typedb
129129
branch: [master, development]
130130
dependencies:
131131
- build
@@ -149,7 +149,7 @@ build:
149149
machine: 8-core-32-gb
150150
image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
151151
filter:
152-
owner: vaticle
152+
owner: typedb
153153
branch: [master, development]
154154
dependencies:
155155
- build
@@ -287,12 +287,13 @@ build:
287287
288288
tool/test/start-core-server.sh &&
289289
bazel test //python/tests/integration:test_stream --test_output=streamed --jobs=1 &&
290+
bazel test //python/tests/integration:test_core_connection --test_output=streamed --jobs=1 &&
290291
export CORE_FAILED= || export CORE_FAILED=1
291292
tool/test/stop-core-server.sh
292293
if [[ -n "$CORE_FAILED" ]]; then exit 1; fi
293294
294295
source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars
295-
bazel test //python/tests/integration:test_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
296+
bazel test //python/tests/integration:test_cloud_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
296297
# TODO #635: currently broken test
297298
# bazel test //python/tests/integration:test_cloud_failover --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
298299
export CLOUD_FAILED= || export CLOUD_FAILED=1
@@ -508,7 +509,7 @@ build:
508509
sync-dependencies:
509510
image: vaticle-ubuntu-22.04
510511
filter:
511-
owner: vaticle
512+
owner: typedb
512513
branch: [master, development]
513514
dependencies:
514515
- build
@@ -545,7 +546,7 @@ build:
545546

546547
release:
547548
filter:
548-
owner: vaticle
549+
owner: typedb
549550
branch: [master]
550551
validation:
551552
validate-dependencies:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See the table below for links to README files, documentation, and source code.
1919
| Java | [README](https://github.com/vaticle/typedb-driver/tree/development/java/README.md) | [Documentation](https://typedb.com/docs/drivers/java/overview) | [`java/`](https://github.com/vaticle/typedb-driver/tree/development/java) |
2020
| C | [README](https://github.com/vaticle/typedb-driver/tree/development/c/README.md) | See C++ | [`c/`](https://github.com/vaticle/typedb-driver/tree/development/c) |
2121
| C++ | [README](https://github.com/vaticle/typedb-driver/tree/development/cpp/README.md) | [Documentation](https://typedb.com/docs/drivers/cpp/overview) | [`cpp/`](https://github.com/vaticle/typedb-driver/tree/development/cpp) |
22-
| C# | [README](https://github.com/vaticle/typedb-driver/tree/development/csharp/README.md) | (Coming soon!) | [`csharp/`](https://github.com/vaticle/typedb-driver/tree/development/csharp) |
22+
| C# | [README](https://github.com/vaticle/typedb-driver/tree/development/csharp/README.md) | [Documentation](https://typedb.com/docs/drivers/csharp/overview) | [`csharp/`](https://github.com/vaticle/typedb-driver/tree/development/csharp) |
2323

2424
### Package hosting
2525

RELEASE_NOTES_LATEST.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Documentation: https://typedb.com/docs/drivers/rust/overview
99

1010

1111
```sh
12-
cargo add [email protected].4
12+
cargo add [email protected].6-rc0
1313
```
1414

1515

@@ -29,7 +29,7 @@ Documentation: https://typedb.com/docs/drivers/java/overview
2929
<dependency>
3030
<groupid>com.vaticle.typedb</groupid>
3131
<artifactid>typedb-driver</artifactid>
32-
<version>2.28.4</version>
32+
<version>2.28.6-rc0</version>
3333
</dependency>
3434
</dependencies>
3535
```
@@ -42,7 +42,7 @@ Documentation: https://typedb.com/docs/drivers/python/overview
4242
Available through https://pypi.org
4343

4444
```
45-
pip install typedb-driver==2.28.4
45+
pip install typedb-driver==2.28.6rc0
4646
```
4747

4848
### NodeJS driver
@@ -51,7 +51,7 @@ NPM package: https://www.npmjs.com/package/typedb-driver
5151
Documentation: https://typedb.com/docs/drivers/nodejs/overview
5252

5353
```
54-
npm install [email protected].4
54+
npm install [email protected].6-rc0
5555
```
5656

5757
### C# driver
@@ -61,39 +61,60 @@ Documentation: https://typedb.com/docs/drivers/csharp/overview
6161

6262
```xml
6363
<ItemGroup>
64-
<PackageReference Include="TypeDB.Driver" Version="2.28.4" />
65-
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-x64" Version="2.28.4" />
66-
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-x64" Version="2.28.4" />
67-
<PackageReference Include="TypeDB.Driver.Pinvoke.win-x64" Version="2.28.4" />
68-
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-arm64" Version="2.28.4" />
69-
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-arm64" Version="2.28.4" />
64+
<PackageReference Include="TypeDB.Driver" Version="2.28.6-rc0" />
65+
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-x64" Version="2.28.6-rc0" />
66+
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-x64" Version="2.28.6-rc0" />
67+
<PackageReference Include="TypeDB.Driver.Pinvoke.win-x64" Version="2.28.6-rc0" />
68+
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-arm64" Version="2.28.6-rc0" />
69+
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-arm64" Version="2.28.6-rc0" />
7070
</ItemGroup>
7171
```
7272

7373
### C++ driver
7474

75-
Compiled distributions comprising headers and shared libraries available at: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-driver-cpp+version:2.28.4
75+
Compiled distributions comprising headers and shared libraries available at: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-driver-cpp+version:2.28.6-rc0
7676
Documentation: https://typedb.com/docs/drivers/cpp/overview
7777

7878
### C driver
7979

80-
Compiled distributions comprising headers and shared libraries available at: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-driver-clib+version:2.28.4
80+
Compiled distributions comprising headers and shared libraries available at: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-driver-clib+version:2.28.6-rc0
8181

8282

8383
## New Features
8484

8585

8686
## Bugs Fixed
87-
- **JNI library loading uses a predetermined file name**
88-
The unpacked JNI library now uses a pre-determined filename. This replaces logic to extract the filename from the packaged resource.
87+
- **Python. Fix driver.close(). Add integration tests for connection closing for both core and cloud**
88+
We fix the issue https://github.com/vaticle/typedb-driver/issues/669, where the Python Driver didn't close the connection when calling `TypeDBDriver.close()`.
8989

9090

9191

9292
## Code Refactors
93-
93+
- **Invert address translation table: map public addresses to private**
94+
95+
NOTE: The address translation table now represents mapping _from_ the desired connection addresses to the addresses the cloud servers are configured with. This change does not impact users of TypeDB Core or TypeDB Cloud through the TypeDB Cloud Platform (https://cloud.typedb.com/)
96+
97+
9498

9599
## Other Improvements
96-
- **Turn on development mode for tests**
97-
We activate the newly introduced in `TypeDB` `--development-mode.enable` flag for all the CI builds of the driver.
100+
- **Hermetic npm deployment**
101+
102+
- **Build and deploy for Python 3.12**
103+
104+
We enable support for python 3.12 driver build.
105+
106+
- **Partial go driver implementation**
107+
Implement Basic core driver functionality of creating and closing a database.
108+
109+
110+
- **Make the author of the NodeJS and Python drivers "TypeDB Community"**
111+
112+
The `author` field of our NodeJS and Python drivers (`package.json` and PyPi configuration) is now **TypeDB Community** with the email being **[email protected]**.
113+
114+
115+
- **Fix CI builds with updated error messages from typedb and typedb-cloud artifacts**
116+
We update `typedb` and `typedb-cloud` artifacts references to match `TypeDB***Runner`s used in most of the languages with `typeql` versions used in Rust and Java drivers in CI.
117+
118+
Previously, the versions were mismatched, which caused errors in CI because of the different error messages received from drivers (Rust `typeql` for Rust, Java `typeql` for Java, and direct values from the server for all the other drivers).
98119

99-
- **Update `nodejs` driver dependencies and fix builds based on the updated `typescript` rules**
120+

VERSION

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

WORKSPACE

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ workspace(name = "vaticle_typedb_driver")
2020
##############################
2121
# Load @vaticle_dependencies #
2222
##############################
23-
2423
load("//dependencies/vaticle:repositories.bzl", "vaticle_dependencies")
2524
vaticle_dependencies()
2625

@@ -79,6 +78,22 @@ paket2bazel_dependencies()
7978
load("//csharp/nuget:paket.csharp_deps.bzl", csharp_deps = "csharp_deps")
8079
csharp_deps()
8180

81+
# Load //builder/go
82+
load("@vaticle_dependencies//builder/go:deps.bzl", go_deps = "deps")
83+
go_deps()
84+
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
85+
go_rules_dependencies()
86+
87+
load("//go:go_versions.bzl", "register_all_toolchains")
88+
register_all_toolchains()
89+
90+
# gazelle:repo bazel_gazelle <- Used to tell gazelle that it is loaded in a macro.
91+
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
92+
load("//go:deps.bzl", "go_repositories")
93+
# gazelle:repository_macro go/deps.bzl%go_repositories
94+
go_repositories()
95+
gazelle_dependencies()
96+
8297
# Load //builder/proto_grpc
8398
load("@vaticle_dependencies//builder/proto_grpc:deps.bzl", grpc_deps = "deps")
8499
grpc_deps()
@@ -246,6 +261,7 @@ vaticle_typedb_protocol_npm_repositories()
246261

247262
# Setup rules_ts
248263
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
264+
249265
rules_ts_dependencies(
250266
ts_version_from = "//nodejs:package.json",
251267
)

c/src/concept/concept.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
use std::ffi::c_char;
2121

22-
use chrono::NaiveDateTime;
22+
use chrono::DateTime;
2323
use typedb_driver::{
2424
concept::{
2525
Annotation, Attribute, AttributeType, Concept, Entity, EntityType, Relation, RelationType, RoleType, Value,
@@ -56,7 +56,7 @@ pub extern "C" fn value_new_string(string: *const c_char) -> *mut Concept {
5656
/// Creates a new ``Value`` object of the specified datetime value.
5757
#[no_mangle]
5858
pub extern "C" fn value_new_date_time_from_millis(millis: i64) -> *mut Concept {
59-
release(Concept::Value(Value::DateTime(NaiveDateTime::from_timestamp_millis(millis).unwrap())))
59+
release(Concept::Value(Value::DateTime(DateTime::from_timestamp_millis(millis).unwrap().naive_utc())))
6060
}
6161

6262
/// Returns <code>true</code> if the value which this ``Value`` concept holds is of type <code>boolean</code>.
@@ -143,7 +143,7 @@ pub extern "C" fn value_get_string(value: *const Concept) -> *mut c_char {
143143
#[no_mangle]
144144
pub extern "C" fn value_get_date_time_as_millis(value: *const Concept) -> i64 {
145145
if let Value::DateTime(date_time) = borrow_as_value(value) {
146-
date_time.timestamp_millis()
146+
date_time.and_utc().timestamp_millis()
147147
} else {
148148
unreachable!("Attempting to unwrap a non-datetime {:?} as datetime", borrow_as_value(value))
149149
}

c/src/connection.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ pub extern "C" fn connection_open_cloud(
5252
/// Open a TypeDB Driver to TypeDB Cloud server(s), using provided address translation, with
5353
/// the provided credential.
5454
///
55-
/// @param advertised_addresses A null-terminated array holding the address(es) the TypeDB server(s)
56-
/// are configured to advertise
57-
/// @param translated_addresses A null-terminated array holding the address(es) of the TypeDB server(s)
55+
/// @param public_addresses A null-terminated array holding the address(es) of the TypeDB server(s)
5856
/// the driver will connect to. This array <i>must</i> have the same length as <code>advertised_addresses</code>
57+
/// @param private_addresses A null-terminated array holding the address(es) the TypeDB server(s)
58+
/// are configured to advertise
5959
/// @param credential The <code>Credential</code> to connect with
6060
#[no_mangle]
6161
pub extern "C" fn connection_open_cloud_translated(
62-
advertised_addresses: *const *const c_char,
63-
translated_addresses: *const *const c_char,
62+
public_addresses: *const *const c_char,
63+
private_addresses: *const *const c_char,
6464
credential: *const Credential,
6565
) -> *mut Connection {
66-
let addresses = string_array_view(advertised_addresses).zip_eq(string_array_view(translated_addresses)).collect();
66+
let addresses = string_array_view(public_addresses).zip_eq(string_array_view(private_addresses)).collect();
6767
try_release(Connection::new_cloud_with_translation(addresses, borrow(credential).clone()))
6868
}
6969

c/swig/typedb_driver_go.swg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/* TODO: Implement */

cpp/include/typedb/connection/driver.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class Driver {
8585
* Driver::cloudDriver(addresses, credential);
8686
* </pre>
8787
*
88-
* @param addresses The address(es) of the TypeDB server(s) or translation map from addresses
89-
* received from the TypeDB server(s) to addresses to be used by the driver for connection
88+
* @param addresses The address(es) of the TypeDB server(s) or translation map from addresses to be used
89+
* by the driver for connection to addresses received from the TypeDB server(s)
9090
* @param credential The Credential to connect with
9191
*/
9292
static Driver cloudDriver(const std::vector<std::string>& addresses, const Credential& credential);

cpp/lib/connection/driver.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ Driver Driver::cloudDriver(const std::vector<std::string>& addresses, const Cred
4747
}
4848

4949
Driver Driver::cloudDriver(const std::unordered_map<std::string, std::string>& addressTranslation, const Credential& credential) {
50-
std::vector<const char*> advertisedAddressesNative;
51-
std::vector<const char*> translatedAddressesNative;
52-
for (auto& [advertised, translated] : addressTranslation) {
53-
advertisedAddressesNative.push_back(advertised.c_str());
54-
translatedAddressesNative.push_back(translated.c_str());
50+
std::vector<const char*> publicAddressesNative;
51+
std::vector<const char*> privateAddressesNative;
52+
for (auto& [publicAddress, privateAddress] : addressTranslation) {
53+
publicAddressesNative.push_back(publicAddress.c_str());
54+
privateAddressesNative.push_back(privateAddress.c_str());
5555
}
56-
advertisedAddressesNative.push_back(nullptr);
57-
translatedAddressesNative.push_back(nullptr);
56+
publicAddressesNative.push_back(nullptr);
57+
privateAddressesNative.push_back(nullptr);
5858
auto p = _native::connection_open_cloud_translated(
59-
advertisedAddressesNative.data(),
60-
translatedAddressesNative.data(),
59+
publicAddressesNative.data(),
60+
privateAddressesNative.data(),
6161
credential.getNative()
6262
);
6363
DriverException::check_and_throw();

cpp/test/behaviour/steps/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,4 @@ int main(int argc, char** argv) {
5656
&TypeDB::BDD::testHooks);
5757
driver.loadFeature(argv[1]);
5858
return driver.runAllTests();
59-
return 0;
6059
}

cpp/test/cucumber/include/cucumber_bdd/runner.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class TestRunner : public TestRunnerBase {
7171
void afterAllTests() override {
7272
if (hooks != nullptr) hooks->afterAll();
7373
}
74+
7475
bool skipScenario(const cucumber::messages::pickle& scenario) override {
7576
return (hooks != nullptr) ? hooks->skipScenario(scenario) : false;
7677
}

0 commit comments

Comments
 (0)