Skip to content

feat(ref): reloadDatabase command support#209

Open
Lakshmi97-velampati wants to merge 5 commits intomainfrom
mvelam850/dev/BARTON-110
Open

feat(ref): reloadDatabase command support#209
Lakshmi97-velampati wants to merge 5 commits intomainfrom
mvelam850/dev/BARTON-110

Conversation

@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor

@Lakshmi97-velampati Lakshmi97-velampati commented Apr 21, 2026

Adds the command to reloadDatabase reference app's cli. Also removes the concept of advance commands from barton's reference app. Now it will show all the commands.

Refs: BARTON-110

Adds the command to reloadDatabase reference app's cli.
But right now this is marked as advanced so not possible to run from cli.

Refs: BARTON-110

Signed-off-by: mvelam850 <munilakshmi_velampati@comcast.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for a new reloadDatabase operation by exposing it through the C client API and wiring it into the reference app’s Core CLI category (as an advanced command).

Changes:

  • Add b_core_client_reload_database() to the C client implementation and public header.
  • Add reloadDatabase advanced command to the reference CLI Core category, invoking the new client API.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
reference/src/coreCategory.c Adds reloadDatabase advanced CLI command and handler function
api/c/src/barton-core-client.c Implements new C client API wrapper calling deviceServiceReloadDatabase()
api/c/public/barton-core-client.h Declares and documents b_core_client_reload_database() in the public API

Comment thread reference/src/coreCategory.c
Comment thread reference/src/coreCategory.c Outdated
Comment thread api/c/src/barton-core-client.c
@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

- Add blank lines before if/return in reloadDatabaseFunc
- Fix comment style: add space after // for reload database comment
- Add test_b_core_client_reload_database with NULL guard and success/failure cases
- Add __wrap_deviceServiceReloadDatabase wrap function and declaration
- Register new test in main() and add wrap to CMakeLists.txt"

Agent-Logs-Url: https://github.com/rdkcentral/BartonCore/sessions/3637ed33-d8fd-4b2a-a879-f4d10bcc92e0

Co-authored-by: Lakshmi97-velampati <190572788+Lakshmi97-velampati@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

@copilot apply changes based on the comments in this thread

Applied all three code review changes in commit 8e7b835:

  1. Added blank lines before if and return in reloadDatabaseFunc (coreCategory.c)
  2. Fixed comment style to // reload database (advanced) (space after //)
  3. Added test_b_core_client_reload_database unit test covering the NULL-self guard, successful invocation, and failure surfacing, along with the __wrap_deviceServiceReloadDatabase mock and the deviceServiceReloadDatabase linker wrap in CMakeLists.txt

Copy link
Copy Markdown
Contributor

@tleacmcsa tleacmcsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"advanced" commands do not make sense in Barton's reference app, which was started from the official xhDeviceUtil source.

Please remove the concept of advanced commands from the reference app codebase.

@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor Author

"advanced" commands do not make sense in Barton's reference app, which was started from the official xhDeviceUtil source.

Please remove the concept of advanced commands from the reference app codebase.

@tleacmcsa if it is not required can we discard this PR. And do you want to remove the existing command removeDevices which was marked as advanced as part of this ticket?

@cleithner-comcast
Copy link
Copy Markdown
Contributor

"advanced" commands do not make sense in Barton's reference app, which was started from the official xhDeviceUtil source.
Please remove the concept of advanced commands from the reference app codebase.

@tleacmcsa if it is not required can we discard this PR. And do you want to remove the existing command removeDevices which was marked as advanced as part of this ticket?

I think Thomas means specifically the "advanced" flag and API in the reference app can be discarded (it and other pieces of the reference app originally came from a different utility called devuceUtil). reloadDatabase is still desired. Same with removeDevice, which should not be marked advanced but we still want to keep it.

Signed-off-by: mvelam850 <munilakshmi_velampati@comcast.com>
Copilot AI review requested due to automatic review settings April 24, 2026 03:34
@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor Author

"advanced" commands do not make sense in Barton's reference app, which was started from the official xhDeviceUtil source.
Please remove the concept of advanced commands from the reference app codebase.

@tleacmcsa if it is not required can we discard this PR. And do you want to remove the existing command removeDevices which was marked as advanced as part of this ticket?

I think Thomas means specifically the "advanced" flag and API in the reference app can be discarded (it and other pieces of the reference app originally came from a different utility called devuceUtil). reloadDatabase is still desired. Same with removeDevice, which should not be marked advanced but we still want to keep it.

Done

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Comment thread reference/src/coreCategory.c Outdated
Comment thread reference/src/coreCategory.c Outdated
Comment thread reference/src/category.c
Comment thread reference/src/command.h
@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

…goryPrint

- Remove '(advanced)' from '// remove devices (advanced)' comment
- Remove '(advanced)' from '// reload database (advanced)' comment
- Add blank line before 'for' loop in categoryPrint per blank-line style rules

Agent-Logs-Url: https://github.com/rdkcentral/BartonCore/sessions/6678de97-7ef5-4a18-a062-3175709c451b

Co-authored-by: Lakshmi97-velampati <190572788+Lakshmi97-velampati@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

@copilot apply changes based on the comments in this thread

Applied all review feedback in commit 9719ea5:

  1. Removed stale (advanced) label from the // remove devices comment (coreCategory.c)
  2. Removed stale (advanced) label from the // reload database comment (coreCategory.c)
  3. Added blank line before the for loop in categoryPrint (category.c) per the blank-line style rules

The removal of the advanced concept itself (from command.h, category.c, command.c) was intentional per the discussion — removeDevices and reloadDatabase are now both regular (non-hidden) commands.

Copilot AI review requested due to automatic review settings April 27, 2026 10:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread reference/src/command.c
@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor Author

"advanced" commands do not make sense in Barton's reference app, which was started from the official xhDeviceUtil source.
Please remove the concept of advanced commands from the reference app codebase.

@tleacmcsa if it is not required can we discard this PR. And do you want to remove the existing command removeDevices which was marked as advanced as part of this ticket?

I think Thomas means specifically the "advanced" flag and API in the reference app can be discarded (it and other pieces of the reference app originally came from a different utility called devuceUtil). reloadDatabase is still desired. Same with removeDevice, which should not be marked advanced but we still want to keep it.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants