Skip to content

Commit

Permalink
Merge for 2.28.6-rc0 release (#678)
Browse files Browse the repository at this point in the history
## Usage and product changes

Merge for 2.28.6-rc0 release
  • Loading branch information
typedb-bot authored Aug 5, 2024
2 parents 6cfb17d + 2df397c commit 0e7efb7
Show file tree
Hide file tree
Showing 78 changed files with 1,609 additions and 213 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ commands:
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip39 -- snapshot
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip310 -- snapshot
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip311 -- snapshot
bazel run --jobs=8 --define version=$(git rev-parse HEAD) //python:deploy-pip312 -- snapshot
test-pip-snapshot-unix:
steps:
Expand Down Expand Up @@ -161,6 +162,7 @@ commands:
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip39 --compilation_mode=opt -- release
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip310 --compilation_mode=opt -- release
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip311 --compilation_mode=opt -- release
bazel run --jobs=8 --define version=$(cat VERSION) //python:deploy-pip312 --compilation_mode=opt -- release
#########################
Expand Down Expand Up @@ -609,7 +611,6 @@ jobs:
bazel-arch: amd64
- deploy-crate-snapshot-unix
- deploy-maven-snapshot-unix
- install-npm-apt
- deploy-npm-snapshot-unix

deploy-snapshot-dotnet-any:
Expand Down Expand Up @@ -766,7 +767,6 @@ jobs:
bazel-arch: amd64
- deploy-crate-release-unix
- deploy-maven-release-unix
- install-npm-apt
- deploy-npm-release-unix

deploy-release-dotnet-any:
Expand Down
3 changes: 3 additions & 0 deletions .circleci/windows/python/deploy_release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip311 --compilation_mode=opt -- release
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip312 --compilation_mode=opt -- release
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%
3 changes: 3 additions & 0 deletions .circleci/windows/python/deploy_snapshot.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip311 -- snapshot
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%

bazel --output_user_root=C:/tmp run --verbose_failures --define version=%VER% //python:deploy-pip312 -- snapshot
IF %errorlevel% NEQ 0 EXIT /b %errorlevel%
13 changes: 7 additions & 6 deletions .factory/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ config:
build:
quality:
filter:
owner: vaticle
owner: typedb
branch: [master, development]
dependency-analysis:
image: vaticle-ubuntu-22.04
Expand Down Expand Up @@ -125,7 +125,7 @@ build:
machine: 8-core-32-gb
image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
filter:
owner: vaticle
owner: typedb
branch: [master, development]
dependencies:
- build
Expand All @@ -149,7 +149,7 @@ build:
machine: 8-core-32-gb
image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
filter:
owner: vaticle
owner: typedb
branch: [master, development]
dependencies:
- build
Expand Down Expand Up @@ -287,12 +287,13 @@ build:
tool/test/start-core-server.sh &&
bazel test //python/tests/integration:test_stream --test_output=streamed --jobs=1 &&
bazel test //python/tests/integration:test_core_connection --test_output=streamed --jobs=1 &&
export CORE_FAILED= || export CORE_FAILED=1
tool/test/stop-core-server.sh
if [[ -n "$CORE_FAILED" ]]; then exit 1; fi
source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars
bazel test //python/tests/integration:test_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
bazel test //python/tests/integration:test_cloud_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
# TODO #635: currently broken test
# bazel test //python/tests/integration:test_cloud_failover --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
export CLOUD_FAILED= || export CLOUD_FAILED=1
Expand Down Expand Up @@ -508,7 +509,7 @@ build:
sync-dependencies:
image: vaticle-ubuntu-22.04
filter:
owner: vaticle
owner: typedb
branch: [master, development]
dependencies:
- build
Expand Down Expand Up @@ -545,7 +546,7 @@ build:

release:
filter:
owner: vaticle
owner: typedb
branch: [master]
validation:
validate-dependencies:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the table below for links to README files, documentation, and source code.
| 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) |
| 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) |
| 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) |
| 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) |
| 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) |

### Package hosting

Expand Down
57 changes: 39 additions & 18 deletions RELEASE_NOTES_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Documentation: https://typedb.com/docs/drivers/rust/overview


```sh
cargo add [email protected].4
cargo add [email protected].6-rc0
```


Expand All @@ -29,7 +29,7 @@ Documentation: https://typedb.com/docs/drivers/java/overview
<dependency>
<groupid>com.vaticle.typedb</groupid>
<artifactid>typedb-driver</artifactid>
<version>2.28.4</version>
<version>2.28.6-rc0</version>
</dependency>
</dependencies>
```
Expand All @@ -42,7 +42,7 @@ Documentation: https://typedb.com/docs/drivers/python/overview
Available through https://pypi.org

```
pip install typedb-driver==2.28.4
pip install typedb-driver==2.28.6rc0
```

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

```
npm install [email protected].4
npm install [email protected].6-rc0
```

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

```xml
<ItemGroup>
<PackageReference Include="TypeDB.Driver" Version="2.28.4" />
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-x64" Version="2.28.4" />
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-x64" Version="2.28.4" />
<PackageReference Include="TypeDB.Driver.Pinvoke.win-x64" Version="2.28.4" />
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-arm64" Version="2.28.4" />
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-arm64" Version="2.28.4" />
<PackageReference Include="TypeDB.Driver" Version="2.28.6-rc0" />
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-x64" Version="2.28.6-rc0" />
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-x64" Version="2.28.6-rc0" />
<PackageReference Include="TypeDB.Driver.Pinvoke.win-x64" Version="2.28.6-rc0" />
<PackageReference Include="TypeDB.Driver.Pinvoke.osx-arm64" Version="2.28.6-rc0" />
<PackageReference Include="TypeDB.Driver.Pinvoke.linux-arm64" Version="2.28.6-rc0" />
</ItemGroup>
```

### C++ driver

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
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
Documentation: https://typedb.com/docs/drivers/cpp/overview

### C driver

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
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


## New Features


## Bugs Fixed
- **JNI library loading uses a predetermined file name**
The unpacked JNI library now uses a pre-determined filename. This replaces logic to extract the filename from the packaged resource.
- **Python. Fix driver.close(). Add integration tests for connection closing for both core and cloud**
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()`.



## Code Refactors

- **Invert address translation table: map public addresses to private**

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/)



## Other Improvements
- **Turn on development mode for tests**
We activate the newly introduced in `TypeDB` `--development-mode.enable` flag for all the CI builds of the driver.
- **Hermetic npm deployment**

- **Build and deploy for Python 3.12**

We enable support for python 3.12 driver build.

- **Partial go driver implementation**
Implement Basic core driver functionality of creating and closing a database.


- **Make the author of the NodeJS and Python drivers "TypeDB Community"**

The `author` field of our NodeJS and Python drivers (`package.json` and PyPi configuration) is now **TypeDB Community** with the email being **[email protected]**.


- **Fix CI builds with updated error messages from typedb and typedb-cloud artifacts**
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.

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).

- **Update `nodejs` driver dependencies and fix builds based on the updated `typescript` rules**
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.28.4
2.28.6-rc0
18 changes: 17 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ workspace(name = "vaticle_typedb_driver")
##############################
# Load @vaticle_dependencies #
##############################

load("//dependencies/vaticle:repositories.bzl", "vaticle_dependencies")
vaticle_dependencies()

Expand Down Expand Up @@ -79,6 +78,22 @@ paket2bazel_dependencies()
load("//csharp/nuget:paket.csharp_deps.bzl", csharp_deps = "csharp_deps")
csharp_deps()

# Load //builder/go
load("@vaticle_dependencies//builder/go:deps.bzl", go_deps = "deps")
go_deps()
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
go_rules_dependencies()

load("//go:go_versions.bzl", "register_all_toolchains")
register_all_toolchains()

# gazelle:repo bazel_gazelle <- Used to tell gazelle that it is loaded in a macro.
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("//go:deps.bzl", "go_repositories")
# gazelle:repository_macro go/deps.bzl%go_repositories
go_repositories()
gazelle_dependencies()

# Load //builder/proto_grpc
load("@vaticle_dependencies//builder/proto_grpc:deps.bzl", grpc_deps = "deps")
grpc_deps()
Expand Down Expand Up @@ -246,6 +261,7 @@ vaticle_typedb_protocol_npm_repositories()

# Setup rules_ts
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")

rules_ts_dependencies(
ts_version_from = "//nodejs:package.json",
)
Expand Down
6 changes: 3 additions & 3 deletions c/src/concept/concept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use std::ffi::c_char;

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

/// Returns <code>true</code> if the value which this ``Value`` concept holds is of type <code>boolean</code>.
Expand Down Expand Up @@ -143,7 +143,7 @@ pub extern "C" fn value_get_string(value: *const Concept) -> *mut c_char {
#[no_mangle]
pub extern "C" fn value_get_date_time_as_millis(value: *const Concept) -> i64 {
if let Value::DateTime(date_time) = borrow_as_value(value) {
date_time.timestamp_millis()
date_time.and_utc().timestamp_millis()
} else {
unreachable!("Attempting to unwrap a non-datetime {:?} as datetime", borrow_as_value(value))
}
Expand Down
12 changes: 6 additions & 6 deletions c/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ pub extern "C" fn connection_open_cloud(
/// Open a TypeDB Driver to TypeDB Cloud server(s), using provided address translation, with
/// the provided credential.
///
/// @param advertised_addresses A null-terminated array holding the address(es) the TypeDB server(s)
/// are configured to advertise
/// @param translated_addresses A null-terminated array holding the address(es) of the TypeDB server(s)
/// @param public_addresses A null-terminated array holding the address(es) of the TypeDB server(s)
/// the driver will connect to. This array <i>must</i> have the same length as <code>advertised_addresses</code>
/// @param private_addresses A null-terminated array holding the address(es) the TypeDB server(s)
/// are configured to advertise
/// @param credential The <code>Credential</code> to connect with
#[no_mangle]
pub extern "C" fn connection_open_cloud_translated(
advertised_addresses: *const *const c_char,
translated_addresses: *const *const c_char,
public_addresses: *const *const c_char,
private_addresses: *const *const c_char,
credential: *const Credential,
) -> *mut Connection {
let addresses = string_array_view(advertised_addresses).zip_eq(string_array_view(translated_addresses)).collect();
let addresses = string_array_view(public_addresses).zip_eq(string_array_view(private_addresses)).collect();
try_release(Connection::new_cloud_with_translation(addresses, borrow(credential).clone()))
}

Expand Down
20 changes: 20 additions & 0 deletions c/swig/typedb_driver_go.swg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* TODO: Implement */
4 changes: 2 additions & 2 deletions cpp/include/typedb/connection/driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class Driver {
* Driver::cloudDriver(addresses, credential);
* </pre>
*
* @param addresses The address(es) of the TypeDB server(s) or translation map from addresses
* received from the TypeDB server(s) to addresses to be used by the driver for connection
* @param addresses The address(es) of the TypeDB server(s) or translation map from addresses to be used
* by the driver for connection to addresses received from the TypeDB server(s)
* @param credential The Credential to connect with
*/
static Driver cloudDriver(const std::vector<std::string>& addresses, const Credential& credential);
Expand Down
18 changes: 9 additions & 9 deletions cpp/lib/connection/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ Driver Driver::cloudDriver(const std::vector<std::string>& addresses, const Cred
}

Driver Driver::cloudDriver(const std::unordered_map<std::string, std::string>& addressTranslation, const Credential& credential) {
std::vector<const char*> advertisedAddressesNative;
std::vector<const char*> translatedAddressesNative;
for (auto& [advertised, translated] : addressTranslation) {
advertisedAddressesNative.push_back(advertised.c_str());
translatedAddressesNative.push_back(translated.c_str());
std::vector<const char*> publicAddressesNative;
std::vector<const char*> privateAddressesNative;
for (auto& [publicAddress, privateAddress] : addressTranslation) {
publicAddressesNative.push_back(publicAddress.c_str());
privateAddressesNative.push_back(privateAddress.c_str());
}
advertisedAddressesNative.push_back(nullptr);
translatedAddressesNative.push_back(nullptr);
publicAddressesNative.push_back(nullptr);
privateAddressesNative.push_back(nullptr);
auto p = _native::connection_open_cloud_translated(
advertisedAddressesNative.data(),
translatedAddressesNative.data(),
publicAddressesNative.data(),
privateAddressesNative.data(),
credential.getNative()
);
DriverException::check_and_throw();
Expand Down
1 change: 0 additions & 1 deletion cpp/test/behaviour/steps/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ int main(int argc, char** argv) {
&TypeDB::BDD::testHooks);
driver.loadFeature(argv[1]);
return driver.runAllTests();
return 0;
}
1 change: 1 addition & 0 deletions cpp/test/cucumber/include/cucumber_bdd/runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TestRunner : public TestRunnerBase {
void afterAllTests() override {
if (hooks != nullptr) hooks->afterAll();
}

bool skipScenario(const cucumber::messages::pickle& scenario) override {
return (hooks != nullptr) ? hooks->skipScenario(scenario) : false;
}
Expand Down
Loading

0 comments on commit 0e7efb7

Please sign in to comment.