Skip to content

Commit

Permalink
Update versions in files to 1.5.0 (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
noursaidi authored Dec 12, 2023
1 parent 3decfc9 commit 769bae3
Show file tree
Hide file tree
Showing 181 changed files with 275 additions and 187 deletions.
10 changes: 6 additions & 4 deletions bin/upgrade_version
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# with a 'y' are updated. Only works with "pretty"/non-minified JSON
# - documentation in-line exammples
# - specific java files (Pubber.java, ConfigUtil.java, LocalDevice.java)
shopt -s globstar

UPVERSION_LIST=etc/upversion.txt
TESTS_REGEX="^(\s{0,4}\"version\"\s*:\s*)([0-9.\"]*)(,?)"
Expand Down Expand Up @@ -70,18 +71,19 @@ fi

if [[ -n $(git status --untracked-files=no --porcelain) ]]; then
echo ERROR Git not clean .. commit/stash all changes first
exit 1
#exit 1
fi

# Check test files exist in the upversion list
for test_file in tests/schemas/*/*.json; do
for test_file in tests/{traces,sites}/**/*.json; do
if [[ $(grep -P -c "^[^#] $test_file" $UPVERSION_LIST) != 1 ]]; then
echo $test_file
err_upversion_list=1
fi
done
if [[ -n $err_upversion_list ]]; then
echo ERROR .. above files not found in upversion list or listed more than once
echo $UPVERSION_LIST
touch $ERROR_MARKER
fi

Expand All @@ -98,14 +100,14 @@ fi

# Check files in upversion list still exist
while read action file comment; do
if [[ $action != "#" ]] && ! [[ -f $file ]]; then
if [[ $action =~ "^[?!# ]" ]] && ! [[ -f $file ]]; then
err_stale_file=1
echo $file
fi
done <$UPVERSION_LIST
if [[ -n $err_stale_file ]]; then
touch $ERROR_MARKER
echo ERROR .. above files etc/upversion.txt no longer exist
echo ERROR .. above files $UPVERSION_LIST no longer exist
fi


Expand Down
6 changes: 3 additions & 3 deletions docs/guides/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ section

The `bin/upgrade_version` tool updates :
* the `$udmi_version` field in schema files,
* the version in `version` of of manually curated payloads in `tests/*.tests`
* the version in `version` in `tests/**/*.json` according to manually curated file
* documentation inline message examples.
* the `UDMI_VERSION` constant in specific JAVA files.

Expand All @@ -42,10 +42,10 @@ which are preceded by a `y` in `upversion.txt` will have their version upgraded.

`bin/upgrade_version` does not update any generated files (e.g. for CI testing).

The following files need to be update:
The below files need to be updated. Do not blindly copy! Inspect all diffs and confirm they are expected
* After `bin/test_trace simple`, contents of `sites/udmi_site_model/sites/out`
into `tests/traces/simple/expected`
* After `bin/test_validator`, `/tmp/validator.out` into `/etc/validator.out` (reset any changes to sites/udmi_site_model before running)
* After `bin/test_validator`, `/tmp/validator.out` into `/etc/validator.out` (reset any changes to sites/udmi_site_model before running but run `bin/registrar`)
* After `bin/test_registrar && bin/test_sites`, the `out` directory for each device in `tests/downgrade.site/devices/` into the `expected` subdirectory
(note these files are ignored by git, but must still be committed)

Expand Down
6 changes: 3 additions & 3 deletions docs/specs/sequences/endpoint_reconfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Config message to initiate Reconfiguration (sequence #1 in diagrams above)
<!--example:config/endpoint_reconfiguration.json-->
```json
{
"version": "1.4.2",
"version": "1.5.0",
"blobset": {
"blobs": {
"_iot_endpoint_config": {
Expand Down Expand Up @@ -108,7 +108,7 @@ a successful reconfiguration
<!--example:state/endpoint_reconfiguration.json-->
```json
{
"version": "1.4.2",
"version": "1.5.0",
"timestamp": "2022-07-13T12:00:10.000Z",
"system": {
"hardware": {
Expand Down Expand Up @@ -138,7 +138,7 @@ This is an example of the state message sent to the original endpoint after a fa
<!--example:state/endpoint_reconfiguration_failed.json-->
```json
{
"version": "1.4.2",
"version": "1.5.0",
"timestamp": "2022-07-13T12:00:11.000Z",
"system": {
"hardware": {
Expand Down
2 changes: 1 addition & 1 deletion etc/category.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Category",
"$comment": "Auto-generated category mappings from bin/gencode_categories.",
"type": "string",
Expand Down
86 changes: 86 additions & 0 deletions etc/upversion.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,89 @@ y tests/schemas/state_validation/sequencer.json
n tests/schemas/configuration_pubber/mosquitto.json
y tests/schemas/metadata/network.json
y tests/schemas/state/networks.json
y tests/schemas/config/easing.json
y tests/schemas/config_pointset/easing.json

y tests/traces/simple/devices/AHU-1/001_event_pointset.json
y tests/traces/simple/devices/AHU-1/002_event_system.json
y tests/traces/simple/devices/AHU-1/003_event_pointset.json
n tests/traces/simple/devices/AHU-22/001_event_pointset.json # has no version field
y tests/traces/simple/devices/AHU-22/002_event_pointset.json
y tests/traces/simple/devices/AHU-22/003_event_system.json
y tests/traces/simple/devices/AHU-22/004_event_pointset.json
y tests/traces/simple/devices/GAT-123/001_state_update.json
y tests/traces/simple/devices/GAT-123/002_state_gateway.json
n tests/traces/simple/devices/GAT-123/004_state_system.json # has no version field
y tests/traces/simple/devices/SNS-4/001_event_pointset.json
y tests/traces/simple/devices/SNS-4/002_event_discovery.json
y tests/traces/simple/devices/SNS-4/003_event_system.json

# The following are updated manually by running `test_traces simple` and inspecting + copying the output
n tests/traces/simple/expected/devices/AHU-1/event_pointset.json
n tests/traces/simple/expected/devices/AHU-1/event_system.json
n tests/traces/simple/expected/devices/AHU-22/event_pointset.json
n tests/traces/simple/expected/devices/AHU-22/event_system.json
n tests/traces/simple/expected/devices/GAT-123/state_gateway.json
n tests/traces/simple/expected/devices/GAT-123/state.json
n tests/traces/simple/expected/devices/GAT-123/state_system.json
n tests/traces/simple/expected/devices/SNS-4/event_discovery.json
n tests/traces/simple/expected/devices/SNS-4/event_pointset.json
n tests/traces/simple/expected/devices/SNS-4/event_system.json
n tests/traces/simple/expected/validation_report.json

# The following are not updated because they test update/downgrade functionalities
n tests/traces/upgrade/devices/AHU-1/001_state_update.json
n tests/traces/upgrade/devices/AHU-1/002_state_system.json
n tests/traces/upgrade/devices/AHU-22/001_state_update.json
n tests/traces/upgrade/devices/NON-1/001_state_update.json
n tests/traces/upgrade/devices/NON-2/001_state_update.json
n tests/traces/upgrade/devices/SNS-4/001_state_update.json
n tests/traces/upgrade/expected/devices/AHU-1/state.json
n tests/traces/upgrade/expected/devices/AHU-1/state_system.json
n tests/traces/upgrade/expected/devices/AHU-22/state.json
n tests/traces/upgrade/expected/devices/NON-1/state.json
n tests/traces/upgrade/expected/devices/NON-2/state.json
n tests/traces/upgrade/expected/devices/SNS-4/state.json
n tests/traces/upgrade/expected/validation_report.json
n tests/sites/downgrade/cloud_iot_config.json
n tests/sites/downgrade/devices/DWN-1/expected/generated_config.json
n tests/sites/downgrade/devices/DWN-1/expected/metadata_norm.json
n tests/sites/downgrade/devices/DWN-1/metadata.json
n tests/sites/downgrade/devices/DWN-1/out/errors.json
n tests/sites/downgrade/devices/DWN-1/out/generated_config.json
n tests/sites/downgrade/devices/DWN-1/out/metadata_norm.json
n tests/sites/downgrade/devices/DWN-2/metadata.json
n tests/sites/downgrade/devices/DWN-2/out/errors.json
n tests/sites/downgrade/devices/DWN-2/out/generated_config.json
n tests/sites/downgrade/devices/DWN-2/out/metadata_norm.json
n tests/sites/downgrade/out/registration_summary.json
n tests/sites/downgrade/registration_summary.json
n tests/sites/downgrade/site_metadata.json

# These files appear to be related to the downgrade testing capability
n tests/sites/missing/cloud_iot_config.json
n tests/sites/missing/devices/AHU-1/expected/generated_config.json
n tests/sites/missing/devices/AHU-1/expected/metadata_norm.json
n tests/sites/missing/devices/AHU-1/metadata.json
n tests/sites/missing/devices/AHU-1/out/errors.json
n tests/sites/missing/devices/AHU-1/out/generated_config.json
n tests/sites/missing/devices/AHU-1/out/metadata_norm.json
n tests/sites/missing/devices/AHU-22/expected/generated_config.json
n tests/sites/missing/devices/AHU-22/expected/metadata_norm.json
n tests/sites/missing/devices/AHU-22/metadata.json
n tests/sites/missing/devices/AHU-22/out/generated_config.json
n tests/sites/missing/devices/AHU-22/out/metadata_norm.json
n tests/sites/missing/devices/GAT-123/expected/generated_config.json
n tests/sites/missing/devices/GAT-123/expected/metadata_norm.json
n tests/sites/missing/devices/GAT-123/metadata.json
n tests/sites/missing/devices/GAT-123/out/errors.json
n tests/sites/missing/devices/GAT-123/out/generated_config.json
n tests/sites/missing/devices/GAT-123/out/metadata_norm.json
n tests/sites/missing/devices/SNS-4/expected/generated_config.json
n tests/sites/missing/devices/SNS-4/expected/metadata_norm.json
n tests/sites/missing/devices/SNS-4/metadata.json
n tests/sites/missing/devices/SNS-4/out/generated_config.json
n tests/sites/missing/devices/SNS-4/out/metadata_norm.json
n tests/sites/missing/out/registration_summary.json
n tests/sites/missing/registration_summary.json
n tests/sites/missing/site_metadata.json
2 changes: 1 addition & 1 deletion schema/access_iot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"type": "object",
"title": "Iot Access",
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion schema/ancillary_properties.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Ancillary Properties",
"description": "Arbitrary blob of json associated with this point",
"existingJavaType": "java.util.HashMap<String, Object>",
Expand Down
2 changes: 1 addition & 1 deletion schema/building_translation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Building Translation",
"description": "[Discovery result](../docs/specs/discovery.md) with implicit enumeration",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/category.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Category",
"$comment": "Auto-generated category mappings from bin/gencode_categories.",
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion schema/command_discovery.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Discovery Command",
"description": "[Discovery command](../docs/specs/discovery.md) for provisioning",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/command_mapping.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Mapping Command",
"description": "[Mapping command](../docs/specs/mapping.md) for provisioning",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Common",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
Expand Down
2 changes: 1 addition & 1 deletion schema/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Config",
"description": "The config block controls a device's intended behavior. [Config Documentation](../docs/messages/config.md)",
"$section": "Messages",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_blobset.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Blobset Config",
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_blobset_blob.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Blob Blobset Config",
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_discovery.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Discovery Config",
"description": "Configuration for [discovery](../docs/specs/discovery.md)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_discovery_family.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Family Discovery Config",
"description": "Configuration for [discovery](../docs/specs/discovery.md)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_gateway.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Gateway Config",
"description": "Configuration for gateways. Only required for devices which are acting as [gateways](../docs/specs/gateway.md)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_localnet.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Localnet Config",
"description": "Used to describe device local network parameters",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_mapping.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Mapping Config",
"description": "Configuration for [mapping](../docs/specs/mapping.md)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_mapping_device.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Device Mapping Config",
"description": "Configuration for [mapping](../docs/specs/mapping.md)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_pointset.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Pointset Config",
"description": "[Pointset Config Documentation](../docs/messages/pointset.md#config)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_pointset_point.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Point Pointset Config",
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_system.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "System Config",
"description": "[System Config Documentation](../docs/messages/system.md#config)",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_system_testing.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Testing System Config",
"description": "Configuration parameters for device-under-test",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/config_udmi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Udmi Config",
"description": "Config for a UDMI reflector client",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/configuration_endpoint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Endpoint Configuration",
"description": "Parameters to define a message endpoint",
"$section": "Blobs",
Expand Down
2 changes: 1 addition & 1 deletion schema/configuration_execution.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Execution Configuration",
"description": "Parameters for configuring the execution run of a UDMI tool",
"$section": "Tool Configuration",
Expand Down
2 changes: 1 addition & 1 deletion schema/configuration_pod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Pod Configuration",
"description": "Parameters for configuring the execution run of a UDMIS pod",
"$section": "Tool Configuration",
Expand Down
2 changes: 1 addition & 1 deletion schema/configuration_pod_base.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Base Pod Configuration",
"description": "Parameters to define pod base parameters",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/configuration_pod_bridge.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Bridge Pod Configuration",
"description": "Parameters to define a bridge between message domains",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/configuration_pubber.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Pubber Configuration",
"description": "Parameters to define a pubber runtime instance",
"additionalProperties": true,
Expand Down
2 changes: 1 addition & 1 deletion schema/entry.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Entry",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schema/enumeration_feature.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$udmi_version": "1.4.2",
"$udmi_version": "1.5.0",
"title": "Feature Enumeration",
"description": "Object representation for for a single feature enumeration",
"type": "object",
Expand Down
Loading

0 comments on commit 769bae3

Please sign in to comment.