-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add meta proto service for service discovery #543
base: main
Are you sure you want to change the base?
Conversation
Dependency ReviewThe following issues were found:
License Issuesosal/threadx/CMakeLists.txt
OpenSSF Scorecard
Scanned Manifest Filesosal/threadx/CMakeLists.txt |
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
✅ ACTION | actionlint | 12 | 0 | 0.07s | |
✅ CPP | clang-format | 970 | 7 | 0 | 7.48s |
✅ DOCKERFILE | hadolint | 2 | 0 | 0.11s | |
✅ JSON | jsonlint | 9 | 0 | 0.19s | |
✅ JSON | prettier | 9 | 0 | 0 | 0.92s |
markdownlint | 6 | 0 | 4 | 1.61s | |
markdown-link-check | 6 | 2 | 59.19s | ||
✅ MARKDOWN | markdown-table-formatter | 6 | 0 | 0 | 0.38s |
✅ REPOSITORY | checkov | yes | no | 22.23s | |
✅ REPOSITORY | git_diff | yes | no | 0.05s | |
✅ REPOSITORY | grype | yes | no | 18.21s | |
✅ REPOSITORY | secretlint | yes | no | 8.28s | |
✅ REPOSITORY | trivy | yes | no | 11.86s | |
✅ REPOSITORY | trivy-sbom | yes | no | 0.73s | |
✅ REPOSITORY | trufflehog | yes | no | 3.05s | |
lychee | 139 | 6 | 2.87s | ||
prettier | 22 | 0 | 1 | 1.36s | |
✅ YAML | v8r | 22 | 0 | 12.38s | |
✅ YAML | yamllint | 22 | 0 | 0.47s |
See detailed report in MegaLinter reports
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
return service_discovery::ServiceDiscovery::AcceptsService(serviceId) | ||
|| IsProxyServiceSupported(serviceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
return service_discovery::ServiceDiscovery::AcceptsService(serviceId) | |
|| IsProxyServiceSupported(serviceId); | |
return service_discovery::ServiceDiscovery::AcceptsService(serviceId) || IsProxyServiceSupported(serviceId); |
virtual ~ServiceDiscoveryEcho() = default; | ||
|
||
void FindFirstServiceInRange(uint32_t startServiceId, uint32_t endServiceId) override; | ||
void NotifyServiceChanges(bool value) override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
void NotifyServiceChanges(bool value) override | |
void NotifyServiceChanges(bool value) override |
{} | ||
|
||
bool AcceptsService(uint32_t id) const override; | ||
//infra::SharedPtr<services::MethodDeserializer> StartMethod(uint32_t serviceId, uint32_t methodId, uint32_t size, const services::EchoErrorPolicy& errorPolicy) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
//infra::SharedPtr<services::MethodDeserializer> StartMethod(uint32_t serviceId, uint32_t methodId, uint32_t size, const services::EchoErrorPolicy& errorPolicy) override; | |
// infra::SharedPtr<services::MethodDeserializer> StartMethod(uint32_t serviceId, uint32_t methodId, uint32_t size, const services::EchoErrorPolicy& errorPolicy) override; |
} | ||
|
||
protected: | ||
bool IsProxyServiceSupported(uint32_t& serviceId) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
bool IsProxyServiceSupported(uint32_t& serviceId) const; | |
bool IsProxyServiceSupported(uint32_t& serviceId) const; |
auto startMethodArgs = std::tie(serviceId, methodId, size, errorPolicy); | ||
NotifyObservers([&methodSerializer, &startMethodArgs](auto& obs) | ||
{ | ||
if(obs.AcceptsService(std::get<0>(startMethodArgs))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
if(obs.AcceptsService(std::get<0>(startMethodArgs))) | |
if (obs.AcceptsService(std::get<0>(startMethodArgs))) |
void ServiceDiscoveryEcho::UnregisterObserver(infra::Observer<Service, Echo>* observer) | ||
{ | ||
services::Echo::UnregisterObserver(observer); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
|
||
virtual ~ServiceDiscoveryEcho() = default; | ||
|
||
//Implementation of services::ServiceDiscovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
//Implementation of services::ServiceDiscovery | |
// Implementation of services::ServiceDiscovery |
void FindFirstServiceInRange(uint32_t startServiceId, uint32_t endServiceId) override; | ||
void NotifyServiceChanges(bool value) override; | ||
|
||
//Implementation of services::Service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
//Implementation of services::Service | |
// Implementation of services::Service |
bool AcceptsService(uint32_t id) const override; | ||
infra::SharedPtr<services::MethodDeserializer> StartMethod(uint32_t serviceId, uint32_t methodId, uint32_t size, const services::EchoErrorPolicy& errorPolicy) override; | ||
|
||
//Implementation of services::Echo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
//Implementation of services::Echo | |
// Implementation of services::Echo |
{ | ||
proxy.FindFirstServiceInRange(startServiceId, endServiceId); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | |
proxy.FindFirstServiceInRange(startServiceId, endServiceId); | |
}); | |
{ | |
proxy.FindFirstServiceInRange(startServiceId, endServiceId); | |
}); |
{ | ||
proxy.NotifyServiceChanges(allow); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | |
proxy.NotifyServiceChanges(allow); | |
}); | |
{ | |
proxy.NotifyServiceChanges(allow); | |
}); |
} | ||
}; | ||
|
||
TEST_F(ServiceDiscoveryTest, return_no_service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
TEST_F(ServiceDiscoveryTest, return_no_service) | |
TEST_F(ServiceDiscoveryTest, return_no_service) |
TEST_F(ServiceDiscoveryTest, notify_service_change) | ||
{ | ||
NotifyServiceChanges(true); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
services::ServiceStub service1_{ serviceDiscoveryEcho, 1 }; | ||
services::ServiceStubProxy service1Proxy{ echo, 1 }; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "gmock/gmock.h" | ||
#include "gtest/gtest.h" | ||
#include <cstdint> | ||
#include <limits> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "gmock/gmock.h" | |
#include "gtest/gtest.h" | |
#include <cstdint> | |
#include <limits> |
#include "protobuf/echo/test_doubles/EchoSingleLoopback.hpp" | ||
#include "protobuf/echo/test_doubles/ServiceStub.hpp" | ||
#include "protobuf/meta_services/ServiceDiscoveryEcho.hpp" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "gmock/gmock.h" | |
#include "gtest/gtest.h" | |
#include <cstdint> | |
#include <limits> | |
FindFirstServiceInRangeMock(startServiceId, endServiceId); | ||
MethodDone(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
}; | ||
} | ||
|
||
namespace application { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
namespace application { | |
namespace application | |
{ |
PeerServiceDiscovererEcho(services::Echo& echo) | ||
: service_discovery::ServiceDiscoveryProxy(echo) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | ||
FindFirstServiceInRange(0, std::numeric_limits<uint32_t>::max()); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | |
FindFirstServiceInRange(0, std::numeric_limits<uint32_t>::max()); | |
}); | |
{ | |
FindFirstServiceInRange(0, std::numeric_limits<uint32_t>::max()); | |
}); |
public: | ||
services::MethodSerializerFactory::ForServices<service_discovery::ServiceDiscovery, service_discovery::ServiceDiscoveryResponse>::AndProxies<service_discovery::ServiceDiscoveryProxy, service_discovery::ServiceDiscoveryResponseProxy> serializerFactory; | ||
application::EchoSingleLoopback echo{ serializerFactory }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
service_discovery::ServiceDiscoveryResponseProxy serviceDiscoveryResponse{ echo }; | ||
testing::StrictMock<ServiceDiscoveryMock> serviceDiscovery{ echo }; | ||
|
||
infra::Execute turnOnNotifyServiceChanges{[this] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
infra::Execute turnOnNotifyServiceChanges{[this] | |
infra::Execute turnOnNotifyServiceChanges{ [this] |
}}; | ||
application::PeerServiceDiscovererEcho discoverer{echo}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
}}; | |
application::PeerServiceDiscovererEcho discoverer{echo}; | |
} }; | |
application::PeerServiceDiscovererEcho discoverer{ echo }; |
// TEST_F(PeerServiceDiscovererTest, ) | ||
// { | ||
// } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "gmock/gmock.h" | ||
#include "gtest/gtest.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "gmock/gmock.h" | |
#include "gtest/gtest.h" |
#include "gtest/gtest.h" | ||
#include "protobuf/echo/Echo.hpp" | ||
#include "protobuf/echo/test_doubles/EchoSingleLoopback.hpp" | ||
#include <array> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include <array> | |
#include "gmock/gmock.h" | |
#include "gtest/gtest.h" | |
#include <array> |
application::PeerServiceDiscovererEcho discoverer{echo}; | ||
testing::StrictMock<PeerServiceDiscoveryObserverMock> observer{discoverer}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
application::PeerServiceDiscovererEcho discoverer{echo}; | |
testing::StrictMock<PeerServiceDiscoveryObserverMock> observer{discoverer}; | |
application::PeerServiceDiscovererEcho discoverer{ echo }; | |
testing::StrictMock<PeerServiceDiscoveryObserverMock> observer{ discoverer }; |
for ( auto service : services ) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
for ( auto service : services ) | |
{ | |
for (auto service : services) | |
{ |
Quality Gate passedIssues Measures |
void ServicesChanged() override | ||
{ | ||
Initialize(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | ||
serviceDiscoveryResponse.ServicesChanged(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | |
serviceDiscoveryResponse.ServicesChanged(); | |
}); | |
{ | |
serviceDiscoveryResponse.ServicesChanged(); | |
}); |
@@ -0,0 +1,70 @@ | |||
#include "infra/event/EventDispatcher.hpp" | |||
#include "infra/util/Function.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "infra/util/Function.hpp" | |
#include "protobuf/meta_services/PeerServiceDiscoverer.hpp" | |
#include "infra/util/Function.hpp" |
|
||
#include <limits> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include <limits> |
{ | ||
observer.ServiceDiscoveryComplete(services.range()); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | ||
FindFirstServiceInRange(services.back(), std::numeric_limits<uint32_t>::max()); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
void PeerServiceDiscovererEcho::ServicesChanged() | ||
{ | ||
Initialize(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | ||
if(obs.AcceptsService(std::get<0>(startMethodArgs))) | ||
{ | ||
methodSerializer = obs.StartMethod(std::get<0>(startMethodArgs), std::get<1>(startMethodArgs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
methodSerializer = obs.StartMethod(std::get<0>(startMethodArgs), std::get<1>(startMethodArgs), | |
methodSerializer = obs.StartMethod(std::get<0>(startMethodArgs), std::get<1>(startMethodArgs), |
#include "infra/util/MemoryRange.hpp" | ||
#include "infra/util/Observer.hpp" | ||
#include "infra/util/test_helper/MemoryRangeMatcher.hpp" | ||
#include "gmock/gmock.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "gmock/gmock.h" | |
#include "protobuf/echo/test_doubles/EchoSingleLoopback.hpp" | |
#include "protobuf/meta_services/PeerServiceDiscoverer.hpp" | |
#include "gmock/gmock.h" |
#include "protobuf/meta_services/PeerServiceDiscoverer.hpp" | ||
#include "protobuf/echo/test_doubles/EchoSingleLoopback.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
#include "protobuf/meta_services/PeerServiceDiscoverer.hpp" | |
#include "protobuf/echo/test_doubles/EchoSingleLoopback.hpp" |
services::MethodSerializerFactory::ForServices<service_discovery::ServiceDiscovery, | ||
service_discovery::ServiceDiscoveryResponse>::AndProxies<service_discovery::ServiceDiscoveryProxy, | ||
service_discovery::ServiceDiscoveryResponseProxy> serializerFactory; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
services::MethodSerializerFactory::ForServices<service_discovery::ServiceDiscovery, | |
service_discovery::ServiceDiscoveryResponse>::AndProxies<service_discovery::ServiceDiscoveryProxy, | |
service_discovery::ServiceDiscoveryResponseProxy> serializerFactory; | |
services::MethodSerializerFactory::ForServices<service_discovery::ServiceDiscovery, | |
service_discovery::ServiceDiscoveryResponse>::AndProxies<service_discovery::ServiceDiscoveryProxy, | |
service_discovery::ServiceDiscoveryResponseProxy> | |
serializerFactory; | |
void QueryServices(infra::MemoryRange<uint32_t> services) | ||
{ | ||
for (auto service : services) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MegaLinter] reported by reviewdog 🐶
{ | |
{ |
Quality Gate passedIssues Measures |
No description provided.