Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade HASH Graph dependencies #1195

Merged
merged 11 commits into from Oct 13, 2022
242 changes: 168 additions & 74 deletions packages/graph/hash_graph/Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions packages/graph/hash_graph/bench/Cargo.toml
Expand Up @@ -13,16 +13,16 @@ autobenches = false
[dev-dependencies]
criterion = { version = "0.4.0", features = ["async_tokio", "html_reports"] }
criterion-macro = "0.4.0"
futures = "0.3.21"
futures = "0.3.24"
graph = { path = "../lib/graph", features = ["__internal_bench"] }
graph-test-data = { path = "../tests/test_data" }
rand = "0.8.5"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.83"
tokio = { version = "1.18.2", features = ["rt-multi-thread", "macros"] }
tokio-postgres = { version = "0.7.6", default-features = false }
serde = { version = "1.0.145", features = ["derive"] }
serde_json = "1.0.86"
tokio = { version = "1.21.2", features = ["rt-multi-thread", "macros"] }
tokio-postgres = { version = "0.7.7", default-features = false }
type-system = { git = "https://github.com/blockprotocol/blockprotocol", rev = "6526c0e" }
uuid = { version = "1.1.2", features = ["v4", "serde"] }
uuid = { version = "1.2.1", features = ["v4", "serde"] }

[[bench]]
# TODO - Rename, lib.rs, main.rs, hash_graph_benchmark.rs?
Expand Down
19 changes: 9 additions & 10 deletions packages/graph/hash_graph/bin/hash_graph/Cargo.toml
Expand Up @@ -8,16 +8,15 @@ description = "The entity-graph query-layer for the HASH datastore"


[dependencies]
axum = "0.5.11"
clap = { version = "3.2.10", features = ["cargo", "derive", "env", "wrap_help"] }
clap_complete = "3.2.3"
# TODO: Change to `version = "0.2"` as soon as it's released
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still haven't swapped to 0.2 in the engine and such, didn't want to do it in this pr. cc @TimDiekmann

error-stack = { git = "https://github.com/hashintel/hash", rev = "5edddb5", features = ["spantrace"] }
axum = "0.5.16"
clap = { version = "4.0.13", features = ["cargo", "derive", "env", "wrap_help"] }
clap_complete = "4.0.2"
error-stack = { version = "0.2.3", features = ["spantrace"] }
graph = { path = "../../lib/graph", features = ["clap"] }
regex = "1.6.0"
serde_json = "1.0.83"
tokio = { version = "1.18.2", features = ["rt-multi-thread", "macros"] }
tokio-postgres = { version = "0.7.6", default-features = false }
tracing = "0.1.35"
serde_json = "1.0.86"
tokio = { version = "1.21.2", features = ["rt-multi-thread", "macros"] }
tokio-postgres = { version = "0.7.7", default-features = false }
tracing = "0.1.37"
type-system = { git = "https://github.com/blockprotocol/blockprotocol", rev = "6526c0e" }
uuid = "1.1.2"
uuid = "1.2.1"
6 changes: 3 additions & 3 deletions packages/graph/hash_graph/bin/hash_graph/src/args.rs
@@ -1,11 +1,11 @@
use clap::{AppSettings::DeriveDisplayOrder, Args as _, Command, Parser};
use clap::{Args as _, Command, Parser};
use clap_complete::Shell;
use graph::{logging::LoggingArgs, store::DatabaseConnectionInfo};
use regex::Regex;

/// Arguments passed to the program.
#[derive(Debug, Parser)]
#[clap(version, author, about, long_about = None, setting = DeriveDisplayOrder)]
#[clap(version, author, about, long_about = None)]
pub struct Args {
#[clap(flatten)]
pub db_info: DatabaseConnectionInfo,
Expand Down Expand Up @@ -42,7 +42,7 @@ pub struct Args {
pub allowed_url_domain: Regex,

/// Generate a completion script for the given shell and outputs it to stdout.
#[clap(long, arg_enum, exclusive = true)]
#[clap(long, value_enum, exclusive = true)]
generate_completion: Option<Shell>,
}

Expand Down
32 changes: 16 additions & 16 deletions packages/graph/hash_graph/lib/graph/Cargo.toml
Expand Up @@ -7,30 +7,30 @@ description = "HASH Graph API"


[dependencies]
async-trait = "0.1.56"
axum = "0.5.11"
async-trait = "0.1.57"
axum = "0.5.16"
bb8-postgres = "0.8.1"
clap = { version = "3.2.10", features = ["derive", "env"], optional = true }
chrono = { version = "0.4.19", features = ["serde"] }
# TODO: Change to `version = "0.2"` as soon as it's released
error-stack = { git = "https://github.com/hashintel/hash", rev = "5edddb5", features = ["spantrace", "futures"] }
futures = "0.3.21"
postgres-types = { version = "0.2.3", default-features = false, features = ["derive", "with-uuid-1", "with-serde_json-1", "with-chrono-0_4"] }
clap = { version = "4.0.13", features = ["derive", "env"], optional = true }
chrono = { version = "0.4.22", features = ["serde"] }
error-stack = { version = "0.2.3", features = ["spantrace"] }
futures = "0.3.24"
indexmap = "1.9.1"
postgres-types = { version = "0.2.4", default-features = false, features = ["derive", "with-uuid-1", "with-serde_json-1", "with-chrono-0_4"] }
regex = "1.6.0"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.83"
tokio-postgres = { version = "0.7.6", default-features = false }
tracing = "0.1.35"
serde = { version = "1.0.145", features = ["derive"] }
serde_json = "1.0.86"
tokio-postgres = { version = "0.7.7", default-features = false }
tracing = "0.1.37"
tracing-appender = "0.2.2"
tracing-error = "0.2.0"
tracing-subscriber = { version = "0.3.14", features = ["env-filter", "json"] }
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "json"] }
type-system = { git = "https://github.com/blockprotocol/blockprotocol", rev = "6526c0e" }
uuid = { version = "1.1.2", features = ["v4", "serde"] }
utoipa = { git = "https://github.com/juhaku/utoipa", rev = "031073f", features = ["uuid"] }
uuid = { version = "1.2.1", features = ["v4", "serde"] }
utoipa = { version = " 2.2.0", features = ["uuid"] }
include_dir = "0.7.2"

[dev-dependencies]
tokio = { version = "1.18.2", features = ["rt-multi-thread", "macros"] }
tokio = { version = "1.21.2", features = ["rt-multi-thread", "macros"] }
graph-test-data = { path = "../../tests/test_data" }
criterion = "0.4.0"

Expand Down
4 changes: 2 additions & 2 deletions packages/graph/hash_graph/lib/graph/src/api/rest/account.rs
Expand Up @@ -14,11 +14,11 @@ use crate::{

#[derive(OpenApi)]
#[openapi(
handlers(
paths(
create_account_id,
),
components(
AccountId,
schemas(AccountId),
),
tags(
(name = "Account", description = "Account management API")
Expand Down
30 changes: 16 additions & 14 deletions packages/graph/hash_graph/lib/graph/src/api/rest/data_type.rs
Expand Up @@ -12,7 +12,7 @@ use error_stack::IntoReport;
use futures::TryFutureExt;
use serde::{Deserialize, Serialize};
use type_system::{uri::VersionedUri, DataType};
use utoipa::{Component, OpenApi};
use utoipa::{OpenApi, ToSchema};

use super::api_resource::RoutedResource;
use crate::{
Expand All @@ -29,21 +29,23 @@ use crate::{

#[derive(OpenApi)]
#[openapi(
handlers(
paths(
create_data_type,
get_data_types_by_query,
get_data_type,
get_latest_data_types,
update_data_type
),
components(
CreateDataTypeRequest,
UpdateDataTypeRequest,
AccountId,
PersistedOntologyIdentifier,
PersistedDataType,
DataTypeQuery,
DataTypeRootedSubgraph,
schemas(
CreateDataTypeRequest,
UpdateDataTypeRequest,
AccountId,
PersistedOntologyIdentifier,
PersistedDataType,
DataTypeQuery,
DataTypeRootedSubgraph,
)
),
tags(
(name = "DataType", description = "Data Type management API")
Expand All @@ -70,10 +72,10 @@ impl RoutedResource for DataTypeResource {
}
}

#[derive(Serialize, Deserialize, Component)]
#[derive(Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
struct CreateDataTypeRequest {
#[component(value_type = VAR_DATA_TYPE)]
#[schema(value_type = VAR_DATA_TYPE)]
schema: serde_json::Value,
account_id: AccountId,
}
Expand Down Expand Up @@ -207,12 +209,12 @@ async fn get_data_type<P: StorePool + Send>(
.map(Json)
}

#[derive(Component, Serialize, Deserialize)]
#[derive(ToSchema, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct UpdateDataTypeRequest {
#[component(value_type = VAR_UPDATE_DATA_TYPE)]
#[schema(value_type = VAR_UPDATE_DATA_TYPE)]
schema: serde_json::Value,
#[component(value_type = String)]
#[schema(value_type = String)]
type_to_update: VersionedUri,
account_id: AccountId,
}
Expand Down
30 changes: 16 additions & 14 deletions packages/graph/hash_graph/lib/graph/src/api/rest/entity.rs
Expand Up @@ -11,7 +11,7 @@ use axum::{
use futures::TryFutureExt;
use serde::{Deserialize, Serialize};
use type_system::uri::VersionedUri;
use utoipa::{Component, OpenApi};
use utoipa::{OpenApi, ToSchema};

use crate::{
api::rest::{api_resource::RoutedResource, read_from_store, report_to_status_code},
Expand All @@ -29,22 +29,24 @@ use crate::{

#[derive(OpenApi)]
#[openapi(
handlers(
paths(
create_entity,
get_entities_by_query,
get_entity,
get_latest_entities,
update_entity
),
components(
CreateEntityRequest,
UpdateEntityRequest,
EntityId,
PersistedEntityIdentifier,
PersistedEntity,
Entity,
KnowledgeGraphQuery,
EntityRootedSubgraph,
schemas(
CreateEntityRequest,
UpdateEntityRequest,
EntityId,
PersistedEntityIdentifier,
PersistedEntity,
Entity,
KnowledgeGraphQuery,
EntityRootedSubgraph,
)
),
tags(
(name = "Entity", description = "entity management API")
Expand All @@ -71,11 +73,11 @@ impl RoutedResource for EntityResource {
}
}

#[derive(Serialize, Deserialize, Component)]
#[derive(Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
struct CreateEntityRequest {
entity: Entity,
#[component(value_type = String)]
#[schema(value_type = String)]
entity_type_id: VersionedUri,
account_id: AccountId,
entity_id: Option<EntityId>,
Expand Down Expand Up @@ -197,12 +199,12 @@ async fn get_entity<P: StorePool + Send>(
.map(Json)
}

#[derive(Component, Serialize, Deserialize)]
#[derive(ToSchema, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct UpdateEntityRequest {
entity: Entity,
entity_id: EntityId,
#[component(value_type = String)]
#[schema(value_type = String)]
entity_type_id: VersionedUri,
account_id: AccountId,
}
Expand Down
30 changes: 16 additions & 14 deletions packages/graph/hash_graph/lib/graph/src/api/rest/entity_type.rs
Expand Up @@ -12,7 +12,7 @@ use error_stack::IntoReport;
use futures::TryFutureExt;
use serde::{Deserialize, Serialize};
use type_system::{uri::VersionedUri, EntityType};
use utoipa::{Component, OpenApi};
use utoipa::{OpenApi, ToSchema};

use crate::{
api::rest::{api_resource::RoutedResource, read_from_store, report_to_status_code},
Expand All @@ -30,21 +30,23 @@ use crate::{

#[derive(OpenApi)]
#[openapi(
handlers(
paths(
create_entity_type,
get_entity_types_by_query,
get_entity_type,
get_latest_entity_types,
update_entity_type
),
components(
CreateEntityTypeRequest,
UpdateEntityTypeRequest,
AccountId,
PersistedOntologyIdentifier,
PersistedEntityType,
EntityTypeQuery,
EntityTypeRootedSubgraph,
schemas(
CreateEntityTypeRequest,
UpdateEntityTypeRequest,
AccountId,
PersistedOntologyIdentifier,
PersistedEntityType,
EntityTypeQuery,
EntityTypeRootedSubgraph,
)
),
tags(
(name = "EntityType", description = "Entity type management API")
Expand All @@ -71,10 +73,10 @@ impl RoutedResource for EntityTypeResource {
}
}

#[derive(Serialize, Deserialize, Component)]
#[derive(Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
struct CreateEntityTypeRequest {
#[component(value_type = VAR_ENTITY_TYPE)]
#[schema(value_type = VAR_ENTITY_TYPE)]
schema: serde_json::Value,
account_id: AccountId,
}
Expand Down Expand Up @@ -211,12 +213,12 @@ async fn get_entity_type<P: StorePool + Send>(
.map(Json)
}

#[derive(Component, Serialize, Deserialize)]
#[derive(ToSchema, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct UpdateEntityTypeRequest {
#[component(value_type = VAR_UPDATE_ENTITY_TYPE)]
#[schema(value_type = VAR_UPDATE_ENTITY_TYPE)]
schema: serde_json::Value,
#[component(value_type = String)]
#[schema(value_type = String)]
type_to_update: VersionedUri,
account_id: AccountId,
}
Expand Down