Cut releasemain#66
Conversation
RDKEMW-17483: Change Discovery.watched and Metrics methods return type
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
feat: actions.intent() and related eventing
Update changelog for v0.6.0
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This PR updates the client and OpenRPC definitions to reflect “fire-and-forget” semantics for Metrics and Discovery (changing return types from Result<bool> to Result<void>), adds the new Actions API, and improves local developer tooling for running tests and linting.
Changes:
- Breaking:
Metrics.*andDiscovery.watchednow returnResult<void>and usehelper_.invoke(...)instead of returning boolean success values. - Adds
ActionsAPI support (Actions.intent,Actions.onIntent) across implementation, accessor wiring, and tests. - Adds/updates local developer scripts (unit/component/all test runners, lint runner, SSH tunnel helper) and updates docs accordingly.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils.h | Updates event verification helper signatures. |
| test/utils.cpp | Updates event verification helpers and related behavior. |
| test/unit/mock_helper.h | Adds mockInvoke() helper for void-returning invoke calls. |
| test/unit/metricsTest.cpp | Updates Metrics unit tests to use invoke-based mocking and void results. |
| test/unit/discoveryTest.cpp | Updates Discovery unit tests for void return and invoke expectations. |
| test/unit/actionsTest.cpp | Adds unit tests for Actions API (intent + subscription). |
| test/unit/actionsGeneratedTest.cpp | Adds generated-style unit tests for Actions forwarding/error propagation. |
| test/ComponentTestsMain.cpp | Makes component test endpoint configurable via FIREBOLT_ENDPOINT. |
| test/component/metricsTest.cpp | Updates component tests for Metrics void-return behavior. |
| test/component/discoveryTest.cpp | Updates component tests for Discovery void-return behavior. |
| test/component/actionsGeneratedTest.cpp | Adds component tests for Actions intent + subscription event flow. |
| test/CMakeLists.txt | Updates UT_OPEN_RPC_FILE definition to an explicit repo path. |
| test/api_test_app/apis/metricsDemo.cpp | Updates Metrics demo output to reflect void return types. |
| test/api_test_app/apis/discoveryDemo.cpp | Updates Discovery demo output to reflect void return types. |
| src/metrics_impl.h | Updates MetricsImpl signatures to return Result<void>. |
| src/metrics_impl.cpp | Switches Metrics calls to helper_.invoke(...) and void results. |
| src/json_types/actions.h | Adds generated JSON types header stub for Actions. |
| src/firebolt.cpp | Wires ActionsImpl into the accessor and unsubscribeAll flow. |
| src/discovery_impl.h | Updates watched() signature to return Result<void>. |
| src/discovery_impl.cpp | Switches watched() implementation to helper_.invoke(...). |
| src/actions_impl.h | Adds generated ActionsImpl declaration. |
| src/actions_impl.cpp | Adds generated ActionsImpl implementation (intent + subscribe/unsubscribe). |
| setup-device-tunnel.sh | Adds helper script to create an SSH tunnel for device websocket traffic. |
| run-unit-tests.sh | Adds local runner script for unit tests (build + execute). |
| run-component-tests.sh | Adds local runner script for component tests (build + execute). |
| run-all-test.sh | Adds combined runner delegating to unit + component scripts. |
| README.md | Documents new test runners and lint script usage. |
| lint.sh | Adds local clang-format/clang-tidy/cppcheck runner script. |
| include/firebolt/metrics.h | Updates public Metrics interface to return Result<void> + doc updates. |
| include/firebolt/firebolt.h | Exposes ActionsInterface() and includes Actions header. |
| include/firebolt/discovery.h | Updates Discovery interface watched() to return Result<void> + doc updates. |
| include/firebolt/actions.h | Adds generated public Actions interface header. |
| docs/openrpc/the-spec/firebolt-open-rpc.json | Updates OpenRPC result schemas for affected methods to null results. |
| docs/openrpc/openrpc/metrics.json | Updates Metrics OpenRPC file to null results and renames result field. |
| docs/openrpc/openrpc/discovery.json | Updates Discovery OpenRPC file to null results and renames result field. |
| CHANGELOG.md | Adds 0.6.0 entry describing new APIs and breaking return-type changes. |
| build.sh | Makes SYSROOT optional (with guardrails around --install). |
Comments suppressed due to low confidence (1)
test/utils.cpp:142
- The comment says the timeout is 5 seconds, but the code waits for
EventWaitTime(2 seconds). AlsoEventWaitTimeis already astd::chrono::seconds, so wrapping it instd::chrono::seconds(...)is redundant. This can confuse future debugging of flaky event tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Result<void> MetricsImpl::ready() const | ||
| { | ||
| return helper_.get<Firebolt::JSON::Boolean, bool>("Metrics.ready"); | ||
| return helper_.invoke("Metrics.ready", nlohmann::json({})); | ||
| } |
| Result<void> MetricsImpl::signIn() const | ||
| { | ||
| return helper_.get<Firebolt::JSON::Boolean, bool>("Metrics.signIn"); | ||
| return helper_.invoke("Metrics.signIn", nlohmann::json({})); | ||
| } |
| Result<void> MetricsImpl::signOut() const | ||
| { | ||
| return helper_.get<Firebolt::JSON::Boolean, bool>("Metrics.signOut"); | ||
| return helper_.invoke("Metrics.signOut", nlohmann::json({})); | ||
| } |
| ASSERT_TRUE(result) << "unsubscribe should return success when helper succeeds"; | ||
| } | ||
|
|
||
| TEST_F(ActionsGeneratedUTest, ForwardsintentTransportErrors) |
| auto result = impl.intent({}); | ||
| EXPECT_FALSE(result) << "Expected error propagation when helper invoke fails"; |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…t-cpp-client into fix/actions.intent
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Fix/actions.intent
No description provided.