From e480544fbd0093acb6839af1d2d8bad970c4080b Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 15 Sep 2023 14:09:46 +0200 Subject: [PATCH 1/2] Plugins specify a verion-range, slots just a version. Not the other way around as we have now. This also adheres closer to the way we handle front-end plugins. Ideally you'd maybe want both of them to be ranges, but that's for the future. part of CURA-11035 --- conanfile.py | 2 +- include/plugin/handshake.h | 4 ++-- include/plugin/metadata.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index fdaa7a7..84a73cc 100644 --- a/conanfile.py +++ b/conanfile.py @@ -63,7 +63,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires("curaengine_grpc_definitions/latest@ultimaker/cura_10446") + self.requires("curaengine_grpc_definitions/latest@ultimaker/cura_11035") # FIXME!: Can be set to .../testing after merge? self.requires("asio-grpc/2.6.0") self.requires("boost/1.82.0") self.requires("spdlog/1.11.0") diff --git a/include/plugin/handshake.h b/include/plugin/handshake.h index 615adcb..0dfb604 100644 --- a/include/plugin/handshake.h +++ b/include/plugin/handshake.h @@ -40,7 +40,7 @@ struct Handshake boost::asio::use_awaitable); spdlog::info("Received handshake request"); - spdlog::info("Slot ID: {}, slot version range: {}, plugin name: {}, plugin version: {}", static_cast(request.slot_id()), request.version_range(), request.plugin_name(), request.plugin_version()); + spdlog::info("Slot ID: {}, slot version: {}, plugin name: {}, plugin version: {}", static_cast(request.slot_id()), request.version(), request.plugin_name(), request.plugin_version()); const bool exists = Settings::validatePlugin(request, metadata); if (!exists) @@ -52,7 +52,7 @@ struct Handshake cura::plugins::slots::handshake::v0::CallResponse response; response.set_plugin_name(static_cast(metadata->plugin_name)); - response.set_slot_version(static_cast(metadata->slot_version)); + response.set_slot_version_range(static_cast(metadata->slot_version_range)); response.set_plugin_version(static_cast(metadata->plugin_version)); for (auto slot_id : broadcast_subscriptions) { diff --git a/include/plugin/metadata.h b/include/plugin/metadata.h index 7bb0144..2fe655a 100644 --- a/include/plugin/metadata.h +++ b/include/plugin/metadata.h @@ -13,7 +13,7 @@ namespace plugin struct Metadata { - std::string_view slot_version{ "0.1.0-alpha" }; + std::string_view slot_version_range{ ">=0.1.0" }; std::string_view plugin_name{ cmdline::NAME }; std::string_view plugin_version{ cmdline::VERSION }; }; From b7b30ca704ac41abdccd915a69b8eadcb7125845 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 20 Sep 2023 07:40:32 +0200 Subject: [PATCH 2/2] Use grpc definitions from testing CURA-11035 --- conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 84a73cc..09e69ef 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,5 +1,4 @@ import os -from pathlib import Path from conan import ConanFile from conan.errors import ConanInvalidConfiguration @@ -63,7 +62,7 @@ def layout(self): cmake_layout(self) def requirements(self): - self.requires("curaengine_grpc_definitions/latest@ultimaker/cura_11035") # FIXME!: Can be set to .../testing after merge? + self.requires("curaengine_grpc_definitions/latest@ultimaker/testing") self.requires("asio-grpc/2.6.0") self.requires("boost/1.82.0") self.requires("spdlog/1.11.0")