From 3743c31430a9b799f1a9a4b06a483ad38f470fc5 Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:35:55 -0700 Subject: [PATCH 1/4] Add version to (event, telemetry)Ref --- lib/python/dictionary_pb2.py | 60 +++++++++---------- lib/python/dictionary_pb2.pyi | 12 ++-- pkg/grpc/hermes.pb.go | 2 +- pkg/grpc/hermes_grpc.pb.go | 2 +- pkg/pb/bus.pb.go | 2 +- pkg/pb/dictionary.pb.go | 28 +++++++-- pkg/pb/file.pb.go | 2 +- pkg/pb/fsw.pb.go | 2 +- pkg/pb/msg.pb.go | 2 +- pkg/pb/profile.pb.go | 2 +- pkg/pb/time.pb.go | 2 +- pkg/pb/type.pb.go | 2 +- pkg/timescaledb/convert.go | 4 +- proto/pb/dictionary.proto | 2 + src/modules/rpc/src/proto/hermes.json | 8 +++ src/modules/rpc/src/proto/hermes/EventRef.ts | 2 + .../rpc/src/proto/hermes/TelemetryRef.ts | 2 + src/modules/types/src/proto/index.d.ts | 12 ++++ src/modules/types/src/proto/index.js | 46 ++++++++++++++ 19 files changed, 144 insertions(+), 50 deletions(-) diff --git a/lib/python/dictionary_pb2.py b/lib/python/dictionary_pb2.py index ceea406..e74aea1 100644 --- a/lib/python/dictionary_pb2.py +++ b/lib/python/dictionary_pb2.py @@ -25,7 +25,7 @@ import type_pb2 as type__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64ictionary.proto\x12\x06hermes\x1a\ntype.proto\"i\n\x0cParameterDef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x11\n\tcomponent\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1a\n\x04type\x18\x04 \x01(\x0b\x32\x0c.hermes.Type\x12\x10\n\x08metadata\x18\x05 \x01(\t\"u\n\nCommandDef\x12\x0e\n\x06opcode\x18\x01 \x01(\x05\x12\x10\n\x08mnemonic\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12 \n\targuments\x18\x04 \x03(\x0b\x32\r.hermes.Field\x12\x10\n\x08metadata\x18\x05 \x01(\t\"z\n\x0f\x46ormatSpecifier\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.hermes.FormatSpecifierType\x12\x16\n\tprecision\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\x0e\x61rgument_index\x18\x03 \x01(\rB\x0c\n\n_precision\"Z\n\x0e\x46ormatFragment\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12,\n\tspecifier\x18\x02 \x01(\x0b\x32\x17.hermes.FormatSpecifierH\x00\x42\n\n\x08\x66ragment\"K\n\x0c\x46ormatString\x12)\n\tfragments\x18\x01 \x03(\x0b\x32\x16.hermes.FormatFragment\x12\x10\n\x08original\x18\x02 \x01(\t\"\xd3\x01\n\x08\x45ventDef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x11\n\tcomponent\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12%\n\x08severity\x18\x04 \x01(\x0e\x32\x13.hermes.EvrSeverity\x12\x19\n\rformat_string\x18\x05 \x01(\tB\x02\x18\x01\x12 \n\targuments\x18\x06 \x03(\x0b\x32\r.hermes.Field\x12\x10\n\x08metadata\x18\x07 \x01(\t\x12$\n\x06\x66ormat\x18\x08 \x01(\x0b\x32\x14.hermes.FormatString\"\x85\x01\n\x08\x45ventRef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12%\n\x08severity\x18\x04 \x01(\x0e\x32\x13.hermes.EvrSeverity\x12\x11\n\targuments\x18\x05 \x03(\t\x12\x12\n\ndictionary\x18\n \x01(\t\"o\n\x0cTelemetryDef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x1a\n\x04type\x18\x04 \x01(\x0b\x32\x0c.hermes.Type\x12\x10\n\x08metadata\x18\x06 \x01(\tJ\x04\x08\x05\x10\x06\"O\n\x0cTelemetryRef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x12\n\ndictionary\x18\n \x01(\t\"=\n\x0e\x44ictionaryHead\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\"\x95\x05\n\x13\x44ictionaryNamespace\x12;\n\x08\x63ommands\x18\x01 \x03(\x0b\x32).hermes.DictionaryNamespace.CommandsEntry\x12\x37\n\x06\x65vents\x18\x02 \x03(\x0b\x32\'.hermes.DictionaryNamespace.EventsEntry\x12=\n\ttelemetry\x18\x03 \x03(\x0b\x32*.hermes.DictionaryNamespace.TelemetryEntry\x12?\n\nparameters\x18\x04 \x03(\x0b\x32+.hermes.DictionaryNamespace.ParametersEntry\x12\x35\n\x05types\x18\x05 \x03(\x0b\x32&.hermes.DictionaryNamespace.TypesEntry\x1a\x43\n\rCommandsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.hermes.CommandDef:\x02\x38\x01\x1a?\n\x0b\x45ventsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1f\n\x05value\x18\x02 \x01(\x0b\x32\x10.hermes.EventDef:\x02\x38\x01\x1a\x46\n\x0eTelemetryEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.hermes.TelemetryDef:\x02\x38\x01\x1aG\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.hermes.ParameterDef:\x02\x38\x01\x1a:\n\nTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.hermes.Type:\x02\x38\x01\"\xa2\x02\n\nDictionary\x12$\n\x04head\x18\x01 \x01(\x0b\x32\x16.hermes.DictionaryHead\x12\x30\n\x07\x63ontent\x18\x02 \x03(\x0b\x32\x1f.hermes.Dictionary.ContentEntry\x12\x32\n\x08metadata\x18\x03 \x03(\x0b\x32 .hermes.Dictionary.MetadataEntry\x12\n\n\x02id\x18\x04 \x01(\t\x1aK\n\x0c\x43ontentEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.hermes.DictionaryNamespace:\x02\x38\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*\x99\x01\n\x0b\x45vrSeverity\x12\x12\n\x0e\x45VR_DIAGNOSTIC\x10\x00\x12\x14\n\x10\x45VR_ACTIVITY_LOW\x10\x01\x12\x15\n\x11\x45VR_ACTIVITY_HIGH\x10\x02\x12\x13\n\x0f\x45VR_WARNING_LOW\x10\x03\x12\x14\n\x10\x45VR_WARNING_HIGH\x10\x04\x12\x0f\n\x0b\x45VR_COMMAND\x10\x05\x12\r\n\tEVR_FATAL\x10\x06*\xf8\x01\n\x13\x46ormatSpecifierType\x12\x0f\n\x0b\x46MT_DEFAULT\x10\x00\x12\x0c\n\x08\x46MT_CHAR\x10\x01\x12\x0f\n\x0b\x46MT_DECIMAL\x10\x02\x12\x11\n\rFMT_HEX_LOWER\x10\x03\x12\x11\n\rFMT_HEX_UPPER\x10\x04\x12\r\n\tFMT_OCTAL\x10\x05\x12\x11\n\rFMT_EXP_LOWER\x10\x06\x12\x11\n\rFMT_EXP_UPPER\x10\x07\x12\x13\n\x0f\x46MT_FIXED_LOWER\x10\x08\x12\x13\n\x0f\x46MT_FIXED_UPPER\x10\t\x12\x15\n\x11\x46MT_GENERAL_LOWER\x10\n\x12\x15\n\x11\x46MT_GENERAL_UPPER\x10\x0b\x42\x1fZ\x1dgithub.com/nasa/hermes/pkg/pbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64ictionary.proto\x12\x06hermes\x1a\ntype.proto\"i\n\x0cParameterDef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x11\n\tcomponent\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1a\n\x04type\x18\x04 \x01(\x0b\x32\x0c.hermes.Type\x12\x10\n\x08metadata\x18\x05 \x01(\t\"u\n\nCommandDef\x12\x0e\n\x06opcode\x18\x01 \x01(\x05\x12\x10\n\x08mnemonic\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12 \n\targuments\x18\x04 \x03(\x0b\x32\r.hermes.Field\x12\x10\n\x08metadata\x18\x05 \x01(\t\"z\n\x0f\x46ormatSpecifier\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.hermes.FormatSpecifierType\x12\x16\n\tprecision\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x16\n\x0e\x61rgument_index\x18\x03 \x01(\rB\x0c\n\n_precision\"Z\n\x0e\x46ormatFragment\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12,\n\tspecifier\x18\x02 \x01(\x0b\x32\x17.hermes.FormatSpecifierH\x00\x42\n\n\x08\x66ragment\"K\n\x0c\x46ormatString\x12)\n\tfragments\x18\x01 \x03(\x0b\x32\x16.hermes.FormatFragment\x12\x10\n\x08original\x18\x02 \x01(\t\"\xd3\x01\n\x08\x45ventDef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x11\n\tcomponent\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12%\n\x08severity\x18\x04 \x01(\x0e\x32\x13.hermes.EvrSeverity\x12\x19\n\rformat_string\x18\x05 \x01(\tB\x02\x18\x01\x12 \n\targuments\x18\x06 \x03(\x0b\x32\r.hermes.Field\x12\x10\n\x08metadata\x18\x07 \x01(\t\x12$\n\x06\x66ormat\x18\x08 \x01(\x0b\x32\x14.hermes.FormatString\"\x96\x01\n\x08\x45ventRef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12%\n\x08severity\x18\x04 \x01(\x0e\x32\x13.hermes.EvrSeverity\x12\x11\n\targuments\x18\x05 \x03(\t\x12\x12\n\ndictionary\x18\n \x01(\t\x12\x0f\n\x07version\x18\x0b \x01(\t\"o\n\x0cTelemetryDef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x1a\n\x04type\x18\x04 \x01(\x0b\x32\x0c.hermes.Type\x12\x10\n\x08metadata\x18\x06 \x01(\tJ\x04\x08\x05\x10\x06\"`\n\x0cTelemetryRef\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x12\n\ndictionary\x18\n \x01(\t\x12\x0f\n\x07version\x18\x0b \x01(\t\"=\n\x0e\x44ictionaryHead\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\"\x95\x05\n\x13\x44ictionaryNamespace\x12;\n\x08\x63ommands\x18\x01 \x03(\x0b\x32).hermes.DictionaryNamespace.CommandsEntry\x12\x37\n\x06\x65vents\x18\x02 \x03(\x0b\x32\'.hermes.DictionaryNamespace.EventsEntry\x12=\n\ttelemetry\x18\x03 \x03(\x0b\x32*.hermes.DictionaryNamespace.TelemetryEntry\x12?\n\nparameters\x18\x04 \x03(\x0b\x32+.hermes.DictionaryNamespace.ParametersEntry\x12\x35\n\x05types\x18\x05 \x03(\x0b\x32&.hermes.DictionaryNamespace.TypesEntry\x1a\x43\n\rCommandsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.hermes.CommandDef:\x02\x38\x01\x1a?\n\x0b\x45ventsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1f\n\x05value\x18\x02 \x01(\x0b\x32\x10.hermes.EventDef:\x02\x38\x01\x1a\x46\n\x0eTelemetryEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.hermes.TelemetryDef:\x02\x38\x01\x1aG\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.hermes.ParameterDef:\x02\x38\x01\x1a:\n\nTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.hermes.Type:\x02\x38\x01\"\xa2\x02\n\nDictionary\x12$\n\x04head\x18\x01 \x01(\x0b\x32\x16.hermes.DictionaryHead\x12\x30\n\x07\x63ontent\x18\x02 \x03(\x0b\x32\x1f.hermes.Dictionary.ContentEntry\x12\x32\n\x08metadata\x18\x03 \x03(\x0b\x32 .hermes.Dictionary.MetadataEntry\x12\n\n\x02id\x18\x04 \x01(\t\x1aK\n\x0c\x43ontentEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.hermes.DictionaryNamespace:\x02\x38\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*\x99\x01\n\x0b\x45vrSeverity\x12\x12\n\x0e\x45VR_DIAGNOSTIC\x10\x00\x12\x14\n\x10\x45VR_ACTIVITY_LOW\x10\x01\x12\x15\n\x11\x45VR_ACTIVITY_HIGH\x10\x02\x12\x13\n\x0f\x45VR_WARNING_LOW\x10\x03\x12\x14\n\x10\x45VR_WARNING_HIGH\x10\x04\x12\x0f\n\x0b\x45VR_COMMAND\x10\x05\x12\r\n\tEVR_FATAL\x10\x06*\xf8\x01\n\x13\x46ormatSpecifierType\x12\x0f\n\x0b\x46MT_DEFAULT\x10\x00\x12\x0c\n\x08\x46MT_CHAR\x10\x01\x12\x0f\n\x0b\x46MT_DECIMAL\x10\x02\x12\x11\n\rFMT_HEX_LOWER\x10\x03\x12\x11\n\rFMT_HEX_UPPER\x10\x04\x12\r\n\tFMT_OCTAL\x10\x05\x12\x11\n\rFMT_EXP_LOWER\x10\x06\x12\x11\n\rFMT_EXP_UPPER\x10\x07\x12\x13\n\x0f\x46MT_FIXED_LOWER\x10\x08\x12\x13\n\x0f\x46MT_FIXED_UPPER\x10\t\x12\x15\n\x11\x46MT_GENERAL_LOWER\x10\n\x12\x15\n\x11\x46MT_GENERAL_UPPER\x10\x0b\x42\x1fZ\x1dgithub.com/nasa/hermes/pkg/pbb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -49,10 +49,10 @@ _globals['_DICTIONARY_CONTENTENTRY']._serialized_options = b'8\001' _globals['_DICTIONARY_METADATAENTRY']._loaded_options = None _globals['_DICTIONARY_METADATAENTRY']._serialized_options = b'8\001' - _globals['_EVRSEVERITY']._serialized_start=2124 - _globals['_EVRSEVERITY']._serialized_end=2277 - _globals['_FORMATSPECIFIERTYPE']._serialized_start=2280 - _globals['_FORMATSPECIFIERTYPE']._serialized_end=2528 + _globals['_EVRSEVERITY']._serialized_start=2158 + _globals['_EVRSEVERITY']._serialized_end=2311 + _globals['_FORMATSPECIFIERTYPE']._serialized_start=2314 + _globals['_FORMATSPECIFIERTYPE']._serialized_end=2562 _globals['_PARAMETERDEF']._serialized_start=40 _globals['_PARAMETERDEF']._serialized_end=145 _globals['_COMMANDDEF']._serialized_start=147 @@ -66,29 +66,29 @@ _globals['_EVENTDEF']._serialized_start=560 _globals['_EVENTDEF']._serialized_end=771 _globals['_EVENTREF']._serialized_start=774 - _globals['_EVENTREF']._serialized_end=907 - _globals['_TELEMETRYDEF']._serialized_start=909 - _globals['_TELEMETRYDEF']._serialized_end=1020 - _globals['_TELEMETRYREF']._serialized_start=1022 - _globals['_TELEMETRYREF']._serialized_end=1101 - _globals['_DICTIONARYHEAD']._serialized_start=1103 - _globals['_DICTIONARYHEAD']._serialized_end=1164 - _globals['_DICTIONARYNAMESPACE']._serialized_start=1167 - _globals['_DICTIONARYNAMESPACE']._serialized_end=1828 - _globals['_DICTIONARYNAMESPACE_COMMANDSENTRY']._serialized_start=1491 - _globals['_DICTIONARYNAMESPACE_COMMANDSENTRY']._serialized_end=1558 - _globals['_DICTIONARYNAMESPACE_EVENTSENTRY']._serialized_start=1560 - _globals['_DICTIONARYNAMESPACE_EVENTSENTRY']._serialized_end=1623 - _globals['_DICTIONARYNAMESPACE_TELEMETRYENTRY']._serialized_start=1625 - _globals['_DICTIONARYNAMESPACE_TELEMETRYENTRY']._serialized_end=1695 - _globals['_DICTIONARYNAMESPACE_PARAMETERSENTRY']._serialized_start=1697 - _globals['_DICTIONARYNAMESPACE_PARAMETERSENTRY']._serialized_end=1768 - _globals['_DICTIONARYNAMESPACE_TYPESENTRY']._serialized_start=1770 - _globals['_DICTIONARYNAMESPACE_TYPESENTRY']._serialized_end=1828 - _globals['_DICTIONARY']._serialized_start=1831 - _globals['_DICTIONARY']._serialized_end=2121 - _globals['_DICTIONARY_CONTENTENTRY']._serialized_start=1997 - _globals['_DICTIONARY_CONTENTENTRY']._serialized_end=2072 - _globals['_DICTIONARY_METADATAENTRY']._serialized_start=2074 - _globals['_DICTIONARY_METADATAENTRY']._serialized_end=2121 + _globals['_EVENTREF']._serialized_end=924 + _globals['_TELEMETRYDEF']._serialized_start=926 + _globals['_TELEMETRYDEF']._serialized_end=1037 + _globals['_TELEMETRYREF']._serialized_start=1039 + _globals['_TELEMETRYREF']._serialized_end=1135 + _globals['_DICTIONARYHEAD']._serialized_start=1137 + _globals['_DICTIONARYHEAD']._serialized_end=1198 + _globals['_DICTIONARYNAMESPACE']._serialized_start=1201 + _globals['_DICTIONARYNAMESPACE']._serialized_end=1862 + _globals['_DICTIONARYNAMESPACE_COMMANDSENTRY']._serialized_start=1525 + _globals['_DICTIONARYNAMESPACE_COMMANDSENTRY']._serialized_end=1592 + _globals['_DICTIONARYNAMESPACE_EVENTSENTRY']._serialized_start=1594 + _globals['_DICTIONARYNAMESPACE_EVENTSENTRY']._serialized_end=1657 + _globals['_DICTIONARYNAMESPACE_TELEMETRYENTRY']._serialized_start=1659 + _globals['_DICTIONARYNAMESPACE_TELEMETRYENTRY']._serialized_end=1729 + _globals['_DICTIONARYNAMESPACE_PARAMETERSENTRY']._serialized_start=1731 + _globals['_DICTIONARYNAMESPACE_PARAMETERSENTRY']._serialized_end=1802 + _globals['_DICTIONARYNAMESPACE_TYPESENTRY']._serialized_start=1804 + _globals['_DICTIONARYNAMESPACE_TYPESENTRY']._serialized_end=1862 + _globals['_DICTIONARY']._serialized_start=1865 + _globals['_DICTIONARY']._serialized_end=2155 + _globals['_DICTIONARY_CONTENTENTRY']._serialized_start=2031 + _globals['_DICTIONARY_CONTENTENTRY']._serialized_end=2106 + _globals['_DICTIONARY_METADATAENTRY']._serialized_start=2108 + _globals['_DICTIONARY_METADATAENTRY']._serialized_end=2155 # @@protoc_insertion_point(module_scope) diff --git a/lib/python/dictionary_pb2.pyi b/lib/python/dictionary_pb2.pyi index 9619365..c3da049 100644 --- a/lib/python/dictionary_pb2.pyi +++ b/lib/python/dictionary_pb2.pyi @@ -127,20 +127,22 @@ class EventDef(_message.Message): def __init__(self, id: _Optional[int] = ..., component: _Optional[str] = ..., name: _Optional[str] = ..., severity: _Optional[_Union[EvrSeverity, str]] = ..., format_string: _Optional[str] = ..., arguments: _Optional[_Iterable[_Union[_type_pb2.Field, _Mapping]]] = ..., metadata: _Optional[str] = ..., format: _Optional[_Union[FormatString, _Mapping]] = ...) -> None: ... class EventRef(_message.Message): - __slots__ = ("id", "name", "component", "severity", "arguments", "dictionary") + __slots__ = ("id", "name", "component", "severity", "arguments", "dictionary", "version") ID_FIELD_NUMBER: _ClassVar[int] NAME_FIELD_NUMBER: _ClassVar[int] COMPONENT_FIELD_NUMBER: _ClassVar[int] SEVERITY_FIELD_NUMBER: _ClassVar[int] ARGUMENTS_FIELD_NUMBER: _ClassVar[int] DICTIONARY_FIELD_NUMBER: _ClassVar[int] + VERSION_FIELD_NUMBER: _ClassVar[int] id: int name: str component: str severity: EvrSeverity arguments: _containers.RepeatedScalarFieldContainer[str] dictionary: str - def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., component: _Optional[str] = ..., severity: _Optional[_Union[EvrSeverity, str]] = ..., arguments: _Optional[_Iterable[str]] = ..., dictionary: _Optional[str] = ...) -> None: ... + version: str + def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., component: _Optional[str] = ..., severity: _Optional[_Union[EvrSeverity, str]] = ..., arguments: _Optional[_Iterable[str]] = ..., dictionary: _Optional[str] = ..., version: _Optional[str] = ...) -> None: ... class TelemetryDef(_message.Message): __slots__ = ("id", "name", "component", "type", "metadata") @@ -157,16 +159,18 @@ class TelemetryDef(_message.Message): def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., component: _Optional[str] = ..., type: _Optional[_Union[_type_pb2.Type, _Mapping]] = ..., metadata: _Optional[str] = ...) -> None: ... class TelemetryRef(_message.Message): - __slots__ = ("id", "name", "component", "dictionary") + __slots__ = ("id", "name", "component", "dictionary", "version") ID_FIELD_NUMBER: _ClassVar[int] NAME_FIELD_NUMBER: _ClassVar[int] COMPONENT_FIELD_NUMBER: _ClassVar[int] DICTIONARY_FIELD_NUMBER: _ClassVar[int] + VERSION_FIELD_NUMBER: _ClassVar[int] id: int name: str component: str dictionary: str - def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., component: _Optional[str] = ..., dictionary: _Optional[str] = ...) -> None: ... + version: str + def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., component: _Optional[str] = ..., dictionary: _Optional[str] = ..., version: _Optional[str] = ...) -> None: ... class DictionaryHead(_message.Message): __slots__ = ("type", "name", "version") diff --git a/pkg/grpc/hermes.pb.go b/pkg/grpc/hermes.pb.go index b504939..57afed3 100644 --- a/pkg/grpc/hermes.pb.go +++ b/pkg/grpc/hermes.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: hermes.proto package grpc diff --git a/pkg/grpc/hermes_grpc.pb.go b/pkg/grpc/hermes_grpc.pb.go index c2a4c48..cb4aff0 100644 --- a/pkg/grpc/hermes_grpc.pb.go +++ b/pkg/grpc/hermes_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.2 -// - protoc v4.25.2 +// - protoc v7.35.1 // source: hermes.proto package grpc diff --git a/pkg/pb/bus.pb.go b/pkg/pb/bus.pb.go index 53953fd..4522b2c 100644 --- a/pkg/pb/bus.pb.go +++ b/pkg/pb/bus.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: bus.proto package pb diff --git a/pkg/pb/dictionary.pb.go b/pkg/pb/dictionary.pb.go index c6317cf..dd3db0b 100644 --- a/pkg/pb/dictionary.pb.go +++ b/pkg/pb/dictionary.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: dictionary.proto package pb @@ -660,6 +660,7 @@ type EventRef struct { Arguments []string `protobuf:"bytes,5,rep,name=arguments,proto3" json:"arguments,omitempty"` // (optional) dictionary ID this comes from Dictionary string `protobuf:"bytes,10,opt,name=dictionary,proto3" json:"dictionary,omitempty"` + Version string `protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -736,6 +737,13 @@ func (x *EventRef) GetDictionary() string { return "" } +func (x *EventRef) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type TelemetryDef struct { state protoimpl.MessageState `protogen:"open.v1"` // * @@ -828,6 +836,7 @@ type TelemetryRef struct { Component string `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"` // (optional) dictionary ID this comes from Dictionary string `protobuf:"bytes,10,opt,name=dictionary,proto3" json:"dictionary,omitempty"` + Version string `protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -890,6 +899,13 @@ func (x *TelemetryRef) GetDictionary() string { return "" } +func (x *TelemetryRef) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type DictionaryHead struct { state protoimpl.MessageState `protogen:"open.v1"` // * @@ -1150,7 +1166,7 @@ const file_dictionary_proto_rawDesc = "" + "\rformat_string\x18\x05 \x01(\tB\x02\x18\x01R\fformatString\x12+\n" + "\targuments\x18\x06 \x03(\v2\r.hermes.FieldR\targuments\x12\x1a\n" + "\bmetadata\x18\a \x01(\tR\bmetadata\x12,\n" + - "\x06format\x18\b \x01(\v2\x14.hermes.FormatStringR\x06format\"\xbb\x01\n" + + "\x06format\x18\b \x01(\v2\x14.hermes.FormatStringR\x06format\"\xd5\x01\n" + "\bEventRef\x12\x0e\n" + "\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + @@ -1160,13 +1176,14 @@ const file_dictionary_proto_rawDesc = "" + "\n" + "dictionary\x18\n" + " \x01(\tR\n" + - "dictionary\"\x94\x01\n" + + "dictionary\x12\x18\n" + + "\aversion\x18\v \x01(\tR\aversion\"\x94\x01\n" + "\fTelemetryDef\x12\x0e\n" + "\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + "\tcomponent\x18\x03 \x01(\tR\tcomponent\x12 \n" + "\x04type\x18\x04 \x01(\v2\f.hermes.TypeR\x04type\x12\x1a\n" + - "\bmetadata\x18\x06 \x01(\tR\bmetadataJ\x04\b\x05\x10\x06\"p\n" + + "\bmetadata\x18\x06 \x01(\tR\bmetadataJ\x04\b\x05\x10\x06\"\x8a\x01\n" + "\fTelemetryRef\x12\x0e\n" + "\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + @@ -1174,7 +1191,8 @@ const file_dictionary_proto_rawDesc = "" + "\n" + "dictionary\x18\n" + " \x01(\tR\n" + - "dictionary\"R\n" + + "dictionary\x12\x18\n" + + "\aversion\x18\v \x01(\tR\aversion\"R\n" + "\x0eDictionaryHead\x12\x12\n" + "\x04type\x18\x01 \x01(\tR\x04type\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x18\n" + diff --git a/pkg/pb/file.pb.go b/pkg/pb/file.pb.go index 66e1aad..34f18be 100644 --- a/pkg/pb/file.pb.go +++ b/pkg/pb/file.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: file.proto package pb diff --git a/pkg/pb/fsw.pb.go b/pkg/pb/fsw.pb.go index 30f6f88..0bc02ef 100644 --- a/pkg/pb/fsw.pb.go +++ b/pkg/pb/fsw.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: fsw.proto package pb diff --git a/pkg/pb/msg.pb.go b/pkg/pb/msg.pb.go index 2946054..18e4773 100644 --- a/pkg/pb/msg.pb.go +++ b/pkg/pb/msg.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: msg.proto package pb diff --git a/pkg/pb/profile.pb.go b/pkg/pb/profile.pb.go index 1623eea..a7d6f07 100644 --- a/pkg/pb/profile.pb.go +++ b/pkg/pb/profile.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: profile.proto package pb diff --git a/pkg/pb/time.pb.go b/pkg/pb/time.pb.go index 9777b76..2bfbeb4 100644 --- a/pkg/pb/time.pb.go +++ b/pkg/pb/time.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: time.proto package pb diff --git a/pkg/pb/type.pb.go b/pkg/pb/type.pb.go index b09a9a6..de6c50d 100644 --- a/pkg/pb/type.pb.go +++ b/pkg/pb/type.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.2 +// protoc v7.35.1 // source: type.proto package pb diff --git a/pkg/timescaledb/convert.go b/pkg/timescaledb/convert.go index 4f79bb8..2bdb302 100644 --- a/pkg/timescaledb/convert.go +++ b/pkg/timescaledb/convert.go @@ -60,7 +60,7 @@ func InsertEvent(ctx context.Context, db *sql.DB, msg *pb.SourcedEvent) error { ref := event.GetRef() if _, err := tx.ExecContext(ctx, insertEventDefSQL, - ref.GetId(), ref.GetComponent(), ref.GetName(), ref.GetSeverity(), string(defArgs), + ref.GetId(), ref.GetVersion(), ref.GetComponent(), ref.GetName(), ref.GetSeverity(), string(defArgs), ); err != nil { return fmt.Errorf("failed to insert event def: %w", err) } @@ -91,7 +91,7 @@ func InsertTelemetry(ctx context.Context, db *sql.DB, msg *pb.SourcedTelemetry) defer tx.Rollback() if _, err := tx.ExecContext(ctx, insertTelemetryDefSQL, - def.GetId(), def.GetName(), def.GetComponent(), + def.GetId(), def.GetVersion(), def.GetName(), def.GetComponent(), ); err != nil { return fmt.Errorf("failed to insert telemetry def: %w", err) } diff --git a/proto/pb/dictionary.proto b/proto/pb/dictionary.proto index 4452c8f..6bf7d64 100644 --- a/proto/pb/dictionary.proto +++ b/proto/pb/dictionary.proto @@ -159,6 +159,7 @@ message EventRef { // (optional) dictionary ID this comes from string dictionary = 10; + string version = 11; } message TelemetryDef { @@ -195,6 +196,7 @@ message TelemetryRef { // (optional) dictionary ID this comes from string dictionary = 10; + string version = 11; } message DictionaryHead { diff --git a/src/modules/rpc/src/proto/hermes.json b/src/modules/rpc/src/proto/hermes.json index f80c77f..dbc4e24 100644 --- a/src/modules/rpc/src/proto/hermes.json +++ b/src/modules/rpc/src/proto/hermes.json @@ -370,6 +370,10 @@ "dictionary": { "type": "string", "id": 10 + }, + "version": { + "type": "string", + "id": 11 } } }, @@ -420,6 +424,10 @@ "dictionary": { "type": "string", "id": 10 + }, + "version": { + "type": "string", + "id": 11 } } }, diff --git a/src/modules/rpc/src/proto/hermes/EventRef.ts b/src/modules/rpc/src/proto/hermes/EventRef.ts index 357319b..3b548f1 100644 --- a/src/modules/rpc/src/proto/hermes/EventRef.ts +++ b/src/modules/rpc/src/proto/hermes/EventRef.ts @@ -9,6 +9,7 @@ export interface EventRef { 'severity'?: (_hermes_EvrSeverity); 'arguments'?: (string)[]; 'dictionary'?: (string); + 'version'?: (string); } export interface EventRef__Output { @@ -18,4 +19,5 @@ export interface EventRef__Output { 'severity'?: (_hermes_EvrSeverity__Output); 'arguments'?: (string)[]; 'dictionary'?: (string); + 'version'?: (string); } diff --git a/src/modules/rpc/src/proto/hermes/TelemetryRef.ts b/src/modules/rpc/src/proto/hermes/TelemetryRef.ts index 423ba38..5ce77f4 100644 --- a/src/modules/rpc/src/proto/hermes/TelemetryRef.ts +++ b/src/modules/rpc/src/proto/hermes/TelemetryRef.ts @@ -6,6 +6,7 @@ export interface TelemetryRef { 'name'?: (string); 'component'?: (string); 'dictionary'?: (string); + 'version'?: (string); } export interface TelemetryRef__Output { @@ -13,4 +14,5 @@ export interface TelemetryRef__Output { 'name'?: (string); 'component'?: (string); 'dictionary'?: (string); + 'version'?: (string); } diff --git a/src/modules/types/src/proto/index.d.ts b/src/modules/types/src/proto/index.d.ts index 1741120..975b525 100644 --- a/src/modules/types/src/proto/index.d.ts +++ b/src/modules/types/src/proto/index.d.ts @@ -4288,6 +4288,9 @@ export namespace hermes { /** EventRef dictionary */ dictionary?: (string|null); + + /** EventRef version */ + version?: (string|null); } /** Represents an EventRef. */ @@ -4317,6 +4320,9 @@ export namespace hermes { /** EventRef dictionary. */ public dictionary: string; + /** EventRef version. */ + public version: string; + /** * Creates a new EventRef instance using the specified properties. * @param [properties] Properties to set @@ -4530,6 +4536,9 @@ export namespace hermes { /** TelemetryRef dictionary */ dictionary?: (string|null); + + /** TelemetryRef version */ + version?: (string|null); } /** Represents a TelemetryRef. */ @@ -4553,6 +4562,9 @@ export namespace hermes { /** TelemetryRef dictionary. */ public dictionary: string; + /** TelemetryRef version. */ + public version: string; + /** * Creates a new TelemetryRef instance using the specified properties. * @param [properties] Properties to set diff --git a/src/modules/types/src/proto/index.js b/src/modules/types/src/proto/index.js index 53fec27..c566336 100644 --- a/src/modules/types/src/proto/index.js +++ b/src/modules/types/src/proto/index.js @@ -11530,6 +11530,7 @@ $root.hermes = (function() { * @property {hermes.EvrSeverity|null} [severity] EventRef severity * @property {Array.|null} ["arguments"] EventRef arguments * @property {string|null} [dictionary] EventRef dictionary + * @property {string|null} [version] EventRef version */ /** @@ -11596,6 +11597,14 @@ $root.hermes = (function() { */ EventRef.prototype.dictionary = ""; + /** + * EventRef version. + * @member {string} version + * @memberof hermes.EventRef + * @instance + */ + EventRef.prototype.version = ""; + /** * Creates a new EventRef instance using the specified properties. * @function create @@ -11633,6 +11642,8 @@ $root.hermes = (function() { writer.uint32(/* id 5, wireType 2 =*/42).string(message["arguments"][i]); if (message.dictionary != null && Object.hasOwnProperty.call(message, "dictionary")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.dictionary); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.version); return writer; }; @@ -11693,6 +11704,10 @@ $root.hermes = (function() { message.dictionary = reader.string(); break; } + case 11: { + message.version = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11760,6 +11775,9 @@ $root.hermes = (function() { if (message.dictionary != null && message.hasOwnProperty("dictionary")) if (!$util.isString(message.dictionary)) return "dictionary: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; return null; }; @@ -11826,6 +11844,8 @@ $root.hermes = (function() { } if (object.dictionary != null) message.dictionary = String(object.dictionary); + if (object.version != null) + message.version = String(object.version); return message; }; @@ -11850,6 +11870,7 @@ $root.hermes = (function() { object.component = ""; object.severity = options.enums === String ? "EVR_DIAGNOSTIC" : 0; object.dictionary = ""; + object.version = ""; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -11866,6 +11887,8 @@ $root.hermes = (function() { } if (message.dictionary != null && message.hasOwnProperty("dictionary")) object.dictionary = message.dictionary; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; @@ -12209,6 +12232,7 @@ $root.hermes = (function() { * @property {string|null} [name] TelemetryRef name * @property {string|null} [component] TelemetryRef component * @property {string|null} [dictionary] TelemetryRef dictionary + * @property {string|null} [version] TelemetryRef version */ /** @@ -12258,6 +12282,14 @@ $root.hermes = (function() { */ TelemetryRef.prototype.dictionary = ""; + /** + * TelemetryRef version. + * @member {string} version + * @memberof hermes.TelemetryRef + * @instance + */ + TelemetryRef.prototype.version = ""; + /** * Creates a new TelemetryRef instance using the specified properties. * @function create @@ -12290,6 +12322,8 @@ $root.hermes = (function() { writer.uint32(/* id 3, wireType 2 =*/26).string(message.component); if (message.dictionary != null && Object.hasOwnProperty.call(message, "dictionary")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.dictionary); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.version); return writer; }; @@ -12340,6 +12374,10 @@ $root.hermes = (function() { message.dictionary = reader.string(); break; } + case 11: { + message.version = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12387,6 +12425,9 @@ $root.hermes = (function() { if (message.dictionary != null && message.hasOwnProperty("dictionary")) if (!$util.isString(message.dictionary)) return "dictionary: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; return null; }; @@ -12410,6 +12451,8 @@ $root.hermes = (function() { message.component = String(object.component); if (object.dictionary != null) message.dictionary = String(object.dictionary); + if (object.version != null) + message.version = String(object.version); return message; }; @@ -12431,6 +12474,7 @@ $root.hermes = (function() { object.name = ""; object.component = ""; object.dictionary = ""; + object.version = ""; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -12440,6 +12484,8 @@ $root.hermes = (function() { object.component = message.component; if (message.dictionary != null && message.hasOwnProperty("dictionary")) object.dictionary = message.dictionary; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; From 2c533aaa52021a014379226be7cf37b88963debd Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:43:31 -0700 Subject: [PATCH 2/4] Add version to schema --- pkg/pb/util.go | 2 ++ pkg/timescaledb/convert.go | 8 ++++---- pkg/timescaledb/schema.sql | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pkg/pb/util.go b/pkg/pb/util.go index 9d91b18..f0c7609 100644 --- a/pkg/pb/util.go +++ b/pkg/pb/util.go @@ -26,6 +26,7 @@ func (e *EventDef) ToRef() *EventRef { Severity: e.GetSeverity(), Arguments: e.ArgNames(), Dictionary: "", // TODO(tumbar) Is there an easy way to fill this + Version: "", // TODO: One more thing to fill :) } } @@ -35,5 +36,6 @@ func (e *TelemetryDef) ToRef() *TelemetryRef { Component: e.GetComponent(), Name: e.GetName(), Dictionary: "", // TODO(tumbar) Is there an easy way to fill this + Version: "", // TODO: One more thing to fill :) } } diff --git a/pkg/timescaledb/convert.go b/pkg/timescaledb/convert.go index 2bdb302..fc1e4cb 100644 --- a/pkg/timescaledb/convert.go +++ b/pkg/timescaledb/convert.go @@ -12,12 +12,12 @@ import ( ) const ( - insertEventDefSQL = `INSERT INTO eventDefs (id, component, name, severity, args) - VALUES ($1, $2, $3, $4, $5) ON CONFLICT DO NOTHING` + insertEventDefSQL = `INSERT INTO eventDefs (id, version, component, name, severity, args) + VALUES ($1, $2, $3, $4, $5, $6) ON CONFLICT DO NOTHING` insertEventSQL = `INSERT INTO events (eventDefId, time, timeSclk, message, source, args, ert) VALUES ($1, $2, $3, $4, $5, $6, $7) ON CONFLICT DO NOTHING` - insertTelemetryDefSQL = `INSERT INTO telemetryDefs (id, name, component) - VALUES ($1, $2, $3) ON CONFLICT DO NOTHING` + insertTelemetryDefSQL = `INSERT INTO telemetryDefs (id, version, name, component) + VALUES ($1, $2, $3, $4) ON CONFLICT DO NOTHING` insertTelemetrySQL = `INSERT INTO telemetry (time, telemetryDefId, timeSclk, source, labels, key, valueType, integral, floating, boolval, string, bytes, ert) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) ON CONFLICT DO NOTHING` ) diff --git a/pkg/timescaledb/schema.sql b/pkg/timescaledb/schema.sql index e7c3e4a..b9f568c 100644 --- a/pkg/timescaledb/schema.sql +++ b/pkg/timescaledb/schema.sql @@ -1,11 +1,12 @@ CREATE TABLE IF NOT EXISTS eventDefs ( id SERIAL PRIMARY KEY, + version TEXT, component TEXT, name TEXT, severity BIGINT, formatString TEXT, args JSONB, - UNIQUE(component, name) + UNIQUE(version, component, name) ); CREATE TABLE IF NOT EXISTS events ( @@ -29,9 +30,10 @@ SELECT add_dimension('events', by_range('ert', INTERVAL '1 day'), if_not_exists CREATE TABLE IF NOT EXISTS telemetryDefs ( id SERIAL PRIMARY KEY, + version TEXT, name TEXT, component TEXT, - UNIQUE(name, component) + UNIQUE(version, name, component) ); DO $$ BEGIN From 89206c6a09d27d6f6c79744628ef0bbb489711fd Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:00:51 -0700 Subject: [PATCH 3/4] Push dict/fsw version into db --- lib/python/fsw_pb2.py | 52 ++++++++++++------------- lib/python/fsw_pb2.pyi | 6 ++- pkg/fprime/fsw.go | 6 ++- pkg/fprime/provider.go | 1 + pkg/fprime/telemetry.go | 8 ++-- pkg/host/fsw.go | 4 +- pkg/pb/dictionary.pb.go | 2 +- pkg/pb/fsw.pb.go | 18 +++++++-- pkg/pb/util.go | 12 +++--- pkg/rpc/provider.go | 1 + proto/pb/dictionary.proto | 2 +- proto/pb/fsw.proto | 4 +- src/modules/rpc/src/proto/hermes.json | 4 ++ src/modules/rpc/src/proto/hermes/Fsw.ts | 2 + src/modules/types/src/proto/index.d.ts | 6 +++ src/modules/types/src/proto/index.js | 23 +++++++++++ 16 files changed, 103 insertions(+), 48 deletions(-) diff --git a/lib/python/fsw_pb2.py b/lib/python/fsw_pb2.py index fd1adec..2e1aa64 100644 --- a/lib/python/fsw_pb2.py +++ b/lib/python/fsw_pb2.py @@ -26,7 +26,7 @@ import dictionary_pb2 as dictionary__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tfsw.proto\x12\x06hermes\x1a\ntype.proto\x1a\x10\x64ictionary.proto\"\x92\x01\n\x03\x46sw\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x12\n\nprofile_id\x18\x03 \x01(\t\x12\x10\n\x08\x66orwards\x18\x04 \x03(\t\x12+\n\x0c\x63\x61pabilities\x18\x07 \x03(\x0e\x32\x15.hermes.FswCapability\x12\x12\n\ndictionary\x18\x08 \x01(\tJ\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07\"!\n\x0e\x43ommandOptions\x12\x0f\n\x07no_wait\x18\x01 \x01(\x08\"\xdc\x01\n\x0c\x43ommandValue\x12\x1f\n\x03\x64\x65\x66\x18\x01 \x01(\x0b\x32\x12.hermes.CommandDef\x12\x1b\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\r.hermes.Value\x12\'\n\x07options\x18\x03 \x01(\x0b\x32\x16.hermes.CommandOptions\x12\x34\n\x08metadata\x18\x04 \x03(\x0b\x32\".hermes.CommandValue.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb5\x01\n\x0fRawCommandValue\x12\x0f\n\x07\x63ommand\x18\x02 \x01(\t\x12\'\n\x07options\x18\x03 \x01(\x0b\x32\x16.hermes.CommandOptions\x12\x37\n\x08metadata\x18\x04 \x03(\x0b\x32%.hermes.RawCommandValue.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xba\x01\n\x0f\x43ommandSequence\x12&\n\x08\x63ommands\x18\x01 \x03(\x0b\x32\x14.hermes.CommandValue\x12\x15\n\rlanguage_name\x18\x02 \x01(\t\x12\x37\n\x08metadata\x18\x03 \x03(\x0b\x32%.hermes.CommandSequence.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\x12RawCommandSequence\x12\x10\n\x08sequence\x18\x01 \x01(\t\x12\x15\n\rlanguage_name\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x03(\x0b\x32(.hermes.RawCommandSequence.MetadataEntry\x12\x1b\n\x13line_comment_prefix\x18\x04 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x0cRequestValue\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x1c\n\x0cRequestReply\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c*h\n\rFswCapability\x12\x0b\n\x07\x43OMMAND\x10\x00\x12\x11\n\rPARSE_COMMAND\x10\x01\x12\x0c\n\x08SEQUENCE\x10\x02\x12\x12\n\x0ePARSE_SEQUENCE\x10\x03\x12\x08\n\x04\x46ILE\x10\x04\x12\x0b\n\x07REQUEST\x10\x05\x42\x1fZ\x1dgithub.com/nasa/hermes/pkg/pbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tfsw.proto\x12\x06hermes\x1a\ntype.proto\x1a\x10\x64ictionary.proto\"\xa3\x01\n\x03\x46sw\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x12\n\nprofile_id\x18\x03 \x01(\t\x12\x10\n\x08\x66orwards\x18\x04 \x03(\t\x12+\n\x0c\x63\x61pabilities\x18\x07 \x03(\x0e\x32\x15.hermes.FswCapability\x12\x12\n\ndictionary\x18\x08 \x01(\t\x12\x0f\n\x07version\x18\t \x01(\tJ\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07\"!\n\x0e\x43ommandOptions\x12\x0f\n\x07no_wait\x18\x01 \x01(\x08\"\xdc\x01\n\x0c\x43ommandValue\x12\x1f\n\x03\x64\x65\x66\x18\x01 \x01(\x0b\x32\x12.hermes.CommandDef\x12\x1b\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\r.hermes.Value\x12\'\n\x07options\x18\x03 \x01(\x0b\x32\x16.hermes.CommandOptions\x12\x34\n\x08metadata\x18\x04 \x03(\x0b\x32\".hermes.CommandValue.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb5\x01\n\x0fRawCommandValue\x12\x0f\n\x07\x63ommand\x18\x02 \x01(\t\x12\'\n\x07options\x18\x03 \x01(\x0b\x32\x16.hermes.CommandOptions\x12\x37\n\x08metadata\x18\x04 \x03(\x0b\x32%.hermes.RawCommandValue.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xba\x01\n\x0f\x43ommandSequence\x12&\n\x08\x63ommands\x18\x01 \x03(\x0b\x32\x14.hermes.CommandValue\x12\x15\n\rlanguage_name\x18\x02 \x01(\t\x12\x37\n\x08metadata\x18\x03 \x03(\x0b\x32%.hermes.CommandSequence.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\x12RawCommandSequence\x12\x10\n\x08sequence\x18\x01 \x01(\t\x12\x15\n\rlanguage_name\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x03(\x0b\x32(.hermes.RawCommandSequence.MetadataEntry\x12\x1b\n\x13line_comment_prefix\x18\x04 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x0cRequestValue\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x1c\n\x0cRequestReply\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c*h\n\rFswCapability\x12\x0b\n\x07\x43OMMAND\x10\x00\x12\x11\n\rPARSE_COMMAND\x10\x01\x12\x0c\n\x08SEQUENCE\x10\x02\x12\x12\n\x0ePARSE_SEQUENCE\x10\x03\x12\x08\n\x04\x46ILE\x10\x04\x12\x0b\n\x07REQUEST\x10\x05\x42\x1fZ\x1dgithub.com/nasa/hermes/pkg/pbb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -42,30 +42,30 @@ _globals['_COMMANDSEQUENCE_METADATAENTRY']._serialized_options = b'8\001' _globals['_RAWCOMMANDSEQUENCE_METADATAENTRY']._loaded_options = None _globals['_RAWCOMMANDSEQUENCE_METADATAENTRY']._serialized_options = b'8\001' - _globals['_FSWCAPABILITY']._serialized_start=1107 - _globals['_FSWCAPABILITY']._serialized_end=1211 + _globals['_FSWCAPABILITY']._serialized_start=1124 + _globals['_FSWCAPABILITY']._serialized_end=1228 _globals['_FSW']._serialized_start=52 - _globals['_FSW']._serialized_end=198 - _globals['_COMMANDOPTIONS']._serialized_start=200 - _globals['_COMMANDOPTIONS']._serialized_end=233 - _globals['_COMMANDVALUE']._serialized_start=236 - _globals['_COMMANDVALUE']._serialized_end=456 - _globals['_COMMANDVALUE_METADATAENTRY']._serialized_start=409 - _globals['_COMMANDVALUE_METADATAENTRY']._serialized_end=456 - _globals['_RAWCOMMANDVALUE']._serialized_start=459 - _globals['_RAWCOMMANDVALUE']._serialized_end=640 - _globals['_RAWCOMMANDVALUE_METADATAENTRY']._serialized_start=409 - _globals['_RAWCOMMANDVALUE_METADATAENTRY']._serialized_end=456 - _globals['_COMMANDSEQUENCE']._serialized_start=643 - _globals['_COMMANDSEQUENCE']._serialized_end=829 - _globals['_COMMANDSEQUENCE_METADATAENTRY']._serialized_start=409 - _globals['_COMMANDSEQUENCE_METADATAENTRY']._serialized_end=456 - _globals['_RAWCOMMANDSEQUENCE']._serialized_start=832 - _globals['_RAWCOMMANDSEQUENCE']._serialized_end=1031 - _globals['_RAWCOMMANDSEQUENCE_METADATAENTRY']._serialized_start=409 - _globals['_RAWCOMMANDSEQUENCE_METADATAENTRY']._serialized_end=456 - _globals['_REQUESTVALUE']._serialized_start=1033 - _globals['_REQUESTVALUE']._serialized_end=1075 - _globals['_REQUESTREPLY']._serialized_start=1077 - _globals['_REQUESTREPLY']._serialized_end=1105 + _globals['_FSW']._serialized_end=215 + _globals['_COMMANDOPTIONS']._serialized_start=217 + _globals['_COMMANDOPTIONS']._serialized_end=250 + _globals['_COMMANDVALUE']._serialized_start=253 + _globals['_COMMANDVALUE']._serialized_end=473 + _globals['_COMMANDVALUE_METADATAENTRY']._serialized_start=426 + _globals['_COMMANDVALUE_METADATAENTRY']._serialized_end=473 + _globals['_RAWCOMMANDVALUE']._serialized_start=476 + _globals['_RAWCOMMANDVALUE']._serialized_end=657 + _globals['_RAWCOMMANDVALUE_METADATAENTRY']._serialized_start=426 + _globals['_RAWCOMMANDVALUE_METADATAENTRY']._serialized_end=473 + _globals['_COMMANDSEQUENCE']._serialized_start=660 + _globals['_COMMANDSEQUENCE']._serialized_end=846 + _globals['_COMMANDSEQUENCE_METADATAENTRY']._serialized_start=426 + _globals['_COMMANDSEQUENCE_METADATAENTRY']._serialized_end=473 + _globals['_RAWCOMMANDSEQUENCE']._serialized_start=849 + _globals['_RAWCOMMANDSEQUENCE']._serialized_end=1048 + _globals['_RAWCOMMANDSEQUENCE_METADATAENTRY']._serialized_start=426 + _globals['_RAWCOMMANDSEQUENCE_METADATAENTRY']._serialized_end=473 + _globals['_REQUESTVALUE']._serialized_start=1050 + _globals['_REQUESTVALUE']._serialized_end=1092 + _globals['_REQUESTREPLY']._serialized_start=1094 + _globals['_REQUESTREPLY']._serialized_end=1122 # @@protoc_insertion_point(module_scope) diff --git a/lib/python/fsw_pb2.pyi b/lib/python/fsw_pb2.pyi index 3131886..36354e1 100644 --- a/lib/python/fsw_pb2.pyi +++ b/lib/python/fsw_pb2.pyi @@ -25,20 +25,22 @@ FILE: FswCapability REQUEST: FswCapability class Fsw(_message.Message): - __slots__ = ("id", "type", "profile_id", "forwards", "capabilities", "dictionary") + __slots__ = ("id", "type", "profile_id", "forwards", "capabilities", "dictionary", "version") ID_FIELD_NUMBER: _ClassVar[int] TYPE_FIELD_NUMBER: _ClassVar[int] PROFILE_ID_FIELD_NUMBER: _ClassVar[int] FORWARDS_FIELD_NUMBER: _ClassVar[int] CAPABILITIES_FIELD_NUMBER: _ClassVar[int] DICTIONARY_FIELD_NUMBER: _ClassVar[int] + VERSION_FIELD_NUMBER: _ClassVar[int] id: str type: str profile_id: str forwards: _containers.RepeatedScalarFieldContainer[str] capabilities: _containers.RepeatedScalarFieldContainer[FswCapability] dictionary: str - def __init__(self, id: _Optional[str] = ..., type: _Optional[str] = ..., profile_id: _Optional[str] = ..., forwards: _Optional[_Iterable[str]] = ..., capabilities: _Optional[_Iterable[_Union[FswCapability, str]]] = ..., dictionary: _Optional[str] = ...) -> None: ... + version: str + def __init__(self, id: _Optional[str] = ..., type: _Optional[str] = ..., profile_id: _Optional[str] = ..., forwards: _Optional[_Iterable[str]] = ..., capabilities: _Optional[_Iterable[_Union[FswCapability, str]]] = ..., dictionary: _Optional[str] = ..., version: _Optional[str] = ...) -> None: ... class CommandOptions(_message.Message): __slots__ = ("no_wait",) diff --git a/pkg/fprime/fsw.go b/pkg/fprime/fsw.go index 6115f09..4829bc5 100644 --- a/pkg/fprime/fsw.go +++ b/pkg/fprime/fsw.go @@ -68,6 +68,7 @@ func NewFprimeFsw( logger log.Logger, name string, dictionaryId string, + dictionaryVersion string, dictionary *host.DictionaryNamespace, ) *Fsw { f := &Fsw{ @@ -75,6 +76,7 @@ func NewFprimeFsw( Id: name, Type: "fprime", Dictionary: dictionaryId, + Version: dictionaryVersion, }, Up: stream.NewPort[*Packet](), @@ -100,7 +102,7 @@ func (f *Fsw) downlinkLoop() { } case []*TelemValue: for _, tlmRaw := range data { - tlm, err := tlmRaw.ToTelemetry() + tlm, err := tlmRaw.ToTelemetry(f.Info().Dictionary, f.Info().Version) if err != nil { f.Logger.Error("failed to convert telemetry", "err", err) } else { @@ -111,7 +113,7 @@ func (f *Fsw) downlinkLoop() { } } case *LogValue: - evr, err := data.ToEvent() + evr, err := data.ToEvent(f.Info().Dictionary, f.Info().Version) if err != nil { f.Logger.Error("failed to convert event", "err", err) } else { diff --git a/pkg/fprime/provider.go b/pkg/fprime/provider.go index 7153535..c4220cd 100644 --- a/pkg/fprime/provider.go +++ b/pkg/fprime/provider.go @@ -70,6 +70,7 @@ func gdsProvider( session.Log(), fswName, dictId, + dict.Head.Version, primaryDict, ) diff --git a/pkg/fprime/telemetry.go b/pkg/fprime/telemetry.go index b6a33ae..88b2fe0 100644 --- a/pkg/fprime/telemetry.go +++ b/pkg/fprime/telemetry.go @@ -32,15 +32,15 @@ func timeToTimestamp(t *Time) *pb.Time { return out } -func (p *TelemValue) ToTelemetry() (*pb.Telemetry, error) { +func (p *TelemValue) ToTelemetry(dictId string, dictVersion string) (*pb.Telemetry, error) { return &pb.Telemetry{ - Ref: p.Def.ToRef(), + Ref: p.Def.ToRef(dictId, dictVersion), Time: timeToTimestamp(p.Time), Value: p.Value, }, nil } -func (p *LogValue) ToEvent() (*pb.Event, error) { +func (p *LogValue) ToEvent(dictId string, dictVersion string) (*pb.Event, error) { args := []*pb.Value{} argsAny := []any{} @@ -73,7 +73,7 @@ func (p *LogValue) ToEvent() (*pb.Event, error) { } return &pb.Event{ - Ref: p.Def.ToRef(), + Ref: p.Def.ToRef(dictId, dictVersion), Time: timeToTimestamp(p.Time), Message: fmt.Sprintf(fmtString, argsAny...), Args: args, diff --git a/pkg/host/fsw.go b/pkg/host/fsw.go index a0d897d..09c3dc5 100644 --- a/pkg/host/fsw.go +++ b/pkg/host/fsw.go @@ -27,8 +27,10 @@ type FswInfo struct { // connection capability Capabilities []pb.FswCapability - // (optional) Dictionary ID to use to command this FSW + // Dictionary ID to use to command this FSW Dictionary string `json:"dictionary,omitempty"` + // Dictionary version to use to command this FSW + Version string `json:"version,omitempty"` } func (f FswInfo) HasCapability(c pb.FswCapability) bool { diff --git a/pkg/pb/dictionary.pb.go b/pkg/pb/dictionary.pb.go index dd3db0b..40fb87f 100644 --- a/pkg/pb/dictionary.pb.go +++ b/pkg/pb/dictionary.pb.go @@ -917,7 +917,7 @@ type DictionaryHead struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Name given to dictionary, can be changed by the user Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // (optional) Dictionary/FSW release version + // Dictionary/FSW release version Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache diff --git a/pkg/pb/fsw.pb.go b/pkg/pb/fsw.pb.go index 0bc02ef..9f44c35 100644 --- a/pkg/pb/fsw.pb.go +++ b/pkg/pb/fsw.pb.go @@ -106,9 +106,11 @@ type Fsw struct { // The set of uplink capabilities this FSW connection implements // If other requests are routed to it, they will be rejected. Capabilities []FswCapability `protobuf:"varint,7,rep,packed,name=capabilities,proto3,enum=hermes.FswCapability" json:"capabilities,omitempty"` - // Optional ID of the dictionary to use when commanding this + // ID of the dictionary to use when commanding this // This will notify the frontend to swap to this dictionary. - Dictionary string `protobuf:"bytes,8,opt,name=dictionary,proto3" json:"dictionary,omitempty"` + Dictionary string `protobuf:"bytes,8,opt,name=dictionary,proto3" json:"dictionary,omitempty"` + // Version of the dictionary to use when commanding this + Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -185,6 +187,13 @@ func (x *Fsw) GetDictionary() string { return "" } +func (x *Fsw) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type CommandOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // * @@ -614,7 +623,7 @@ var File_fsw_proto protoreflect.FileDescriptor const file_fsw_proto_rawDesc = "" + "\n" + "\tfsw.proto\x12\x06hermes\x1a\n" + - "type.proto\x1a\x10dictionary.proto\"\xcb\x01\n" + + "type.proto\x1a\x10dictionary.proto\"\xe5\x01\n" + "\x03Fsw\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04type\x18\x02 \x01(\tR\x04type\x12\x1d\n" + @@ -624,7 +633,8 @@ const file_fsw_proto_rawDesc = "" + "\fcapabilities\x18\a \x03(\x0e2\x15.hermes.FswCapabilityR\fcapabilities\x12\x1e\n" + "\n" + "dictionary\x18\b \x01(\tR\n" + - "dictionaryJ\x04\b\x05\x10\x06J\x04\b\x06\x10\a\")\n" + + "dictionary\x12\x18\n" + + "\aversion\x18\t \x01(\tR\aversionJ\x04\b\x05\x10\x06J\x04\b\x06\x10\a\")\n" + "\x0eCommandOptions\x12\x17\n" + "\ano_wait\x18\x01 \x01(\bR\x06noWait\"\x86\x02\n" + "\fCommandValue\x12$\n" + diff --git a/pkg/pb/util.go b/pkg/pb/util.go index f0c7609..955881a 100644 --- a/pkg/pb/util.go +++ b/pkg/pb/util.go @@ -18,24 +18,24 @@ func (e *CommandDef) ArgNames() []string { return out } -func (e *EventDef) ToRef() *EventRef { +func (e *EventDef) ToRef(dictId string, dictVersion string) *EventRef { return &EventRef{ Id: e.GetId(), Component: e.GetComponent(), Name: e.GetName(), Severity: e.GetSeverity(), Arguments: e.ArgNames(), - Dictionary: "", // TODO(tumbar) Is there an easy way to fill this - Version: "", // TODO: One more thing to fill :) + Dictionary: dictId, + Version: dictVersion, } } -func (e *TelemetryDef) ToRef() *TelemetryRef { +func (e *TelemetryDef) ToRef(dictId string, dictVersion string) *TelemetryRef { return &TelemetryRef{ Id: e.GetId(), Component: e.GetComponent(), Name: e.GetName(), - Dictionary: "", // TODO(tumbar) Is there an easy way to fill this - Version: "", // TODO: One more thing to fill :) + Dictionary: dictId, + Version: dictVersion, } } diff --git a/pkg/rpc/provider.go b/pkg/rpc/provider.go index 50566f1..96a3db9 100644 --- a/pkg/rpc/provider.go +++ b/pkg/rpc/provider.go @@ -582,6 +582,7 @@ func (f *fswClient) Info() host.FswInfo { Forwards: f.info.GetForwards(), Capabilities: f.info.GetCapabilities(), Dictionary: f.info.Dictionary, + Version: f.info.Version, } } diff --git a/proto/pb/dictionary.proto b/proto/pb/dictionary.proto index 6bf7d64..94d1776 100644 --- a/proto/pb/dictionary.proto +++ b/proto/pb/dictionary.proto @@ -212,7 +212,7 @@ message DictionaryHead { // Name given to dictionary, can be changed by the user string name = 2; - // (optional) Dictionary/FSW release version + // Dictionary/FSW release version string version = 3; } diff --git a/proto/pb/fsw.proto b/proto/pb/fsw.proto index 2570446..8421681 100644 --- a/proto/pb/fsw.proto +++ b/proto/pb/fsw.proto @@ -52,9 +52,11 @@ message Fsw { // If other requests are routed to it, they will be rejected. repeated FswCapability capabilities = 7; - // Optional ID of the dictionary to use when commanding this + // ID of the dictionary to use when commanding this // This will notify the frontend to swap to this dictionary. string dictionary = 8; + // Version of the dictionary to use when commanding this + string version = 9; } message CommandOptions { diff --git a/src/modules/rpc/src/proto/hermes.json b/src/modules/rpc/src/proto/hermes.json index dbc4e24..89a4407 100644 --- a/src/modules/rpc/src/proto/hermes.json +++ b/src/modules/rpc/src/proto/hermes.json @@ -1079,6 +1079,10 @@ "dictionary": { "type": "string", "id": 8 + }, + "version": { + "type": "string", + "id": 9 } }, "reserved": [ diff --git a/src/modules/rpc/src/proto/hermes/Fsw.ts b/src/modules/rpc/src/proto/hermes/Fsw.ts index 5636481..1afd793 100644 --- a/src/modules/rpc/src/proto/hermes/Fsw.ts +++ b/src/modules/rpc/src/proto/hermes/Fsw.ts @@ -9,6 +9,7 @@ export interface Fsw { 'forwards'?: (string)[]; 'capabilities'?: (_hermes_FswCapability)[]; 'dictionary'?: (string); + 'version'?: (string); } export interface Fsw__Output { @@ -18,4 +19,5 @@ export interface Fsw__Output { 'forwards'?: (string)[]; 'capabilities'?: (_hermes_FswCapability__Output)[]; 'dictionary'?: (string); + 'version'?: (string); } diff --git a/src/modules/types/src/proto/index.d.ts b/src/modules/types/src/proto/index.d.ts index 975b525..8e0c009 100644 --- a/src/modules/types/src/proto/index.d.ts +++ b/src/modules/types/src/proto/index.d.ts @@ -5775,6 +5775,9 @@ export namespace hermes { /** Fsw dictionary */ dictionary?: (string|null); + + /** Fsw version */ + version?: (string|null); } /** Represents a Fsw. */ @@ -5804,6 +5807,9 @@ export namespace hermes { /** Fsw dictionary. */ public dictionary: string; + /** Fsw version. */ + public version: string; + /** * Creates a new Fsw instance using the specified properties. * @param [properties] Properties to set diff --git a/src/modules/types/src/proto/index.js b/src/modules/types/src/proto/index.js index c566336..93c70bc 100644 --- a/src/modules/types/src/proto/index.js +++ b/src/modules/types/src/proto/index.js @@ -15534,6 +15534,7 @@ $root.hermes = (function() { * @property {Array.|null} [forwards] Fsw forwards * @property {Array.|null} [capabilities] Fsw capabilities * @property {string|null} [dictionary] Fsw dictionary + * @property {string|null} [version] Fsw version */ /** @@ -15601,6 +15602,14 @@ $root.hermes = (function() { */ Fsw.prototype.dictionary = ""; + /** + * Fsw version. + * @member {string} version + * @memberof hermes.Fsw + * @instance + */ + Fsw.prototype.version = ""; + /** * Creates a new Fsw instance using the specified properties. * @function create @@ -15642,6 +15651,8 @@ $root.hermes = (function() { } if (message.dictionary != null && Object.hasOwnProperty.call(message, "dictionary")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.dictionary); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.version); return writer; }; @@ -15709,6 +15720,10 @@ $root.hermes = (function() { message.dictionary = reader.string(); break; } + case 9: { + message.version = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -15779,6 +15794,9 @@ $root.hermes = (function() { if (message.dictionary != null && message.hasOwnProperty("dictionary")) if (!$util.isString(message.dictionary)) return "dictionary: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; return null; }; @@ -15846,6 +15864,8 @@ $root.hermes = (function() { } if (object.dictionary != null) message.dictionary = String(object.dictionary); + if (object.version != null) + message.version = String(object.version); return message; }; @@ -15871,6 +15891,7 @@ $root.hermes = (function() { object.type = ""; object.profileId = ""; object.dictionary = ""; + object.version = ""; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -15890,6 +15911,8 @@ $root.hermes = (function() { } if (message.dictionary != null && message.hasOwnProperty("dictionary")) object.dictionary = message.dictionary; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; From 5d56ac1b54864dca3fc4cbb23876c0b3005daddc Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:22:55 -0700 Subject: [PATCH 4/4] Fix unit tests --- pkg/fprime/packet_test.go | 6 +++--- pkg/fprime/stream_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/fprime/packet_test.go b/pkg/fprime/packet_test.go index d161270..eb14f14 100644 --- a/pkg/fprime/packet_test.go +++ b/pkg/fprime/packet_test.go @@ -5,12 +5,12 @@ import ( "sync" "testing" - "github.com/stretchr/testify/assert" "github.com/nasa/hermes/pkg/fprime" "github.com/nasa/hermes/pkg/host" "github.com/nasa/hermes/pkg/pb" "github.com/nasa/hermes/pkg/serial" "github.com/nasa/hermes/pkg/spice" + "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -336,7 +336,7 @@ func TestTelemPacket(t *testing.T) { tlms := []*pb.Telemetry{} for _, v := range pkt.Payload.([]*fprime.TelemValue) { - tlm, err := v.ToTelemetry() + tlm, err := v.ToTelemetry("", "") assert.NoError(t, err) tlms = append(tlms, tlm) } @@ -356,7 +356,7 @@ func TestTelemPacket(t *testing.T) { }, Sclk: 684371162.929382, }, - Ref: test1Telem.ToRef(), + Ref: test1Telem.ToRef("", ""), }, }, tlms, diff --git a/pkg/fprime/stream_test.go b/pkg/fprime/stream_test.go index 3d56ad8..9bd7c5e 100644 --- a/pkg/fprime/stream_test.go +++ b/pkg/fprime/stream_test.go @@ -82,7 +82,7 @@ func TestFPrimeTCP(t *testing.T) { logger := log.GetLogger(t.Context()) - fsw := fprime.NewFprimeFsw(logger, "tcp", "", dictHost.Namespace("")) + fsw := fprime.NewFprimeFsw(logger, "tcp", "", "", dictHost.Namespace("")) wg := sync.WaitGroup{} fprime.ConnectPipeline(