Skip to content

Commit

Permalink
Publish crate with correctly versioned bazel dependencies (#456)
Browse files Browse the repository at this point in the history
## What is the goal of this PR?

We update to the latest 2.24.5 dependencies of TypeQL and Protocol, and
prepare to deploy a crate with a README, LICENSE, and correctly
versioned dependencies.

## What are the changes implemented in this PR?

* Update `dependencies` and therefore `bazel-distribution` to the latest
versions, which correctly translate bazel dependencies into cargo
dependencies using `workspace_refs`
* Add LICENSE and README to Rust crate assembled
* Update `typeql` and `typedb-protocol` to release 2.24.5
* Fix release notes template
  • Loading branch information
flyingsilverfin authored Sep 29, 2023
1 parent 8fd82b3 commit 97ceadf
Show file tree
Hide file tree
Showing 20 changed files with 70 additions and 56 deletions.
17 changes: 0 additions & 17 deletions .github/pull_request_template.md

This file was deleted.

23 changes: 21 additions & 2 deletions RELEASE_NOTES_LATEST.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#### Rust driver

Available from https://crates.io/crates/typedb-driver

```sh
cargo add typedb-driver@2.24.5
```

## Java driver

Documentation: http://docs.vaticle.com/docs/driver-api/java
Expand All @@ -17,11 +25,22 @@ Available through https://repo.vaticle.com
<dependency>
<groupid>com.vaticle.typedb</groupid>
<artifactid>typedb-driver</artifactid>
<version>{version}</version>
<version>2.24.5</version>
</dependency>
</dependencies>
```

### Python driver

PyPI package: https://pypi.org/project/typedb-driver
Documentation: https://docs.vaticle.com/docs/driver-api/python

Available through https://pypi.org

```
pip install typedb-driver==2.24.5
```

## NodeJS driver

NPM package: https://www.npmjs.com/package/typedb-driver
Expand All @@ -30,7 +49,7 @@ Documentation: https://docs.vaticle.com/docs/driver-api/nodejs
### Installation

```
npm install typedb-driver@{version}
npm install typedb-driver@2.24.5
```

## Architectural Changes
Expand Down
11 changes: 10 additions & 1 deletion RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
Documentation: http://docs.vaticle.com/docs/driver-api/java
Documentation: https://typedb.com/docs/drivers/2.x/drivers

## Distribution

#### Rust driver

Available from https://crates.io/crates/typedb-driver

```sh
cargo add typedb-driver@{version}
```


### Java driver

Available through https://repo.vaticle.com
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.24.4
2.24.5
2 changes: 1 addition & 1 deletion c/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rust_static_library(
deps = [
"//rust:typedb_driver_sync",

"@vaticle_typeql//rust:typeql_lang",
"@vaticle_typeql//rust:typeql",

"@crates//:chrono",
"@crates//:itertools",
Expand Down
4 changes: 2 additions & 2 deletions c/src/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ pub extern "C" fn logic_manager_put_rule(
try_release((|| {
borrow(transaction).logic().put_rule(
string_view(label).to_owned(),
typeql_lang::parse_pattern(string_view(when))?.into_conjunction(),
typeql_lang::parse_variable(string_view(then))?,
typeql::parse_pattern(string_view(when))?.into_conjunction(),
typeql::parse_variable(string_view(then))?,
)
})())
}
Expand Down
6 changes: 3 additions & 3 deletions dependencies/vaticle/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def vaticle_dependencies():
git_repository(
name = "vaticle_dependencies",
remote = "https://github.com/vaticle/dependencies",
commit = "bbaa05b2b5f7afd304c0b070a17d202893c08562", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_dependencies
commit = "72ef3d0550492342ced5859e8f972dbf5d60677b", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_dependencies
)

def vaticle_typedb_common():
Expand All @@ -39,14 +39,14 @@ def vaticle_typeql():
git_repository(
name = "vaticle_typeql",
remote = "https://github.com/vaticle/typeql",
tag = "2.24.0", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typeql
tag = "2.24.5", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typeql
)

def vaticle_typedb_protocol():
git_repository(
name = "vaticle_typedb_protocol",
remote = "https://github.com/vaticle/typedb-protocol",
tag = "2.24.1" # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_protocol
tag = "2.24.5" # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_protocol
)

def vaticle_typedb_behaviour():
Expand Down
2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@grpc/grpc-js": "1.9.0",
"google-protobuf": "3.19.3",
"typedb-protocol": "2.18.1",
"typedb-protocol": "2.24.5",
"uuid": "8.3.2"
},
"devDependencies": {
Expand Down
9 changes: 6 additions & 3 deletions rust/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedb_driver_deps = [
"@crates//:tonic",
"@crates//:uuid",
"@vaticle_typedb_protocol//grpc/rust:typedb_protocol",
"@vaticle_typeql//rust:typeql_lang",
"@vaticle_typeql//rust:typeql",
]
typedb_driver_proc_macro_deps = [
"@crates//:async-trait",
Expand Down Expand Up @@ -72,12 +72,15 @@ rust_library(
assemble_crate(
name = "assemble_crate",
description = "TypeDB Driver API for Rust",
homepage = "https://github.com/vaticle/typedb-driver-rust",
homepage = "https://github.com/vaticle/typedb-driver",
license = "Apache-2.0",
repository = "https://github.com/vaticle/typedb-driver-rust",
license_file = "//:LICENSE",
readme_file = ":README.md",
repository = "https://github.com/vaticle/typedb-driver",
target = ":typedb_driver",
universe_manifests = ["@vaticle_dependencies//library/crates:Cargo.toml"],
crate_features = { "sync": [] },
workspace_refs = "@vaticle_typedb_driver_workspace_refs//:refs.json",
)

deploy_crate(
Expand Down
2 changes: 1 addition & 1 deletion rust/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# TypeDB Driver for Rust

[![Factory](https://factory.vaticle.com/api/status/vaticle/typedb-driver-rust/badge.svg)](https://factory.vaticle.com/vaticle/typedb-driver-rust)
[![Factory](https://factory.vaticle.com/api/status/vaticle/typedb-driver/badge.svg)](https://factory.vaticle.com/vaticle/typedb-driver)
[![Discord](https://img.shields.io/discord/665254494820368395?color=7389D8&label=chat&logo=discord&logoColor=ffffff)](https://vaticle.com/discord)
[![Discussion Forum](https://img.shields.io/discourse/https/forum.vaticle.com/topics.svg)](https://forum.vaticle.com)
[![Stack Overflow](https://img.shields.io/badge/stackoverflow-typedb-796de3.svg)](https://stackoverflow.com/questions/tagged/typedb)
Expand Down
8 changes: 4 additions & 4 deletions rust/src/common/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use std::{error::Error as StdError, fmt};

use tonic::{Code, Status};
use typeql_lang::error_messages;
use typeql::error_messages;

use super::{address::Address, RequestID};

Expand Down Expand Up @@ -88,7 +88,7 @@ error_messages! { InternalError
pub enum Error {
Connection(ConnectionError),
Internal(InternalError),
TypeQL(typeql_lang::common::Error),
TypeQL(typeql::common::Error),
Other(String),
}

Expand Down Expand Up @@ -171,8 +171,8 @@ impl From<InternalError> for Error {
}
}

impl From<typeql_lang::common::Error> for Error {
fn from(err: typeql_lang::common::Error) -> Self {
impl From<typeql::common::Error> for Error {
fn from(err: typeql::common::Error) -> Self {
Self::TypeQL(err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/connection/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::time::Duration;
use tokio::sync::mpsc::UnboundedSender;
use tonic::Streaming;
use typedb_protocol::transaction;
use typeql_lang::pattern::{Conjunction, Variable};
use typeql::pattern::{Conjunction, Variable};

use crate::{
answer::{ConceptMap, ConceptMapGroup, Numeric, NumericGroup},
Expand Down
2 changes: 1 addition & 1 deletion rust/src/connection/network/proto/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

use typedb_protocol::Rule as RuleProto;
use typeql_lang::{
use typeql::{
parse_pattern, parse_variable,
pattern::{Pattern, Variable},
};
Expand Down
2 changes: 1 addition & 1 deletion rust/src/connection/transaction_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::{fmt, iter};

#[cfg(not(feature = "sync"))]
use futures::{stream, StreamExt};
use typeql_lang::pattern::{Conjunction, Variable};
use typeql::pattern::{Conjunction, Variable};

use super::{
message::{RoleTypeRequest, RoleTypeResponse, ThingRequest, ThingResponse},
Expand Down
2 changes: 1 addition & 1 deletion rust/src/logic/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

use typeql_lang::pattern::{Conjunction, ThingVariable};
use typeql::pattern::{Conjunction, ThingVariable};

#[derive(Clone, Debug, PartialEq)]
pub struct Rule {
Expand Down
2 changes: 1 addition & 1 deletion rust/src/transaction/logic/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

use std::sync::Arc;

use typeql_lang::pattern::{Conjunction, Variable};
use typeql::pattern::{Conjunction, Variable};

use crate::{
common::{stream::Stream, Result},
Expand Down
2 changes: 1 addition & 1 deletion rust/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rust_test(
timeout = "eternal",
deps = [
"//rust:typedb_driver",
"@vaticle_typeql//rust:typeql_lang",
"@vaticle_typeql//rust:typeql",
"@crates//:async-std",
"@crates//:chrono",
"@crates//:cucumber",
Expand Down
2 changes: 1 addition & 1 deletion rust/tests/behaviour/typeql/language/steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use cucumber::{gherkin::Step, given, then, when};
use futures::TryStreamExt;
use typedb_driver::{answer::Numeric, Result as TypeDBResult};
use typeql_lang::parse_query;
use typeql::parse_query;
use util::{
equals_approximate, iter_table_map, match_answer_concept, match_answer_concept_map, match_answer_rule,
match_templated_answer,
Expand Down
2 changes: 1 addition & 1 deletion rust/tests/behaviour/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use typedb_driver::{
transaction::concept::api::ThingAPI,
DatabaseManager, Result as TypeDBResult,
};
use typeql_lang::{parse_patterns, parse_query, pattern::Variable};
use typeql::{parse_patterns, parse_query, pattern::Variable};

use crate::{assert_with_timeout, behaviour::Context};

Expand Down
24 changes: 12 additions & 12 deletions rust/tests/integration/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ test_for_each_arg! {
let transaction = session.transaction(Write).await?;
transaction.logic().put_rule(
"marriage-is-friendship".to_string(),
typeql_lang::parse_pattern("{ $x isa person; $y isa person; (husband: $x, wife: $y) isa marriage; }")?
typeql::parse_pattern("{ $x isa person; $y isa person; (husband: $x, wife: $y) isa marriage; }")?
.into_conjunction(),
typeql_lang::parse_variable("(friend: $x, friend: $y) isa friendship")?,
typeql::parse_variable("(friend: $x, friend: $y) isa friendship")?,
).await?;
transaction.commit().await?;
}
Expand Down Expand Up @@ -123,9 +123,9 @@ test_for_each_arg! {
let transaction = session.transaction(Write).await?;
transaction.logic().put_rule(
"marriage-is-friendship".to_string(),
typeql_lang::parse_pattern("{ $x isa person; $y isa person; (husband: $x, wife: $y) isa marriage; }")?
typeql::parse_pattern("{ $x isa person; $y isa person; (husband: $x, wife: $y) isa marriage; }")?
.into_conjunction(),
typeql_lang::parse_variable("(friend: $x, friend: $y) isa friendship")?,
typeql::parse_variable("(friend: $x, friend: $y) isa friendship")?,
).await?;
transaction.commit().await?;
}
Expand Down Expand Up @@ -175,15 +175,15 @@ test_for_each_arg! {
let transaction = session.transaction(Write).await?;
transaction.logic().put_rule(
"marriage-is-friendship".to_string(),
typeql_lang::parse_pattern("{ $x isa person; $y isa person; (husband: $x, wife: $y) isa marriage; }")?
typeql::parse_pattern("{ $x isa person; $y isa person; (husband: $x, wife: $y) isa marriage; }")?
.into_conjunction(),
typeql_lang::parse_variable("(friend: $x, friend: $y) isa friendship")?,
typeql::parse_variable("(friend: $x, friend: $y) isa friendship")?,
).await?;
transaction.logic().put_rule(
"everyone-is-friends".to_string(),
typeql_lang::parse_pattern("{ $x isa person; $y isa person; not { $x is $y; }; }")?
typeql::parse_pattern("{ $x isa person; $y isa person; not { $x is $y; }; }")?
.into_conjunction(),
typeql_lang::parse_variable("(friend: $x, friend: $y) isa friendship")?,
typeql::parse_variable("(friend: $x, friend: $y) isa friendship")?,
).await?;
transaction.commit().await?;
}
Expand Down Expand Up @@ -228,15 +228,15 @@ test_for_each_arg! {
let transaction = session.transaction(Write).await?;
transaction.logic().put_rule(
"old-milk-is-not-good".to_string(),
typeql_lang::parse_pattern("{ $x isa milk, has age-in-days <= 10; }")?
typeql::parse_pattern("{ $x isa milk, has age-in-days <= 10; }")?
.into_conjunction(),
typeql_lang::parse_variable("$x has is-still-good true")?,
typeql::parse_variable("$x has is-still-good true")?,
).await?;
transaction.logic().put_rule(
"all-milk-is-good".to_string(),
typeql_lang::parse_pattern("{ $x isa milk; }")?
typeql::parse_pattern("{ $x isa milk; }")?
.into_conjunction(),
typeql_lang::parse_variable("$x has is-still-good true")?,
typeql::parse_variable("$x has is-still-good true")?,
).await?;
transaction.commit().await?;
}
Expand Down

0 comments on commit 97ceadf

Please sign in to comment.