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 42 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,26 +1,26 @@
52e5e736587cb4d9615b5b48dda53d385fb4c7091864e5d7ebaf804a46519852 gencode/docs/cloud_iot_config.html
36842bbf9d023a83a3e8958fc3ae607424f4ada5b1e72be35fe2ac443cfd31cc gencode/docs/command_discovery.html
4d65d7043d4e37e7f043a3e6d4d859bc84cf6ed1c5a07d9f04b731ee9e6b16ef gencode/docs/command_mapping.html
055fbb139d51373613ae6a5ccca20f9219052ec9c53ce5fca021bef31cdd56b1 gencode/docs/command_mapping.html
d755727827955c38c6679869a4e9177e44a83770a1c6a046f953954792a6d4a4 gencode/docs/config.html
6cffb39b5071680f39a7b96bdeb8330b6a8f5fa71ed4c4d42b82d7896080dcd9 gencode/docs/config_mapping.html
21d58c8e4bfda9867e21857362fa2d722519e19fa4a6ad005eed20a00a9f6cf9 gencode/docs/config_mapping.html
62a5f579661625c0fa53320557be47711e289566b14bd0399b45395cea87ae27 gencode/docs/config_pointset.html
34e05b6966c611afd4591bdb2f1a606123326c922b0747a3b0861383d68c1177 gencode/docs/configuration_endpoint.html
01ee911c3d85ce9d5de98a77d15a78e7719bc151efdf5149082c8056b7a60bc1 gencode/docs/envelope.html
b8972d7b07d1dc6bdb82988e1e9955603a80477cac18e7745ecbd7fe78c104ba gencode/docs/event_discovery.html
971c2d352004e53c8fe4fa9370685dca8ed974a97b2e1e2382653be344010346 gencode/docs/event_mapping.html
10cbc552d6142fedefb05d480b489130f87d813cc214efd92dffe1eea51655b3 gencode/docs/event_discovery.html
f00a842119b229c7c4513a8b38be47f04bc5ceb7f39bfa4a4d09ee16bc8a4d1b gencode/docs/event_mapping.html
8133e380e40f27c56accbffc665b2eeb56ec84a4da3b52ba7aa5e439c9c40572 gencode/docs/event_pointset.html
ac05c443556b92de96ec1867e72c668da27bc53012fe5821a8035a81ed46aaaf gencode/docs/event_system.html
51cc24f8ebe5daa9f165ec401cf4745994823037ba6a0753730339ef81a57fa6 gencode/docs/event_validation.html
9d361fcd4d1c941b900aa2c1fc303240fe9092e0f4daf1061b98e2e7ac022f73 gencode/docs/event_system.html
e7ce40ff0e8bc4c92fac6e3d5623a2deec5e3251ecf63b90011f54f517450b35 gencode/docs/event_validation.html
469909f7061efeaed0942e3aad43468e56dbeb335c664412c976d9f1e4bc44c9 gencode/docs/index.html
6d5081d04c86f8bd444efb41cd788826aa66802d37e8f98e93b6b75425542d5e gencode/docs/metadata.html
a5263284652e52822c82a863fc27db765eb55861f96316f07836619376323bce gencode/docs/model_pointset.html
741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css
878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js
7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js
7dab133dd7e23d2b61b325516a274be5007ae9fc739ced3d244bb05ba0dac648 gencode/docs/state.html
053656d21797603350e92d836e8d6cdcab6733e8c20d2ae47db5cc14bc3a61e5 gencode/docs/state_mapping.html
b0c4bf203dd8ea482d0d6b7ec9549bd8ddf597faf7afdc410351e527f4cc68b1 gencode/docs/state_pointset.html
f680b255d4b185cc96347a2c6425bb33c847cf7468d309c33aa7901567cd02b7 gencode/docs/state_validation.html
91861b21fd202008b2bee4ec9fa41fce177b5a102bb026a06d6e78a758c937e3 gencode/docs/state.html
ad4aa47766ca5a20eadda450f406d17b2fcb82c36f5ef7fa55d90fef01bcd66a gencode/docs/state_mapping.html
6869a6597dfdd375a11a8db55d5361365bbdddfcf104a3a2ab06752a96c05ef8 gencode/docs/state_pointset.html
61b7084937acf7e7209b717fea7043753d66455c8ea76f03d3896a7d38c0bff1 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 @@ -94,11 +94,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
973e5377ed2a8f4087019641cf38af43153162f2b7ed38da55cae4e5e20422a2 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
b74afb49748ad18b0ee3cf0743260c634a967c352c60d8c1a8da529b21709786 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
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
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 @@ -8,6 +8,8 @@ would be categorized as `system.config.parse`, while a system config entry of
unspecified category would be just `system.config`. Some categories come with
implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy below.

* _device_: Device specific messages (ignored by UDMI system)
* _???_: (**INFO**) Special wildcard category, anything prefixed by 'device.' lands here!
* _system_: Basic system operation
* _base_: Baseline system operational messages
* _start_: (**NOTICE**) System is in the process of (re)starting and essentially offline
Expand Down
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" : [ ]
}
}
Loading