RDKEMW-17483: Change Discovery.watched and Metrics methods return type#62
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Discovery watched() API and multiple Metrics event APIs to return Result<void> (instead of Result<bool>), aligning them with “fire-and-forget” invocation semantics rather than boolean-returning queries.
Changes:
- Changed
Discovery.watchedand mostMetrics.*methods to returnResult<void>and switched implementations fromhelper_.get<...>tohelper_.invoke(...). - Updated unit/component tests and demo apps to stop dereferencing boolean results and instead assert only success.
- Added a unit-test helper (
mockInvoke) for mocking void-returning invocations.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
include/firebolt/metrics.h |
Updates Metrics interface return types to Result<void> (docs need adjustment). |
include/firebolt/discovery.h |
Updates Discovery interface return type to Result<void> (docs need adjustment). |
src/metrics_impl.h |
Updates MetricsImpl overrides to Result<void>. |
src/metrics_impl.cpp |
Switches Metrics implementations from get<bool> to invoke and returns Result<void>. |
src/discovery_impl.h |
Updates DiscoveryImpl override to Result<void>. |
src/discovery_impl.cpp |
Switches watched() implementation to invoke and returns Result<void>. |
test/unit/mock_helper.h |
Adds mockInvoke() helper for void invocations. |
test/unit/metricsTest.cpp |
Updates unit tests to use mockInvoke() and stop checking boolean payloads. |
test/unit/discoveryTest.cpp |
Updates unit tests to use invoke and stop checking boolean results. |
test/component/metricsTest.cpp |
Updates component tests to only assert success (no expected boolean comparison). |
test/component/discoveryTest.cpp |
Updates component test to only assert success (currently missing gtest include). |
test/api_test_app/apis/metricsDemo.cpp |
Updates demo output to not print boolean result values. |
test/api_test_app/apis/discoveryDemo.cpp |
Updates demo output to not print boolean result values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d742b31 to
23347bc
Compare
d8d4605 to
8b531c0
Compare
8b531c0 to
bd39f0d
Compare
satlead
previously approved these changes
May 8, 2026
brendanobra
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.