Skip to content

RDKEMW-21912: Enabling support for RFC - #529

Open
KonkatiBhavani wants to merge 10 commits into
developfrom
feature/RDKEMW-23244
Open

RDKEMW-21912: Enabling support for RFC#529
KonkatiBhavani wants to merge 10 commits into
developfrom
feature/RDKEMW-23244

Conversation

@KonkatiBhavani

Copy link
Copy Markdown

No description provided.

Copilot AI lite review requested due to automatic review settings August 16, 2026 12:05
@KonkatiBhavani
KonkatiBhavani requested a review from a team as a code owner August 16, 2026 12:05
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|73.7%  9645|90.2% 661|    -    0

Copilot AI review requested due to automatic review settings August 17, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|73.7%  9645|90.2% 661|    -    0

Copilot AI review requested due to automatic review settings August 19, 2026 06:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|73.5%  9696|90.2% 661|    -    0

Copilot AI review requested due to automatic review settings August 24, 2026 06:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:4031

  • get_xRDKCentralComRFCLogChronoEnable() appears to return the inverted value: it sets isEnabled=true when the disable flag file exists. Since set_xRDKCentralComRFCLogChronoEnable(true) removes LOGCHRONO_DISABLE_FILE and set(false) creates it, the getter should report enabled when the file is absent (e.g., access(...) != 0).
    stMsgData->paramtype = hostIf_BooleanType;
    bool isEnabled = (access(LOGCHRONO_DISABLE_FILE, F_OK) == 0) ? true : false;
    put_boolean(stMsgData->paramValue, isEnabled);
    stMsgData->paramLen = sizeof(bool);
    stMsgData->faultCode = fcNoFault;

Comment on lines 41 to +47
#include <cmath>
#include <cstring>
#include <string>
#include <fstream>
#include <cstdio>
#include <errno.h>
#include <unistd.h>
Comment thread src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|73.5%  9664|90.2% 660|    -    0

rebase
Copilot AI review requested due to automatic review settings August 24, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated 2 comments.

Suppressed comments (2)

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:47

  • The newly added standard headers are duplicated later in this file (e.g., <string>, <fstream>, and <errno.h> already appear again around lines 57–64). This increases include noise and can slow compilation; please remove the duplicates and keep only the minimal new headers required for this change.
#include <string>
#include <fstream>
#include <cstdio>
#include <errno.h>
#include <unistd.h>

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:3950

  • New RFC set/get behavior was added for Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.LogChrono.Enable, but there are no corresponding DeviceInfo gtests for it. There are already tests for similar RFC toggles (e.g., NewNtpEnable in profiles/DeviceInfo/gtest/gtest_main.cpp), so adding tests for LogChrono enable/disable and GET default behavior would help prevent regressions.
int hostIf_DeviceInfo::set_xRDKCentralComRFCLogChronoEnable(HOSTIF_MsgData_t *stMsgData)
{
    int ret = NOK;
    bool enable;
    LOG_ENTRY_EXIT;

Comment thread src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp Outdated
Comment thread src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|73.5%  9664|90.2% 660|    -    0

@KonkatiBhavani

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Copilot AI review requested due to automatic review settings August 26, 2026 13:02
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|62.4%  2813|64.8% 247|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:47

  • The newly added headers duplicate existing includes later in this file (e.g., , , <errno.h> are already included again below). This increases compile time/noise and can cause subtle ordering issues; it’s better to include each header only once.
#include <string>
#include <fstream>
#include <cstdio>
#include <errno.h>
#include <unistd.h>

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:3983

  • This PR introduces a new RFC setter (LogChrono.Enable) with filesystem side effects, but there’s no corresponding unit test coverage. There are existing gtests for similar flag-file RFC setters (e.g., NewNtpEnable in src/hostif/profiles/DeviceInfo/gtest/gtest_main.cpp) that could be mirrored to verify disable_logchrono creation/removal and return codes.
int hostIf_DeviceInfo::set_xRDKCentralComRFCLogChronoEnable(HOSTIF_MsgData_t *stMsgData)
{
    int ret = NOK;
    bool enable;
    LOG_ENTRY_EXIT;

    if(stMsgData->paramtype == hostIf_BooleanType)
    {
        enable = get_boolean(stMsgData->paramValue);
        if(enable)
        {
            RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s] set LogChrono.Enable to true\n", __FUNCTION__);
            if(remove(LOGCHRONO_DISABLE_FILE) != 0 && errno != ENOENT)
            {
                RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s] Unable to clear disable logchrono flag %s\n",
                        __FUNCTION__, LOGCHRONO_DISABLE_FILE);
                ret = NOK;
            }
            else
            {
                ret = OK;
            }
        }
        else
        {
            RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s] set LogChrono.Enable to false\n", __FUNCTION__);
            std::ofstream disableFile(LOGCHRONO_DISABLE_FILE);
            if(!disableFile.is_open())
            {
                RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s] Unable to create disable logchrono flag %s\n",
                        __FUNCTION__, LOGCHRONO_DISABLE_FILE);
                ret = NOK;
            }
            else
            {
                disableFile.close();
                ret = OK;
            }

@KonkatiBhavani KonkatiBhavani changed the title Feature/rdkemw 23244 RDKEMW-21912: Enabling support for RFC Aug 27, 2026
Copilot AI review requested due to automatic review settings September 9, 2026 12:23
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|62.4%  2813|64.8% 247|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new LogChrono toggle implementation introduces security/operability issues (flag-file creation permissions and missing errno details) and some maintainability regressions that should be corrected before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:47

  • These headers are already included later in this file (e.g., , , <errno.h>), so adding them again here introduces redundant/duplicate includes and makes the include list harder to maintain.
#include <string>
#include <fstream>
#include <cstdio>
#include <errno.h>
#include <unistd.h>

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:3983

  • On failure to remove the disable flag, the log drops the underlying error, which makes field debugging difficult. Please include strerror(errno) (as done elsewhere in this file, e.g. DistributedTracing handling).
            if(remove(LOGCHRONO_DISABLE_FILE) != 0 && errno != ENOENT)
            {
                RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s] Unable to clear disable logchrono flag %s\n",
                        __FUNCTION__, LOGCHRONO_DISABLE_FILE);
                ret = NOK;
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment on lines +3992 to +4004
RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s] set LogChrono.Enable to false\n", __FUNCTION__);
std::ofstream disableFile(LOGCHRONO_DISABLE_FILE);
if(!disableFile.is_open())
{
RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s] Unable to create disable logchrono flag %s\n",
__FUNCTION__, LOGCHRONO_DISABLE_FILE);
ret = NOK;
}
else
{
disableFile.close();
ret = OK;
}
Comment on lines +3691 to +3694
<syntax>
<boolean/>
<default type="factory" value="true"/>
</syntax>
RDKEMW-19847: Migrate RDKE Logupload Triggers from System Calls to AP…
Copilot AI review requested due to automatic review settings September 10, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved moderate findings affect error handling, validation, and test coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (3)

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:3971

  • Please add tests for this new side-effecting RFC path. The existing DeviceInfo suite covers RFC setters and invalid-type branches, but neither the true/false transitions nor file-operation failures for disable_logchrono are exercised, so regressions in the flag state or return status can pass CI.
int hostIf_DeviceInfo::set_xRDKCentralComRFCLogChronoEnable(HOSTIF_MsgData_t *stMsgData)
{
    int ret = NOK;
    bool enable;
    LOG_ENTRY_EXIT;

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:4003

  • is_open() only verifies that the stream was opened; a write/close error can still leave the disable flag unavailable. Because ret is set to OK unconditionally after close(), the SET can report success even though the flag was not successfully committed. Check the stream state after closing before returning success.
                disableFile.close();
                ret = OK;

src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp:3976

  • This type check runs after set_xRDKCentralComRFC has already persisted stMsgData->paramValue to the RFC store, so a non-boolean SET can write an invalid value even though this handler returns NOK; the error branch at lines 4007-4010 also leaves faultCode unchanged. Validate this parameter as boolean before the generic store write and report fcInvalidParameterType on rejection.
    if(stMsgData->paramtype == hostIf_BooleanType)
    {
        enable = get_boolean(stMsgData->paramValue);
        if(enable)
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +3843 to +3845
else if (!strcasecmp(stMsgData->paramName, LOGCHRONO_RFC_ENABLE))
{
ret = set_xRDKCentralComRFCLogChronoEnable(stMsgData);
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|73.6%  9668|90.3% 660|    -    0

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.

2 participants