You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using fields in resources that have not been set, we currently print confusing indications for users:
cnquery>audit.advisory{*}
audit.advisory: {
description:cannotconvertprimitivewithNOtype information
worstScore:cannotconvertprimitivewithNOtype information
published:cannotconvertprimitivewithNOtype information
mrn:cannotconvertprimitivewithNOtype information
id:cannotconvertprimitivewithNOtype information
title:cannotconvertprimitivewithNOtype information
modified:cannotconvertprimitivewithNOtype information
}
What the system is trying to tell us: This resource has none of its (mandatory) values set. In this specific example, we have a resource that should be entirely pre-initialized, but has no values at all. There are also mixed use-cases, where partial values may be provided or where fields depend on values that have not been set.
None of these cases are currently handled in v9.
v8 enforced that static fields were provided or it would not allow the resource to be created.
v9 does not enforce this anymore, allowing incomplete resources to be created
There are 2 possible solutions:
A: Indicate missing fields
Soft indications that no data is provided without errors or failure
// FYI: I'm comments to indicate the gray color users see!// We are not printing comments, just gray text to soft-fail this
cnquery> audit.advisory{*}
audit.advisory: {
description: // not set
worstScore: // not set
published: // not set
mrn: // not set
id: // not set
title: // not set
modified: // not set
}
B: Error on missing fields
Same as above, but every field counts as an error
# I'm only using the highlighter to indicate errors
cnquery>audit.advisory{*}
audit.advisory: {
description:not set
worstScore:not set
published:not set
mrn:not set
id:not set
title:not set
modified:not set
}
C: Error on resource creation
This is what v8 does, just with better error messages for v9:
cnquery>audit.advisory{*}
Queryencounterederrors:failedtocreateresource'audit.advisory':novalues provided formandatoryfields'mrn', 'id', 'title', and3 others
audit.advisory:nodata available
Solution
We will need to decide on which path to take for v9.
Not a v9 release blocker, as it doesn't break behavior.
I very much likes A. I think the field should have a specific error or type that is rendered custom. In this case "not set". I like the grayed out printing. We have the same case with permissions e.g. user has no permission to retrieve the data. There is nothing the user can do, so we should not print this in a full blown error but instead make it a helpful message: hey you do not have permissions to see this part of the graph.
When using fields in resources that have not been set, we currently print confusing indications for users:
What the system is trying to tell us: This resource has none of its (mandatory) values set. In this specific example, we have a resource that should be entirely pre-initialized, but has no values at all. There are also mixed use-cases, where partial values may be provided or where fields depend on values that have not been set.
None of these cases are currently handled in v9.
There are 2 possible solutions:
A: Indicate missing fields
Soft indications that no data is provided without errors or failure
B: Error on missing fields
Same as above, but every field counts as an error
C: Error on resource creation
This is what v8 does, just with better error messages for v9:
Solution
We will need to decide on which path to take for v9.
Not a v9 release blocker, as it doesn't break behavior.
Supersedes #1721
Closes #1894 in favor of a solution that addresses this holistically.
The text was updated successfully, but these errors were encountered: