Skip to content

Conversation

@dharshini555
Copy link
Contributor

No description provided.

Signed-off-by: PriyaDharshini_Kathiravan <PriyaDharshini_Kathiravan@comcast.com>
@dharshini555 dharshini555 requested a review from a team as a code owner February 3, 2026 10:44
Copilot AI review requested due to automatic review settings February 3, 2026 10:44
Copy link
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

This PR implements functionality to ignore datamodel marker values when they equal "0", aligning with legacy behavior for absolute/split markers. This prevents reporting of markers with zero values in telemetry reports.

Changes:

  • Modified the checkForEmptyString function to treat "0" as an empty/invalid value that should be ignored
  • Added debug logging to indicate when marker values are empty, zero, or NULL

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Consider "NULL" string value as qualified for empty string
if(strlen(valueString) < 1 || !strncmp(valueString, " ", 1) || !strncmp(valueString, "NULL", 4))
// If the string has zero value it should be ignored
if(strlen(valueString) < 1 || !strncmp(valueString, " ", 1) || !strncmp(valueString, "0", 1) || !strncmp(valueString, "NULL", 4))
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The check !strncmp(valueString, "0", 1) will match any string starting with "0", not just the string "0". This means valid values like "01", "012345", "0.5", or "0x1A" would also be incorrectly treated as empty. Consider using strcmp(valueString, "0") == 0 or strlen(valueString) == 1 && valueString[0] == '0' to match only the exact string "0".

Suggested change
if(strlen(valueString) < 1 || !strncmp(valueString, " ", 1) || !strncmp(valueString, "0", 1) || !strncmp(valueString, "NULL", 4))
if(strlen(valueString) < 1 || !strncmp(valueString, " ", 1) || strcmp(valueString, "0") == 0 || !strncmp(valueString, "NULL", 4))

Copilot uses AI. Check for mistakes.
// Consider "NULL" string value as qualified for empty string
if(strlen(valueString) < 1 || !strncmp(valueString, " ", 1) || !strncmp(valueString, "NULL", 4))
// If the string has zero value it should be ignored
if(strlen(valueString) < 1 || !strncmp(valueString, " ", 1) || !strncmp(valueString, "0", 1) || !strncmp(valueString, "NULL", 4))
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The test CheckForEmptyString in source/test/reportgen/reportgenTest.cpp needs to be updated to include test cases for the new "0" check. Currently, the test covers NULL, empty string, space, and "NULL" literal, but doesn't test the newly added "0" behavior to verify it works as intended.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 9, 2026 12:14
Copy link
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 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 197 to 201
rbus_set_data("Device.DeviceInfo.X_RDKCENTRAL-COM.IUI.Version", "string", "0")
kill_telemetry(29)
sleep(5)
assert "IUI_accum" not in grep_T2logs("cJSON Report")
assert "Test_datamodel_1" in grep_T2logs("cJSON Report")
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

grep_T2logs("cJSON Report") returns all matching lines from the entire log file. Since earlier reports in this test already contain IUI_accum, the assertion "IUI_accum" not in grep_T2logs("cJSON Report") can fail (or pass for the wrong reason) unless the logs are cleared or the search is restricted to the most recent report. Consider clearing the log right before triggering the report after setting the value to "0", or changing the helper/usage to only inspect the latest cJSON Report entry (e.g., tail the file / track report boundaries).

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 9, 2026 12:17
Copy link
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 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +173 to 174
pytest.mark.run(order=15)
def test_xconf_datamodel():
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

pytest.mark.run(...) is missing the @ decorator prefix here, so the mark is never applied (it just evaluates an unused expression at import time). This likely breaks the intended ordered execution for this test.

Copilot uses AI. Check for mistakes.
Comment on lines +201 to 202
pytest.mark.run(order=14)
def test_xconf_split_markers():
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

pytest.mark.run(...) is missing the @ decorator prefix here, so the mark is never applied and test ordering will not follow the configured order value.

Copilot uses AI. Check for mistakes.
sleep(7)
assert "IUI_accum\":\"0.1" in grep_T2logs("cJSON Report")
rbus_set_data("Device.DeviceInfo.X_RDKCENTRAL-COM.IUI.Version", "string", "0")
sleep(2)
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

This negative assertion will almost always fail because the same test previously asserted that an earlier report contained IUI_accum, and grep_T2logs() returns all matching lines from the entire log file (it does not scope to the latest report). Clear the log (or extract/assert only the last cJSON Report) before checking that IUI_accum is absent after setting the value to "0".

Suggested change
sleep(2)
sleep(2)
clear_T2logs()

Copilot uses AI. Check for mistakes.
Comment on lines +42 to 47
// If the string has zero value it should be ignored
if(strlen(valueString) < 1 || !strncmp(valueString, " ", 1) || !strcmp(valueString, "0") || !strncmp(valueString, "NULL", 4))
{
isEmpty = true ;
T2Debug("Marker Value is empty or zero or NULL\n");
}
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

checkForEmptyString() now treats the string "0" as empty, but the existing unit test for this helper (in source/test/reportgen/reportgenTest.cpp, TEST(CheckForEmptyString, AllBranchesAreCovered)) does not cover the new branch. Please add a test case asserting that "0" returns true to prevent regressions.

Copilot uses AI. Check for mistakes.
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