Skip to content

Commit

Permalink
Merge branch 'hashintel:main' into chonky
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusFileto authored Oct 29, 2024
2 parents edde66a + 56bbdbf commit 1d2bfac
Show file tree
Hide file tree
Showing 116 changed files with 2,260 additions and 703 deletions.
8 changes: 2 additions & 6 deletions .github/actions/terraform-exec/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ inputs:
required: false
default: .
command:
type: choice
description: Terraform command to run
required: true
options:
- plan
- apply
env:
description: Environment to run the command within
required: true
Expand Down Expand Up @@ -95,14 +91,14 @@ runs:
await core.summary
.addHeading(heading)
.addDetails(
"Output of Terraform initialization ⚙️ (${{ steps.init.outcome }})",
"Output of Terraform initialization ⚙️ (${{ steps.init.outcome }})",
`<pre><code>${init}</code></pre>`
)
.addDetails(
"Output of validation 🤖 (${{ steps.validate.outcome }})",
`<pre><code>${validate}</code></pre>`
)
.addDetails("Output of ${{ inputs.command }} 📖 (${{ steps.cmd.outcome }})",
.addDetails("Output of ${{ inputs.command }} 📖 (${{ steps.cmd.outcome }})",
`<pre><code lang="diff">${cmd}</code></pre>`
)
.write();
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
if: always() && steps.lints.outputs.codegen == 'true'
run: |
set -o pipefail
turbo run codegen --no-cache --filter "${{ matrix.package }}"
turbo run codegen --force --filter "${{ matrix.package }}"
while IFS= read -r line; do
if [[ -n "$line" ]]; then
echo "Checking diff of ${{ matrix.directory }}/$line"
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const generateSystemTypeBaseUrl = ({
export type PropertyTypeDefinition = {
propertyTypeId: VersionedUrl;
title: string;
description?: string;
description: string;
possibleValues: {
dataTypeId?: VersionedUrl;
primitiveDataType?: PrimitiveDataTypeKey;
Expand Down Expand Up @@ -411,7 +411,7 @@ export type EntityTypeDefinition = {
allOf?: VersionedUrl[];
entityTypeId: VersionedUrl;
title: string;
description?: string;
description: string;
labelProperty?: BaseUrl;
icon?: string;
properties?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export const EditPinnedEntityTypesModal: FunctionComponent<
entityType: {
title,
type: "object",
description: "",
properties: {},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const EntityTypeSelector = <Multiple extends boolean = false>({
const { title, description } = option.schema;
const lowercaseInput = inputValue.toLowerCase();
return (
!!description?.toLowerCase().includes(lowercaseInput) ||
!!description.toLowerCase().includes(lowercaseInput) ||
title.toLowerCase().includes(lowercaseInput)
);
});
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-graph/bins/cli/src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub struct ServerArgs {
#[clap(long, env = "HASH_TEMPORAL_SERVER_HOST")]
pub temporal_host: Option<String>,

/// The URL of the Temporal server.
/// The port of the Temporal server.
#[clap(long, env = "HASH_TEMPORAL_SERVER_PORT", default_value_t = 7233)]
pub temporal_port: u16,
}
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-graph/libs/api/openapi/models/data_type.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions apps/hash-graph/libs/api/openapi/models/entity_type.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/hash-graph/libs/api/openapi/models/property_type.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions apps/hash-graph/libs/api/openapi/models/update_entity_type.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apps/hash-graph/libs/api/openapi/openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
]
}
},
"required": ["$schema", "kind", "$id", "title"],
"required": ["$schema", "kind", "$id", "title", "description"],
"additionalProperties": true
}
16 changes: 9 additions & 7 deletions apps/hash-graph/libs/api/src/rest/json_schemas/entity_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
"$ref": "./shared.json#/definitions/EntityTypeReference"
}
},
"examples": {
"type": "array",
"items": {
"type": "object"
}
},
"properties": {
"$ref": "./shared.json#/definitions/PropertyTypeObject"
},
Expand All @@ -52,5 +46,13 @@
}
},
"additionalProperties": false,
"required": ["$schema", "kind", "type", "$id", "title", "properties"]
"required": [
"$schema",
"kind",
"type",
"$id",
"title",
"description",
"properties"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
}
}
},
"required": ["$schema", "kind", "$id", "title", "oneOf"],
"required": ["$schema", "kind", "$id", "title", "description", "oneOf"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
]
}
},
"required": ["$schema", "kind", "title"],
"required": ["$schema", "kind", "title", "description"],
"additionalProperties": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
},
"title": { "type": "string" },
"description": { "type": "string" },
"examples": {
"type": "array",
"items": {
"type": "object",
"x-propertyNames": {
"$comment": "Property names must be a valid URL to a Property Type",
"type": "string",
"format": "uri"
}
}
},
"properties": { "$ref": "./shared.json#/definitions/PropertyTypeObject" },
"required": {
"type": "array",
Expand All @@ -37,5 +26,5 @@
"links": { "$ref": "./shared.json#/definitions/LinkTypeObject" }
},
"additionalProperties": false,
"required": ["$schema", "kind", "type", "title", "properties"]
"required": ["$schema", "kind", "type", "title", "description", "properties"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
}
}
},
"required": ["$schema", "kind", "title", "oneOf"],
"required": [
"$schema",
"kind",
"title",
"description",
"description",
"oneOf"
],
"additionalProperties": false
}
4 changes: 2 additions & 2 deletions apps/hash-graph/libs/graph/src/snapshot/entity/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use graph_types::{
};
use hash_graph_store::filter::Filter;
use tokio_postgres::GenericClient;
use type_system::schema::ClosedEntityType;
use type_system::schema::{ClosedEntityType, ClosedMultiEntityType};
use validation::{EntityPreprocessor, Validate, ValidateEntityComponents};

use crate::{
Expand Down Expand Up @@ -311,7 +311,7 @@ where
)
.change_context(InsertionError)?;

let entity_type = ClosedEntityType::from_multi_type_closed_schema(
let entity_type = ClosedMultiEntityType::from_multi_type_closed_schema(
stream::iter(&entity.metadata.entity_type_ids)
.then(|entity_type_url| async {
OntologyTypeProvider::<ClosedEntityType>::provide_type(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use core::{
pin::Pin,
task::{Context, Poll, ready},
};
use std::collections::{HashMap, HashSet};

use authorization::schema::EntityTypeRelationAndSubject;
use error_stack::{Report, ResultExt};
Expand All @@ -12,7 +13,8 @@ use futures::{
};
use type_system::{
Valid,
schema::{ClosedEntityType, EntityTypeUuid},
schema::{ClosedEntityType, EntityConstraints, EntityTypeUuid, InverseEntityTypeMetadata},
url::{OntologyTypeVersion, VersionedUrl},
};

use crate::{
Expand Down Expand Up @@ -75,14 +77,32 @@ impl Sink<EntityTypeSnapshotRecord> for EntityTypeSender {
self.schema
.start_send_unpin(EntityTypeRow {
ontology_id,
// TODO: Validate ontology types in snapshots
// see https://linear.app/hash/issue/H-3038
schema: Valid::new_unchecked(entity_type.schema.clone()),
// An empty schema is inserted initially. This will be replaced later by the closed
// schema.
// TODO: Validate ontology types in snapshots
// see https://linear.app/hash/issue/H-3038
closed_schema: Valid::new_unchecked(ClosedEntityType::default()),
closed_schema: Valid::new_unchecked(ClosedEntityType {
id: VersionedUrl {
base_url: entity_type.schema.id.base_url.clone(),
version: OntologyTypeVersion::new(0),
},
title: String::new(),
title_plural: None,
description: String::new(),
inverse: InverseEntityTypeMetadata {
title: None,
title_plural: None,
},
constraints: EntityConstraints {
properties: HashMap::new(),
required: HashSet::new(),
links: HashMap::new(),
},
all_of: Vec::new(),
}),
// TODO: Validate ontology types in snapshots
// see https://linear.app/hash/issue/H-3038
schema: Valid::new_unchecked(entity_type.schema),
})
.change_context(SnapshotRestoreError::Read)
.attach_printable("could not send schema")?;
Expand Down
4 changes: 2 additions & 2 deletions apps/hash-graph/libs/graph/src/store/knowledge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use hash_graph_store::{
};
use serde::{Deserialize, Serialize};
use temporal_versioning::{DecisionTime, Timestamp, TransactionTime};
use type_system::{schema::ClosedEntityType, url::VersionedUrl};
use type_system::{schema::ClosedMultiEntityType, url::VersionedUrl};
#[cfg(feature = "utoipa")]
use utoipa::{
ToSchema,
Expand All @@ -42,7 +42,7 @@ use crate::store::{
pub enum EntityValidationType<'a> {
Id(Cow<'a, HashSet<VersionedUrl>>),
#[serde(skip)]
ClosedSchema(Cow<'a, ClosedEntityType>),
ClosedSchema(Cow<'a, ClosedMultiEntityType>),
}

#[cfg(feature = "utoipa")]
Expand Down
Loading

0 comments on commit 1d2bfac

Please sign in to comment.