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

Validator message window and report contents #439

Merged
merged 56 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
854b6b4
gencode
grafnu Aug 26, 2022
8a9c2d3
Updating testing
grafnu Aug 26, 2022
95832d2
Removing timestamp required
grafnu Aug 26, 2022
e87adf3
Fixing docs
grafnu Aug 26, 2022
18ba496
Fix gencode
grafnu Aug 26, 2022
be4ff18
Fix file data sink capture
grafnu Aug 26, 2022
dcf5b0b
Fixing expected out
grafnu Aug 26, 2022
6f6ccae
Adding summary reports
grafnu Aug 26, 2022
d67ce41
Gencode fix
grafnu Aug 26, 2022
2e6822d
Fix docs
grafnu Aug 26, 2022
c33428d
Merge branch 'master' into validation
grafnu Aug 26, 2022
5a945b1
Merge branch 'master' into validation
grafnu Aug 27, 2022
c477acc
Merge branch 'master' into validation
grafnu Aug 29, 2022
075e5c2
Merge branch 'master' into validation
grafnu Aug 30, 2022
936f90a
Learning materials
grafnu Aug 31, 2022
5a77189
Merge remote-tracking branch 'faucet/master'
grafnu Aug 31, 2022
604cb23
Merge branch 'master' into validation
grafnu Aug 31, 2022
efcae5e
Learning Presentation materals
grafnu Aug 31, 2022
ce117a5
Merge branch 'master' into validation
grafnu Aug 31, 2022
2ed52e3
Updating learning readme.md copy text (#437)
grafnu Aug 31, 2022
07a1e0e
Merge branch 'master' into validation
grafnu Aug 31, 2022
a5d08fc
Initial refactoring
grafnu Sep 1, 2022
6d78668
Merge branch 'validation' of github.com:grafnu/udmi into validation
grafnu Sep 1, 2022
897f38c
Some changes
grafnu Sep 1, 2022
bc85abd
Fix message trace playback error handling
grafnu Sep 2, 2022
d6b770b
Linty fixes
grafnu Sep 2, 2022
588f314
Fix state timestamp handling
grafnu Sep 2, 2022
19c4975
Merge branch 'master' into validation
grafnu Sep 2, 2022
f6c5ecb
Remove learning
grafnu Sep 2, 2022
dfc17a5
Timestamp handling
grafnu Sep 2, 2022
4c062a9
Better validation error reporting
grafnu Sep 2, 2022
1e0c579
Add device category
grafnu Sep 2, 2022
2514ced
Fixing things
grafnu Sep 2, 2022
d1a61b1
Fix point name checks
grafnu Sep 2, 2022
62c2867
Fix handling
grafnu Sep 2, 2022
7a440af
Tweaking error
grafnu Sep 2, 2022
58c6280
Merge branch 'master' into validation
grafnu Sep 2, 2022
ec1058d
Gencode
grafnu Sep 2, 2022
d30b0b1
Don't use _update suffix for out files
grafnu Sep 2, 2022
b73d702
Also null check
grafnu Sep 2, 2022
ac5d7d7
Cleaning up validation messages
grafnu Sep 2, 2022
4cb308c
remove extra file
grafnu Sep 2, 2022
8f85a71
Merge branch 'master' into validation
grafnu Sep 5, 2022
7289bcd
Updating gencode
grafnu Sep 5, 2022
68dd9c1
Add clarigicaiton
grafnu Sep 5, 2022
a5f3e1e
Quote message
grafnu Sep 5, 2022
1cdb2a7
Rename helper script
grafnu Sep 5, 2022
3a71faa
Fix unknown subType
grafnu Sep 5, 2022
b7f5933
Gencode
grafnu Sep 5, 2022
10c04ff
errors out
grafnu Sep 5, 2022
aa398e1
Try moving device to the end
grafnu Sep 6, 2022
85a344d
Tweaking
grafnu Sep 6, 2022
c960e4f
Merge branch 'master' into validation
grafnu Sep 6, 2022
186d885
Restore nuke gencode_docs directory
grafnu Sep 6, 2022
37b6c92
Move location of cleanup
grafnu Sep 6, 2022
3c9d360
Refactoring conditional
grafnu Sep 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .gencode_hash.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
909b90e19ba41e691ea277eb26ff8a3b7d7bad43ecd7ac082683e97401bde9b5 gencode/docs/cloud_iot_config.html
b35646a2f3d7c30fd34e3ea6ab6a1070b39c469fd1de49cab1093ff32faaf06d gencode/docs/command_discovery.html
2fa3a4fbe63db1368214f1bbdbd5260d6a424beb0b14771ff270e2d11b3e6e0f gencode/docs/command_mapping.html
e1f62882576d0f4332360f2aedb79b37a43973fb31d862c829af924f8f310ec1 gencode/docs/command_mapping.html
d93322f64b94bc1808c59cde7b83915ff7e14d50401b9c2ae8467730ed15257c gencode/docs/config.html
51db3553042487f9b48dc130affa5deb01636313e0a9aaca12c76cb6865deaa6 gencode/docs/config_mapping.html
30c7f39e50e290b0a36a3414cf1c90277ebd249f126f85f0a307bc7b74164e08 gencode/docs/config_mapping.html
bbb98edbbc279678856c11024f4681261f0b9b58b07f8de6026be70d2e32074a gencode/docs/configuration_endpoint.html
299bc6f4d9842fab2d2cfd003d8a8adf94303c560cf71e8595d85cf661558a4d gencode/docs/configuration_pubber.html
82fbf41e4e88593f22a929fc8ade4d1e8f75a0fc1aa8452ea1d3b19023bee314 gencode/docs/envelope.html
76cd3d4f0d893646afb910c51eed3783b9d50abf75955d1bc20411fc6d738674 gencode/docs/event.html
0c829f15eba3d1b5c26b5cbef2ff42ed5ffec4adf60797ce137c1662e97c47e6 gencode/docs/event_discovery.html
885c20247cdce702362939277d5b0604c437ca71cad1e66566fb24818f46af6a gencode/docs/event_mapping.html
276158157fdf8989edf8ef9a53874246fc6e87412aea410712496de9759e922c gencode/docs/event.html
a8800ab8384de3b846af0d72cf310acf01644842b557e42eec20b69a0bfa1868 gencode/docs/event_discovery.html
3019d06826576d287edbf69116ec712c74c8fdfcc5653b51f2573cb9755ebb23 gencode/docs/event_mapping.html
71fe25d3b17d1dc87b52c049a3235c20527f73e12ffa53fa4800a15e53f73732 gencode/docs/event_pointset.html
8a48d7f06bebc571b3dba1487680565b9cda838bf68c60422a7632f6ee3d830c gencode/docs/event_system.html
2c695f6891655fa7b2b2a48fbb8503e049384bd6015f4d40f618d151c71b1a22 gencode/docs/event_validation.html
7adf725427f285539b37abdad0c15f32e76bd6e1ec7d775527491597aef32875 gencode/docs/event_system.html
43025f61381de050eae9680c3193a1d878a397d0b5515dd1063a1a993b0c41ea gencode/docs/event_validation.html
208956129b09bde2639068b0bb3282dce09b12edb5e775eeed0834fa4890a001 gencode/docs/metadata.html
5d039d607af9ec75ee552dfe36b16c702687ea16f5663f41fc49b4533b86e00d gencode/docs/properties.html
162f8f3b8ca9491e7dc1d2569d4773acae51f93b07fa875a9ece218d9d4f8a89 gencode/docs/readme.md
Expand All @@ -20,9 +20,9 @@ bbb98edbbc279678856c11024f4681261f0b9b58b07f8de6026be70d2e32074a gencode/docs/c
741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css
878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js
7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js
a5cadd7e1393d79949367ed2b8c6f9afa186936fe408b5db8505ed8dd0bfa800 gencode/docs/state.html
cef4c8fab1405459739e54c90391d67bf48a26e4d72425c63762ecd596b6d0f0 gencode/docs/state_mapping.html
6aa786392003b64c99a3862700f33f100facff2b2592b87d53e6011a7298f909 gencode/docs/state_validation.html
aa1fb0f836ccfdcb275a6763771fdc4b3a3b90a4e2e1cca97e4a929e9075c284 gencode/docs/state.html
776f696f93961b7da9fab8494d4487aea01533a8df9aab7968687f63de2f9f91 gencode/docs/state_mapping.html
06f9e538fbab613144d6d5f64274464850f60f4f730b6a04ad0e049ce34276ec gencode/docs/state_validation.html
d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/udmi/schema/Asset.java
0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java
1f2757c67215cf657297a009a01288108a04daeea919713871a2d34ea903b5f9 gencode/java/udmi/schema/BlobBlobsetConfig.java
Expand Down Expand Up @@ -96,11 +96,11 @@ d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/u
ac6f8fd87c8986cce01e872460c15ff6fe71e3816f9bde610acfe25f7d38c8d4 gencode/java/udmi/schema/ValidationEvent.java
f7d117dc8b9764acf0c95a13a2bfdfbdf31d1a8ec83a707448aa4d7391ef07e2 gencode/java/udmi/schema/ValidationState.java
e007ddd1ceeae3603c85110c33e1bb4a418ff9c7a791ca0df25b7ea3caeafd36 gencode/java/udmi/schema/ValidationSummary.java
445723ac8a6c5e7072d344fbd865bbefce409bf9a07e194b6d82e9d0751547bd gencode/python/udmi/schema/__init__.py
033a86846fb9362a37d148f9696d223a2aae2a368452487cb6042407a316225f gencode/python/udmi/schema/__init__.py
4b25dd95f863059b761269f93adcae7049507924a1c6e74d6856849203c179db gencode/python/udmi/schema/ancillary_properties.py
5ecd6c542f33450cb4ce75d940a6dff4d3bd67d4b9de4aff5ee88abcc301dbff gencode/python/udmi/schema/building_config.py
dab4f5fca272ec48c2881bca2b6bc43786ada47fa1f6dd935c35f7ce0eb6b0f6 gencode/python/udmi/schema/building_translation.py
d4269e665695f7a431108233a427313e609764f421d7657a23bd68d046f11e83 gencode/python/udmi/schema/category.py
c33fab16eb86b93692ddbb243a2d6cfe202ca1a0fd76b351a18727a35940d958 gencode/python/udmi/schema/category.py
a61b1c5732f01b7efda41a773d5786fad755f371193ce4478b458387ca2a8fe8 gencode/python/udmi/schema/cloud_iot_config.py
6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py
1254c34d973c9099ae99dcea4534e234e9019f49255e2e27d2afa1bc074fd596 gencode/python/udmi/schema/command_mapping.py
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/gencode
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [[ -n $check ]]; then
echo Checking gencode docs links...
bin/gencode_docs check_links

echo Checking gencode hash...
echo "Checking gencode hash (dynamic/static)..."
files=`find gencode/ -type f | sort`
sha256sum $files > /tmp/gencode.hash
diff /tmp/gencode.hash .gencode_hash.txt
Expand Down
9 changes: 9 additions & 0 deletions bin/gencode_categories
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import sys

GENCODE_MARKER = '@@ '
CATEGORY_MARKER = '* '
WILDCARD_REGEX = ' *\\* _\?\?\?_: (.*)'
CATEGORY_REGEX = ' *\\* _([a-z]+)_: (\(\*\*([A-Z]+)\*\*\) )?(.*)'
JSON_FORMAT = '%s%s{ "pattern": "^%s$" }'
DEVICE_PREFIX = 'device['

JAVA_DESCRIPTION = "\n%s// %s\n"
JAVA_TARGET = '%spublic static final String %s = "%s";\n'
Expand All @@ -31,6 +33,11 @@ def read_categories():
with open(doc_in) as doc:
while line := doc.readline():
indent = line.find(CATEGORY_MARKER)//2
wildcard = re.match(WILDCARD_REGEX, line)
if wildcard:
entry = (group + '[.a-z]+', 'INFO', wildcard.group(1))
categories.append(entry)
continue
match = re.match(CATEGORY_REGEX, line)
if indent < 0 or not match:
continue
Expand Down Expand Up @@ -83,6 +90,8 @@ def write_java_out(categories):
def write_java_categories(out, indent, categories):
for category in categories:
target = category[0]
if target.startswith(DEVICE_PREFIX):
continue
level = category[1]
desc = category[2]
const = target.replace('.', '_').upper()
Expand Down
8 changes: 2 additions & 6 deletions bin/gencode_docs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ fi
OUTPUT_DIR=gencode/docs
TMP_DIR=tmp/schema

schema_files=`ls schema/*.json`

if [ "$OP" == gen_bucket ]; then
rm -rf $OUTPUT_DIR $TMP_DIR

input_file=$OP
output_file=$2
Expand Down Expand Up @@ -89,11 +86,10 @@ if [ -d venv ]; then
source venv/bin/activate
fi

mkdir -p $OUTPUT_DIR
rm -rf $OUTPUT_DIR $TMP_DIR
mkdir -p $OUTPUT_DIR $TMP_DIR

# Make a copy of the schema files into a tmp folder for any pre generator fixes
rm -rf $TMP_DIR
mkdir -p $TMP_DIR
cp -r schema/. $TMP_DIR

# Remove file: prefix from references so document generator works
Expand Down
4 changes: 2 additions & 2 deletions bin/test_trace
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ rm -rf $site_out
validator/bin/validate -- schema trace $trace_name $site_model

echo
echo Comparing output with trace capture $trace_out

for file in `find $site_out -type f`; do
sed -E -i $file \
-e "s/[0-9-]{10}T[0-9:]{8}Z/1999-10-20T01:02:03Z/" \
-e 's/\\t[a-zA-Z .()$0-9]+\.java:[0-9]+\)\\n/\\tredacted\\n/g'
done

diff -r $trace_out $site_out
echo Checking diff -r $site_out $trace_out
diff -r $site_out $trace_out

echo Diff complete, no deviation found.
2 changes: 2 additions & 0 deletions docs/specs/categories.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be
* _result_: (**INFO**) Regarging the actual validation results.
* _summary_: Conditions specific to an overall site summary.
* _report_: (**INFO**) The validation summary report.
* _device_: Device specific messages (ignored by UDMI system)
* _???_: (**INFO**) Special wildcard category, anything prefixed by 'device.' lands here!
19 changes: 5 additions & 14 deletions etc/validator.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,13 @@ sites/udmi_site_model/out/devices/AHU-1/event_pointset.out
"sub_type" : "event",
"status" : {
"message" : "While converting to json node: 1 schema violations found",
"detail" : "While converting to json node: 1 schema violations found @Validator.validateMessage(Validator.java:417); 1 schema violations found; object instance has properties which are not allowed by the schema: [\"extraField\"]",
"category" : "validation.error.simple",
"timestamp" : "1999-10-20T01:02:03Z",
"level" : 500
},
"pointset" : { }
}
::::::::::::::
sites/udmi_site_model/out/devices/AHU-1/event_system.out
::::::::::::::
{
"timestamp" : "1999-10-20T01:02:03Z",
"version" : "1.3.14",
"sub_folder" : "system",
"sub_type" : "event",
"status" : {
"message" : "While converting to json node: 1 schema violations found",
"category" : "validation.error.simple",
"level" : 500
"pointset" : {
"missing" : [ ],
"extra" : [ ]
}
}
45 changes: 45 additions & 0 deletions gencode/docs/command_mapping.html

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

59 changes: 59 additions & 0 deletions gencode/docs/config_mapping.html

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

Loading