-
Notifications
You must be signed in to change notification settings - Fork 321
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
feat(dal,sdf,app): Reimplement variant_defs endpoints #3474
feat(dal,sdf,app): Reimplement variant_defs endpoints #3474
Conversation
7b17567
to
0ed72ce
Compare
bors try |
tryBuild succeeded: |
bors try |
tryBuild succeeded: |
8836957
to
67e467b
Compare
580efa5
to
d895c55
Compare
bors try |
tryBuild succeeded: |
@@ -104,7 +103,7 @@ export type AssetCloneRequest = Visibility & { id: AssetId }; | |||
const LOCAL_STORAGE_LAST_SELECTED_ASSET_ID_KEY = "si-open-asset-id"; | |||
|
|||
export const assetDisplayName = (asset: Asset | AssetListEntry) => | |||
(asset.menuName ?? "").length === 0 ? asset.name : asset.menuName; | |||
(asset.displayName ?? "").length === 0 ? asset.name : asset.displayName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. menuName
was very old and we should have refactored it long ago.
set_default_schema_variant_id( | ||
ctx, | ||
change_set_id, | ||
&mut schema, | ||
schema_spec | ||
.data() | ||
.as_ref() | ||
.and_then(|data| data.default_schema_variant()), | ||
variant_spec.unique_id(), | ||
variant.id(), | ||
) | ||
.await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
pub fn display_name(&self) -> Option<String> { | ||
self.display_name.clone() | ||
} | ||
|
||
pub fn link(&self) -> Option<String> { | ||
self.link.clone() | ||
} | ||
|
||
pub fn description(&self) -> Option<String> { | ||
self.description.clone() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: feel free to ignore. We could use self.<option-field>.as_deref()
so that we allow the caller to decide to clone.
|
||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct SchemaVariantMetadataJson { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it! Great doc comments.
} | ||
|
||
impl SchemaVariantJson { | ||
// pub fn to_spec( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we keeping this commented out because it is functionality we wish to restore soon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is functionality that will come back!
.unwrap_or(DEFAULT_SCHEMA_VARIANT_COLOR.into()), | ||
component_type: variant_spec_data.component_type.into(), | ||
link: variant_spec_data.link.as_ref().map(|l| l.to_string()), | ||
description: None, // XXX - does this exist? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove it in a follow up PR if not!
@@ -510,6 +510,70 @@ pub async fn get_func_view(ctx: &DalContext, func: &Func) -> FuncResult<GetFuncR | |||
}) | |||
} | |||
|
|||
pub fn compile_return_types(ty: FuncBackendResponseType, kind: FuncBackendKind) -> &'static str { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it.
Three things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Followed up on #3474 (comment) and the comments have been cleaned up accordingly.
Great job!
c2f3fdc
to
e6818ac
Compare
As we are moving away from the concept of SchemaVariantDefinitions, we want to move the metadata that was part of a SchemaVariantDefinition to be part of the SchemaVariant This will allow us to start bringing back the authoring workflow without the need to have the concept of a SchemaVariantDefinition
By creating an edge between these nodes on the graph, we can understand what Asset func was used to create the schema variant
This still needs to be enhanced with all of the funcs associated with a schema variant. We need to ensure that those funcs are included as edges during the import process of a package
This was originally an edge but as this is a 1:1 mapping of func to schema variant it creates, we can make it part of the NodeWeight itself
Variant definitions no longer exist so we now use variants as the route instead
e6818ac
to
0e43468
Compare
lgtm, executed basic sanity test of product and everything that should work is working |
bors try |
tryBuild succeeded: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀🚀🚀🚀🚀🚀🚀🚀🚀
bors merge |
Build succeeded: |
3497: Remove unused schema variant def module and unused auth prototype code (ENG-2426) r=nickgerace a=nickgerace ## Description `SchemaVariantDefinition` no longer exists in the new engine, so this PR removes its remains from the dal. <img src="https://media0.giphy.com/media/kVgCBJOy3PuHdqT5xQ/giphy.gif"/> ## Additional Note This is a follow-up to #3474. Co-authored-by: Nick Gerace <nick@systeminit.com>
As we are moving away from the concept of SchemaVariantDefinitions, we want to move the metadata that was part of a SchemaVariantDefinition to be part of the SchemaVariant
This will allow us to start bringing back the authoring workflow without the need to have the concept of a SchemaVariantDefinition
This PR also re-implements the get_variant_def endpoint as well as renaming variant_def to be variant in the API routes