From 9589ea8ced5ece716a06e52fdca4f8240e1dc8f6 Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Thu, 1 Aug 2024 17:57:15 +0200 Subject: [PATCH] Add missing OFT tags --- .github/workflows/check.yaml | 6 ++++++ .github/workflows/test-featurematrix.yaml | 1 + src/communication/default_notifier.rs | 6 +++++- src/communication/default_pubsub.rs | 6 +++++- src/communication/in_memory_rpc_client.rs | 4 ++++ src/communication/in_memory_rpc_server.rs | 4 ++++ src/communication/notification.rs | 2 ++ src/communication/pubsub.rs | 4 ++++ src/communication/rpc.rs | 4 ++++ src/utransport.rs | 1 + 10 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 21c719e..5dd076d 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -60,6 +60,7 @@ jobs: run: | cargo deny check + # [impl->req~up-language-ci-build~1] check: runs-on: ubuntu-latest steps: @@ -73,6 +74,7 @@ jobs: run: | cargo check --all --tests + # [impl->req~up-language-ci-linter~1] fmt: runs-on: ubuntu-latest steps: @@ -87,6 +89,7 @@ jobs: run: | cargo fmt --all -- --check + # [impl->req~up-language-ci-linter~1] clippy: runs-on: ubuntu-latest steps: @@ -102,6 +105,7 @@ jobs: cargo clippy --version cargo clippy --tests --examples + # [impl->req~up-language-ci-api-docs~1] docu: runs-on: ubuntu-latest env: @@ -134,6 +138,7 @@ jobs: run: | cargo hack check --feature-powerset --no-dev-deps + # [impl->req~up-language-ci-test~1] nextest: # Subset of feature-combos, on only one OS - more complete testing in test-featurematrix.yaml outputs: @@ -166,6 +171,7 @@ jobs: name: test-results path: testresults--all-features.json + # [impl->req~up-language-ci-test~1] doctest: # Run doctests separately, as nextest doesn't yet (https://github.com/nextest-rs/nextest/issues/16) outputs: diff --git a/.github/workflows/test-featurematrix.yaml b/.github/workflows/test-featurematrix.yaml index ffa7c40..2c0db4b 100644 --- a/.github/workflows/test-featurematrix.yaml +++ b/.github/workflows/test-featurematrix.yaml @@ -25,6 +25,7 @@ env: CARGO_TERM_COLOR: always jobs: + # [impl->req~up-language-ci-test~1] test-all-features: name: all feature combinations runs-on: ${{ matrix.os }} diff --git a/src/communication/default_notifier.rs b/src/communication/default_notifier.rs index e573476..efbe76b 100644 --- a/src/communication/default_notifier.rs +++ b/src/communication/default_notifier.rs @@ -11,6 +11,8 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +// [impl->req~up-language-comm-api-default-impl~1] + use std::sync::Arc; use async_trait::async_trait; @@ -96,7 +98,9 @@ impl Notifier for SimpleNotifier { } #[cfg(test)] -mod test { +mod tests { + + // [utest->req~up-language-comm-api-default-impl~1] use super::*; diff --git a/src/communication/default_pubsub.rs b/src/communication/default_pubsub.rs index 2d6db9d..a0cecc7 100644 --- a/src/communication/default_pubsub.rs +++ b/src/communication/default_pubsub.rs @@ -11,6 +11,8 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +// [impl->req~up-language-comm-api-default-impl~1] + use std::{ collections::{hash_map::Entry, HashMap}, ops::Deref, @@ -452,7 +454,9 @@ impl Subscriber for InMemorySubscriber { } #[cfg(test)] -mod test { +mod tests { + + // [utest->req~up-language-comm-api-default-impl~1] use super::*; diff --git a/src/communication/in_memory_rpc_client.rs b/src/communication/in_memory_rpc_client.rs index 9dc993a..e8c8e96 100644 --- a/src/communication/in_memory_rpc_client.rs +++ b/src/communication/in_memory_rpc_client.rs @@ -11,6 +11,8 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +// [impl->req~up-language-comm-api-default-impl~1] + use std::collections::hash_map::Entry; use std::collections::HashMap; use std::sync::{Arc, Mutex}; @@ -289,6 +291,8 @@ impl RpcClient for InMemoryRpcClient { #[cfg(test)] mod tests { + // [utest->req~up-language-comm-api-default-impl~1] + use super::*; use protobuf::{well_known_types::wrappers::StringValue, Enum}; diff --git a/src/communication/in_memory_rpc_server.rs b/src/communication/in_memory_rpc_server.rs index e5129ab..1e23943 100644 --- a/src/communication/in_memory_rpc_server.rs +++ b/src/communication/in_memory_rpc_server.rs @@ -11,6 +11,8 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +// [impl->req~up-language-comm-api-default-impl~1] + use std::collections::hash_map::Entry; use std::collections::HashMap; use std::sync::Arc; @@ -280,6 +282,8 @@ impl RpcServer for InMemoryRpcServer { #[cfg(test)] mod tests { + // [utest->req~up-language-comm-api-default-impl~1] + use super::*; use protobuf::well_known_types::wrappers::StringValue; diff --git a/src/communication/notification.rs b/src/communication/notification.rs index 707901b..b7ae871 100644 --- a/src/communication/notification.rs +++ b/src/communication/notification.rs @@ -23,6 +23,7 @@ use crate::{UListener, UStatus, UUri}; use super::{CallOptions, UPayload}; /// An error indicating a problem with sending a notification to another uEntity. +// [impl->req~up-language-comm-api~1] #[derive(Debug)] pub enum NotificationError { /// Indicates that the given message cannot be sent because it is not a [valid Notification message](crate::NotificationValidator). @@ -48,6 +49,7 @@ impl Error for NotificationError {} /// /// Please refer to the /// [Communication Layer API Specifications](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/api.adoc). +// [impl->req~up-language-comm-api~1] #[cfg_attr(test, automock)] #[async_trait] pub trait Notifier: Send + Sync { diff --git a/src/communication/pubsub.rs b/src/communication/pubsub.rs index 660bc43..c9a90fd 100644 --- a/src/communication/pubsub.rs +++ b/src/communication/pubsub.rs @@ -24,6 +24,7 @@ use crate::{UListener, UStatus, UUri}; use super::{CallOptions, UPayload}; /// An error indicating a problem with publishing a message to a topic. +// [impl->req~up-language-comm-api~1] #[derive(Debug)] pub enum PubSubError { /// Indicates that the given message cannot be sent because it is not a [valid Publish message](crate::PublishValidator). @@ -49,6 +50,7 @@ impl Error for PubSubError {} /// /// Please refer to the /// [Communication Layer API Specifications](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/api.adoc). +// [impl->req~up-language-comm-api~1] #[async_trait] pub trait Publisher: Send + Sync { /// Publishes a message to a topic. @@ -70,6 +72,7 @@ pub trait Publisher: Send + Sync { ) -> Result<(), PubSubError>; } +// [impl->req~up-language-comm-api~1] #[cfg_attr(test, automock)] pub trait SubscriptionChangeHandler: Send + Sync { /// Invoked for each update to the subscription status for a given topic. @@ -87,6 +90,7 @@ pub trait SubscriptionChangeHandler: Send + Sync { /// /// Please refer to the /// [Communication Layer API Specifications](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/api.adoc). +// [impl->req~up-language-comm-api~1] #[async_trait] pub trait Subscriber: Send + Sync { /// Registers a handler to invoke for messages that have been published to a given topic. diff --git a/src/communication/rpc.rs b/src/communication/rpc.rs index 0358ac1..79c8706 100644 --- a/src/communication/rpc.rs +++ b/src/communication/rpc.rs @@ -25,6 +25,7 @@ use crate::{UCode, UStatus, UUri}; use super::{CallOptions, UPayload}; /// An error indicating a problem with invoking a (remote) service operation. +// [impl->req~up-language-comm-api~1] #[derive(Clone, Error, Debug)] pub enum ServiceInvocationError { /// Indicates that the calling uE requested to add/create something that already exists. @@ -137,6 +138,7 @@ impl From for UStatus { /// Please refer to the /// [Communication Layer API specification](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/api.adoc) /// for details. +// [impl->req~up-language-comm-api~1] #[cfg_attr(test, automock)] #[async_trait] pub trait RpcClient: Send + Sync { @@ -210,6 +212,7 @@ impl dyn RpcClient { /// A handler for processing incoming RPC requests. /// +// [impl->req~up-language-comm-api~1] #[cfg_attr(test, automock)] #[async_trait] pub trait RequestHandler: Send + Sync { @@ -243,6 +246,7 @@ pub trait RequestHandler: Send + Sync { /// Please refer to the /// [Communication Layer API specification](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/api.adoc) /// for details. +// [impl->req~up-language-comm-api~1] #[async_trait] pub trait RpcServer { /// Registers an endpoint for RPC requests. diff --git a/src/utransport.rs b/src/utransport.rs index 5a22a53..1b2619d 100644 --- a/src/utransport.rs +++ b/src/utransport.rs @@ -43,6 +43,7 @@ pub trait LocalUriProvider: Send + Sync { /// /// Please refer to the [uProtocol Transport Layer specification](https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.3/up-l1/README.adoc) /// for details. +// [impl->req~up-language-transport-api~1] #[cfg_attr(test, automock)] #[async_trait] pub trait UListener: Send + Sync {