Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1077 from joyent/ether/v3.2-new-validation_results
Browse files Browse the repository at this point in the history
generate new validation results
  • Loading branch information
karenetheridge committed Jan 5, 2021
2 parents b5217d8 + c6c5e53 commit 23c8316
Show file tree
Hide file tree
Showing 63 changed files with 2,221 additions and 759 deletions.
47 changes: 32 additions & 15 deletions docs/_resources/full-schema.er
Expand Up @@ -154,7 +154,7 @@ sku
generation_name
legacy_product_name
rack_unit_size
+validation_plan_id
+legacy_validation_plan_id
purpose
bios_firmware
hba_firmware
Expand Down Expand Up @@ -286,7 +286,7 @@ value
created
deactivated

[validation] {bgcolor: "#fbfbdb"}
[legacy_validation] {bgcolor: "#fbfbdb"}
*id
name
version
Expand All @@ -296,28 +296,42 @@ created
updated
deactivated

[validation_plan] {bgcolor: "#fbfbdb"}
[legacy_validation_plan] {bgcolor: "#fbfbdb"}
*id
name
description
created
deactivated

[validation_plan_member] {bgcolor: "#fbfbdb"}
*+validation_id
*+validation_plan_id
[legacy_validation_plan_member] {bgcolor: "#fbfbdb"}
*+legacy_validation_id
*+legacy_validation_plan_id

[validation_result] {bgcolor: "#fbfbdb"}
[legacy_validation_result] {bgcolor: "#fbfbdb"}
*id
+device_id
+validation_id
+legacy_validation_id
message
hint
status {label: "error, fail, pass"}
category
component
created

[validation_result] {bgcolor: "#fbfbdb"}
*id
+json_schema_id
created
status
data_location
schema_location
error

[validation_state_member] {bgcolor: "#fbfbdb"}
*+validation_state_id
*+validation_result_id
result_order

[validation_state] {bgcolor: "#fbfbdb"}
*id
+device_report_id
Expand All @@ -326,9 +340,9 @@ created
status
+hardware_product_id

[validation_state_member] {bgcolor: "#fbfbdb"}
[legacy_validation_state_member] {bgcolor: "#fbfbdb"}
*+validation_state_id
*+validation_result_id
*+legacy_validation_result_id
result_order

[json_schema] {bgcolor: "#fbfbdb"}
Expand Down Expand Up @@ -360,7 +374,7 @@ device_relay_connection *--1 device
device_relay_connection *--1 relay
device_report *--1 device
device_setting *--1 device
hardware_product *--1 validation_plan
hardware_product *--1 legacy_validation_plan
hardware_product *--1 hardware_vendor
json_schema *--? user_account {label: "created_user_id", size: "14"}
organization_build_role *--1 build
Expand All @@ -377,12 +391,15 @@ user_organization_role +--1 organization
user_organization_role *--1 user_account
user_session_token *--1 user_account
user_setting *--1 user_account
validation_plan_member *--1 validation
validation_plan_member *--1 validation_plan
validation_result *--1 device
validation_result *--1 validation
legacy_validation_plan_member *--1 legacy_validation
legacy_validation_plan_member *--1 legacy_validation_plan
legacy_validation_result *--1 device
legacy_validation_result *--1 legacy_validation
validation_state *--1 device
validation_state *--1 device_report
validation_state *--1 hardware_product
validation_result *--1 json_schema
validation_state_member +--1 validation_result
validation_state_member *--1 validation_state
legacy_validation_state_member +--1 legacy_validation_result
legacy_validation_state_member *--1 validation_state
47 changes: 32 additions & 15 deletions docs/_resources/validations.er
Expand Up @@ -32,7 +32,7 @@ name
alias
prefix
+hardware_vendor_id
+validation_plan_id
+legacy_validation_plan_id
created
updated
deactivated
Expand Down Expand Up @@ -67,7 +67,7 @@ sata_ssd_size
sata_ssd_slots
usb_num

[validation]
[legacy_validation]
*id
name
version
Expand All @@ -77,28 +77,42 @@ created
updated
deactivated

[validation_plan]
[legacy_validation_plan]
*id
name
description
created
deactivated

[validation_plan_member] {bgcolor: "#d0e0d0"}
*+validation_id
*+validation_plan_id
[legacy_validation_plan_member] {bgcolor: "#d0e0d0"}
*+legacy_validation_id
*+legacy_validation_plan_id

[validation_result]
[legacy_validation_result]
*id
+device_id
+validation_id
+legacy_validation_id
message
hint
status {label: "error, fail, pass"}
category
component
created

[validation_result] {bgcolor: "#fbfbdb"}
*id
+json_schema_id
created
status
data_location
schema_location
error

[validation_state_member] {bgcolor: "#fbfbdb"}
*+validation_state_id
*+validation_result_id
result_order

[validation_state]
*id
+device_report_id
Expand All @@ -107,9 +121,9 @@ created
status
+hardware_product_id

[validation_state_member] {bgcolor: "#d0e0d0"}
[legacy_validation_state_member] {bgcolor: "#d0e0d0"}
*+validation_state_id
*+validation_result_id
*+legacy_validation_result_id
result_order

[json_schema] {bgcolor: "#fbfbdb"}
Expand All @@ -124,13 +138,16 @@ deactivated

device *--1 hardware_product
device_report *--1 device
hardware_product *--1 validation_plan
validation_plan_member *--1 validation
validation_plan_member *--1 validation_plan
validation_result *--1 device
validation_result *--1 validation
hardware_product *--1 legacy_validation_plan
legacy_validation_plan_member *--1 legacy_validation
legacy_validation_plan_member *--1 legacy_validation_plan
legacy_validation_result *--1 device
legacy_validation_result *--1 legacy_validation
validation_state *--1 device
validation_state *--1 device_report
validation_state *--1 hardware_product
validation_result *--1 json_schema
validation_state_member +--1 validation_result
validation_state_member *--1 validation_state
legacy_validation_state_member +--1 legacy_validation_result
legacy_validation_state_member *--1 validation_state
Binary file modified docs/images/full-schema.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/validations.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 101 additions & 7 deletions docs/json-schema/response.json
Expand Up @@ -1729,17 +1729,21 @@
"$comment" : "usually a uri - except when validating against a new schema, or referencing a json_schema in the database",
"format" : "uri-reference",
"minLength" : 1,
"title" : "Absolute Schema Location",
"type" : "string"
},
"data_location" : {
"format" : "json-pointer",
"title" : "Data Location",
"type" : "string"
},
"error" : {
"$ref" : "common.json#/$defs/non_empty_string"
"$ref" : "common.json#/$defs/non_empty_string",
"title" : "Error"
},
"schema_location" : {
"format" : "json-pointer",
"title" : "Schema Location",
"type" : "string"
}
},
Expand Down Expand Up @@ -1875,21 +1879,26 @@
"uniqueItems" : true
},
"LegacyValidationResult" : {
"$comment" : "represents the single result of evaluating a device report against one legacy validation (there may be more than one result per validation)",
"additionalProperties" : false,
"properties" : {
"category" : {
"title" : "Category",
"type" : "string"
},
"component" : {
"title" : "Component",
"type" : [
"null",
"string"
]
},
"description" : {
"title" : "Validation Description",
"type" : "string"
},
"hint" : {
"title" : "Hint",
"type" : [
"null",
"string"
Expand All @@ -1903,24 +1912,31 @@
{
"$ref" : "common.json#/$defs/uuid"
}
]
],
"title" : "ID"
},
"message" : {
"title" : "Error Message",
"type" : "string"
},
"name" : {
"$ref" : "common.json#/$defs/mojo_standard_placeholder"
"$ref" : "common.json#/$defs/mojo_standard_placeholder",
"title" : "Validation Name"
},
"status" : {
"$ref" : "common.json#/$defs/validation_status"
"$ref" : "common.json#/$defs/validation_status",
"title" : "Status"
},
"validation_id" : {
"$ref" : "common.json#/$defs/uuid"
"$ref" : "common.json#/$defs/uuid",
"title" : "Validation ID"
},
"version" : {
"$ref" : "common.json#/$defs/positive_integer"
"$ref" : "common.json#/$defs/positive_integer",
"title" : "Validation Version"
}
},
"readOnly" : true,
"required" : [
"id",
"category",
Expand Down Expand Up @@ -2965,6 +2981,77 @@
],
"type" : "object"
},
"ValidationResult" : {
"$comment" : "represents the results of evaluating a device report against one json_schema (unlike LegacyValidationResult, all errors are grouped together by json_schema)",
"additionalProperties" : false,
"else" : {
"properties" : {
"errors" : {
"minItems" : 1
}
}
},
"if" : {
"properties" : {
"status" : {
"const" : "pass"
}
}
},
"properties" : {
"$id" : {
"format" : "uri-reference",
"minLength" : 1,
"not" : {
"format" : "uri"
},
"title" : "JSON Schema Canonical URI Identifier",
"type" : "string"
},
"description" : {
"$ref" : "common.json#/$defs/non_empty_string",
"title" : "JSON Schema Description"
},
"errors" : {
"$comment" : "Note that absolute_schema_location in these errors will NOT contain the scheme and host, so as to avoid security issues arising from clicking on a link that came from a database copied from another conch instance",
"$ref" : "#/$defs/JSONSchemaErrors",
"not" : {
"contains" : {
"properties" : {
"absolute_schema_location" : {
"format" : "uri"
}
}
}
}
},
"json_schema_id" : {
"$ref" : "common.json#/$defs/uuid",
"readOnly" : true,
"title" : "JSON Schema ID"
},
"status" : {
"$ref" : "common.json#/$defs/validation_status",
"title" : "Status"
}
},
"readOnly" : true,
"required" : [
"json_schema_id",
"$id",
"description",
"status",
"errors"
],
"then" : {
"properties" : {
"errors" : {
"const" : []
}
}
},
"type" : "object"
},
"ValidationStateWithResults" : {
"additionalProperties" : false,
"properties" : {
Expand All @@ -2986,7 +3073,14 @@
},
"results" : {
"items" : {
"$ref" : "#/$defs/LegacyValidationResult"
"anyOf" : [
{
"$ref" : "#/$defs/LegacyValidationResult"
},
{
"$ref" : "#/$defs/ValidationResult"
}
]
},
"type" : "array",
"uniqueItems" : true
Expand Down

0 comments on commit 23c8316

Please sign in to comment.