Skip to content

Commit

Permalink
Merge pull request #61 from harlem88/fwd/0.7
Browse files Browse the repository at this point in the history
Forward port changes from release-0.7
  • Loading branch information
rgallor authored Nov 11, 2024
2 parents 06a6c08 + ef7b4af commit df88049
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-code-generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
uses: actions/cache/restore@v4
with:
path: ./grpc/grpc_python_plugin
key: grpc-python-plugin-v1.58.1
key: grpc-python-plugin-v1.66.1
- name: Compile from source the grpc_python_plugin
if: steps.cache-grpc-python-plugin-restore.outputs.cache-hit != 'true'
run: |
git clone -b v1.58.1 https://github.com/grpc/grpc
git clone -b v1.66.1 https://github.com/grpc/grpc
cd grpc
git submodule update --init
cmake .
Expand Down
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.7.0] - 2024-09-02

### Added

- Dynamic introspection API.
- Add `grpc_socket_host` optional field to the `ConfigMessage` to configure the server IP to bind.
- Dynamic introspection API. [#46](https://github.com/astarte-platform/astarte-message-hub-proto/pull/46)
- Add `grpc_socket_host` optional field to the `ConfigMessage` to configure the server IP to bind. [#57]

### Changed

- Send Empty parameter instead of Node in the detach rpc.
- Send Empty parameter instead of Node in the Detach rpc. [#54](https://github.com/astarte-platform/astarte-message-hub-proto/pull/54)
- Make the `grpc_socket_port` field optional for the `ConfigMessage`, the default port will be
`50051` on the server.
- The Attach rpc now returns a `MessageHubEvent`, which can either be an error or an Astarte message.
`50051` on the server. [#57]
- The Attach rpc now returns a `MessageHubEvent`, which can either be an error or an Astarte message. [#56](https://github.com/astarte-platform/astarte-message-hub-proto/pull/56)
- The information about the Node sent in an Attach rpc now contains only the node introspection, since
the Node ID is sent inside the rpc metadata. [#58](https://github.com/astarte-platform/astarte-message-hub-proto/pull/58)

[#57]: https://github.com/astarte-platform/astarte-message-hub-proto/pull/57

## [0.6.2] - 2024-04-23

Expand Down
19 changes: 15 additions & 4 deletions python/astarteplatform/msghub/config_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, channel):
'/astarteplatform.msghub.MessageHubConfig/SetConfig',
request_serializer=astarteplatform_dot_msghub_dot_config__pb2.ConfigMessage.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
_registered_method=True)


class MessageHubConfigServicer(object):
Expand All @@ -44,6 +44,7 @@ def add_MessageHubConfigServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'astarteplatform.msghub.MessageHubConfig', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('astarteplatform.msghub.MessageHubConfig', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand All @@ -61,8 +62,18 @@ def SetConfig(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/astarteplatform.msghub.MessageHubConfig/SetConfig',
return grpc.experimental.unary_unary(
request,
target,
'/astarteplatform.msghub.MessageHubConfig/SetConfig',
astarteplatform_dot_msghub_dot_config__pb2.ConfigMessage.SerializeToString,
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
91 changes: 71 additions & 20 deletions python/astarteplatform/msghub/message_hub_service_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ def __init__(self, channel):
'/astarteplatform.msghub.MessageHub/Attach',
request_serializer=astarteplatform_dot_msghub_dot_node__pb2.Node.SerializeToString,
response_deserializer=astarteplatform_dot_msghub_dot_astarte__message__pb2.MessageHubEvent.FromString,
)
_registered_method=True)
self.Send = channel.unary_unary(
'/astarteplatform.msghub.MessageHub/Send',
request_serializer=astarteplatform_dot_msghub_dot_astarte__message__pb2.AstarteMessage.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
_registered_method=True)
self.Detach = channel.unary_unary(
'/astarteplatform.msghub.MessageHub/Detach',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
_registered_method=True)
self.AddInterfaces = channel.unary_unary(
'/astarteplatform.msghub.MessageHub/AddInterfaces',
request_serializer=astarteplatform_dot_msghub_dot_interface__pb2.InterfacesJson.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
_registered_method=True)
self.RemoveInterfaces = channel.unary_unary(
'/astarteplatform.msghub.MessageHub/RemoveInterfaces',
request_serializer=astarteplatform_dot_msghub_dot_interface__pb2.InterfacesName.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
_registered_method=True)


class MessageHubServicer(object):
Expand Down Expand Up @@ -115,6 +115,7 @@ def add_MessageHubServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'astarteplatform.msghub.MessageHub', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('astarteplatform.msghub.MessageHub', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand All @@ -132,11 +133,21 @@ def Attach(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/astarteplatform.msghub.MessageHub/Attach',
return grpc.experimental.unary_stream(
request,
target,
'/astarteplatform.msghub.MessageHub/Attach',
astarteplatform_dot_msghub_dot_node__pb2.Node.SerializeToString,
astarteplatform_dot_msghub_dot_astarte__message__pb2.MessageHubEvent.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def Send(request,
Expand All @@ -149,11 +160,21 @@ def Send(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/astarteplatform.msghub.MessageHub/Send',
return grpc.experimental.unary_unary(
request,
target,
'/astarteplatform.msghub.MessageHub/Send',
astarteplatform_dot_msghub_dot_astarte__message__pb2.AstarteMessage.SerializeToString,
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def Detach(request,
Expand All @@ -166,11 +187,21 @@ def Detach(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/astarteplatform.msghub.MessageHub/Detach',
return grpc.experimental.unary_unary(
request,
target,
'/astarteplatform.msghub.MessageHub/Detach',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def AddInterfaces(request,
Expand All @@ -183,11 +214,21 @@ def AddInterfaces(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/astarteplatform.msghub.MessageHub/AddInterfaces',
return grpc.experimental.unary_unary(
request,
target,
'/astarteplatform.msghub.MessageHub/AddInterfaces',
astarteplatform_dot_msghub_dot_interface__pb2.InterfacesJson.SerializeToString,
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def RemoveInterfaces(request,
Expand All @@ -200,8 +241,18 @@ def RemoveInterfaces(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/astarteplatform.msghub.MessageHub/RemoveInterfaces',
return grpc.experimental.unary_unary(
request,
target,
'/astarteplatform.msghub.MessageHub/RemoveInterfaces',
astarteplatform_dot_msghub_dot_interface__pb2.InterfacesName.SerializeToString,
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "astarte_message_hub_proto"
description="Astarte message hub protocol buffers for Python"
version = "0.6.2"
version = "0.7.0"
authors = [
{ name = "Simone Orru", email = "[email protected]" }
]
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.lock

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

2 changes: 1 addition & 1 deletion rust/astarte-message-hub-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[package]
name = "astarte-message-hub-proto"
version = "0.6.2"
version = "0.7.0"
documentation = "https://docs.rs/astarte-message-hub-proto"
edition = { workspace = true }
homepage = "https://astarte.cloud/"
Expand Down
2 changes: 1 addition & 1 deletion scripts/python_codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ codegen () {

if [ ! -d "$DL_DIR/grpc" ]; then
cd "$DL_DIR"
git clone -b v1.58.1 https://github.com/grpc/grpc
git clone -b v1.66.1 https://github.com/grpc/grpc
cd grpc
git submodule update --init
fi
Expand Down

0 comments on commit df88049

Please sign in to comment.