Skip to content

Datamodel markers should ignore marker value as zero#253

Open
dharshini555 wants to merge 3 commits intodevelopfrom
topic/dm_value
Open

Datamodel markers should ignore marker value as zero#253
dharshini555 wants to merge 3 commits intodevelopfrom
topic/dm_value

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.
Signed-off-by: PriyaDharshini_Kathiravan <PriyaDharshini_Kathiravan@comcast.com>
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