From 46fc48d3d547e02d87513d830b6afed5cf291263 Mon Sep 17 00:00:00 2001 From: swethasukumarr Date: Tue, 2 Jun 2026 15:14:06 -0400 Subject: [PATCH 1/2] fix(actions): apply clang-format to resolve CI formatting violations --- include/firebolt/actions.h | 13 ++++++++----- src/actions_impl.cpp | 22 ++++++++++++++-------- src/actions_impl.h | 6 ++++-- src/json_types/actions.h | 12 +++++++----- test/component/actionsGeneratedTest.cpp | 1 - test/unit/actionsGeneratedTest.cpp | 12 ++++-------- 6 files changed, 37 insertions(+), 29 deletions(-) diff --git a/include/firebolt/actions.h b/include/firebolt/actions.h index f76efbd..660abd6 100644 --- a/include/firebolt/actions.h +++ b/include/firebolt/actions.h @@ -22,31 +22,34 @@ #ifndef FIREBOLT_ACTIONS_H #define FIREBOLT_ACTIONS_H +#include #include #include #include #include #include #include -#include -namespace Firebolt::Actions { +namespace Firebolt::Actions +{ -class IActions { +class IActions +{ public: virtual ~IActions() = default; virtual Result intent() const = 0; virtual Result subscribeOnIntent(std::function&& notification) = 0; - virtual Result subscribeOnIntentChanged(std::function&& notification) { + virtual Result subscribeOnIntentChanged(std::function&& notification) + { return subscribeOnIntent(std::move(notification)); } virtual Result unsubscribe(SubscriptionId id) = 0; virtual void unsubscribeAll() = 0; -}; // class IActions +}; // class IActions } // namespace Firebolt::Actions diff --git a/src/actions_impl.cpp b/src/actions_impl.cpp index ced5bef..61597de 100644 --- a/src/actions_impl.cpp +++ b/src/actions_impl.cpp @@ -24,26 +24,32 @@ #include #include -namespace Firebolt::Actions { +namespace Firebolt::Actions +{ ActionsImpl::ActionsImpl(Firebolt::Helpers::IHelper& helper) - : helper_(helper) - , subscriptionManager_(helper, this) -{} + : helper_(helper), + subscriptionManager_(helper, this) +{ +} -Result ActionsImpl::intent() const { +Result ActionsImpl::intent() const +{ return helper_.get("Actions.intent"); } -Result ActionsImpl::subscribeOnIntent(std::function&& notification) { +Result ActionsImpl::subscribeOnIntent(std::function&& notification) +{ return subscriptionManager_.subscribe("Actions.onIntent", std::move(notification)); } -Result ActionsImpl::unsubscribe(SubscriptionId id) { +Result ActionsImpl::unsubscribe(SubscriptionId id) +{ return subscriptionManager_.unsubscribe(id); } -void ActionsImpl::unsubscribeAll() { +void ActionsImpl::unsubscribeAll() +{ subscriptionManager_.unsubscribeAll(); } diff --git a/src/actions_impl.h b/src/actions_impl.h index 229b60d..4c8d6ba 100644 --- a/src/actions_impl.h +++ b/src/actions_impl.h @@ -25,9 +25,11 @@ #include "firebolt/actions.h" #include -namespace Firebolt::Actions { +namespace Firebolt::Actions +{ -class ActionsImpl : public IActions { +class ActionsImpl : public IActions +{ public: explicit ActionsImpl(Firebolt::Helpers::IHelper& helper); ActionsImpl(const ActionsImpl&) = delete; diff --git a/src/json_types/actions.h b/src/json_types/actions.h index 6025350..60c76ce 100644 --- a/src/json_types/actions.h +++ b/src/json_types/actions.h @@ -23,14 +23,16 @@ #define FIREBOLT_ACTIONS_JSON_H #pragma once -#include -#include -#include #include "firebolt/actions.h" +#include +#include +#include -namespace Firebolt::Actions { +namespace Firebolt::Actions +{ -namespace JsonData { +namespace JsonData +{ } // namespace JsonData diff --git a/test/component/actionsGeneratedTest.cpp b/test/component/actionsGeneratedTest.cpp index e14323e..38a5356 100644 --- a/test/component/actionsGeneratedTest.cpp +++ b/test/component/actionsGeneratedTest.cpp @@ -61,4 +61,3 @@ TEST_F(ActionsGeneratedCTest, SubscribeOnIntent) auto result = Firebolt::IFireboltAccessor::Instance().ActionsInterface().unsubscribe(id.value()); verifyUnsubscribeResult(result); } - diff --git a/test/unit/actionsGeneratedTest.cpp b/test/unit/actionsGeneratedTest.cpp index 0a19b4f..9fba572 100644 --- a/test/unit/actionsGeneratedTest.cpp +++ b/test/unit/actionsGeneratedTest.cpp @@ -16,8 +16,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "mock_helper.h" #include "actions_impl.h" +#include "mock_helper.h" #include class ActionsGeneratedUTest : public ::testing::Test @@ -34,22 +34,18 @@ TEST_F(ActionsGeneratedUTest, Constructs) TEST_F(ActionsGeneratedUTest, UnsubscribeForwardsToHelper) { - EXPECT_CALL(mockHelper, unsubscribe(7)) - .WillOnce(::testing::Return(Firebolt::Result{Firebolt::Error::None})); + EXPECT_CALL(mockHelper, unsubscribe(7)).WillOnce(::testing::Return(Firebolt::Result{Firebolt::Error::None})); auto result = impl.unsubscribe(7); ASSERT_TRUE(result) << "unsubscribe should return success when helper succeeds"; } - TEST_F(ActionsGeneratedUTest, ForwardsIntentTransportErrors) { EXPECT_CALL(mockHelper, getJson("Actions.intent", ::testing::_)) - .WillOnce(::testing::Invoke([](const std::string& /*method*/, const nlohmann::json& /*params*/) { - return Firebolt::Result{Firebolt::Error::General}; - })); + .WillOnce(::testing::Invoke([](const std::string& /*method*/, const nlohmann::json& /*params*/) + { return Firebolt::Result{Firebolt::Error::General}; })); auto result = impl.intent(); EXPECT_FALSE(result) << "Expected error propagation when helper getJson fails"; } - From 959ef6239866ed1e68dd1f5ce7e22c0ec8a4b096 Mon Sep 17 00:00:00 2001 From: swethasukumarr Date: Tue, 2 Jun 2026 15:39:36 -0400 Subject: [PATCH 2/2] Update workflow to trigger checks for develop branch push/pull_request --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01baa9a..0c7d124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,9 @@ on: - rpc_v2 - legacy push: - branches: [ main, next ] + branches: [ main, develop, next ] pull_request: - branches: [ main, next ] + branches: [ main, develop, next ] defaults: run: