Skip to content

Feature/rdk 60236 structure#192

Open
Abhinavpv28 wants to merge 78 commits intodevelopfrom
feature/RDK-60236_structure
Open

Feature/rdk 60236 structure#192
Abhinavpv28 wants to merge 78 commits intodevelopfrom
feature/RDK-60236_structure

Conversation

@Abhinavpv28
Copy link
Copy Markdown
Contributor

No description provided.

Abhinavpv28 and others added 14 commits May 3, 2026 12:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 4, 2026 15:05
@Abhinavpv28 Abhinavpv28 requested a review from a team as a code owner May 4, 2026 15:05
@Abhinavpv28
Copy link
Copy Markdown
Contributor Author

@copilot add gtest testcases for newly aded changes

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Code Coverage Summary

                               Total:|83.3%   6022|97.1%  1564|    -      0

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

This PR introduces support for issue-type “suffixes” (tokens after the first underscore) by splitting issue type strings into a base + persisted suffix, carrying that suffix through data_buf, and using it when building the upload artifact name.

Changes:

  • Added split_issue_type() utility (exported via rrdJsonParser.h) and comprehensive unit tests for it.
  • Extended data_buf with a suffix field; initialized/freed it in buffer lifecycle helpers and key processing paths.
  • Updated issue-type processing to preserve suffix while still using the base issue type for JSON lookup, and adjusted upload naming and sanitization to allow _ and -.

Reviewed changes

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

Show a summary per file
File Description
src/unittest/rrdUnitTestRunner.cpp Adds tests for split_issue_type() and updates some event/cache tests for new struct fields.
src/rrdJsonParser.h Exposes the new split_issue_type() API.
src/rrdJsonParser.c Implements split_issue_type() and appends persisted suffix into upload tar name; adds cleanup for new suffix field.
src/rrdInterface.c Initializes/frees data_buf.suffix in init/dealloc helpers.
src/rrdEventProcess.c Splits issue types into base/suffix and stores suffix on data_buf; expands sanitization to keep _ and -.
src/rrdCommon.h Extends data_buf with suffix.

Comment thread src/rrdInterface.c
Comment thread src/rrdJsonParser.c
Comment thread src/rrdEventProcess.c
Comment thread src/rrdJsonParser.c
Comment on lines 3766 to 3772
data_buf rbuf;
rbuf.mtype = EVENT_MSG;
rbuf.mdata = strdup("Test");
rbuf.inDynamic = true;
rbuf.jsonPath = nullptr;
rbuf.suffix = strdup("_search_b675-657-556-656");
msgRRDHdr msgHdr;
Copy link
Copy Markdown

Copilot AI commented May 4, 2026

@copilot add gtest testcases for newly aded changes

Added gtest test cases in commit dcff40f for the newly added functionality:

SplitIssueTypeTest (6 new tests):

  • NullBaseDoesNotCrash / NullSuffixDoesNotCrash — null pointer guards
  • ZeroBaseLenDoesNotCrash / ZeroSuffixLenDoesNotCrash — zero-length buffer guards
  • ExactFitBase — buffer sized exactly for base + NUL
  • OnlyUnderscoreInput — single _ input

RRDDataBuffInitTest (1 new test):

  • SuffixInitializedToNull — verifies the new suffix field is set to NULL by RRD_data_buff_init()

RRDDataBuffDeAllocTest (2 new tests):

  • DeallocateWithSuffixSet — verifies suffix is freed when non-NULL
  • DeallocateWithAllFieldsNull — all pointer fields NULL doesn't crash

ProcessIssueTypeEvntTest (3 new tests):

  • IssueTypeWithSuffix_inDynamic_NoJson — issue type with underscore suffix is correctly parsed and handled
  • IssueTypeStartingWithUnderscore_isSkipped — empty base detection causes the entry to be skipped
  • MultipleIssueTypesWithAndWithoutSuffix — comma-separated list with mixed types

All 322 tests pass.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Code Coverage Summary

                               Total:|83.7%   6106|97.1%  1612|    -      0

Copilot AI review requested due to automatic review settings May 5, 2026 08:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Code Coverage Summary

                               Total:|83.7%   6106|97.1%  1612|    -      0

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

Comment thread src/rrdEventProcess.c
Comment on lines 99 to 104
@@ -88,9 +103,19 @@ void processIssueTypeEvent(data_buf *rbuf)
}
cmdBuff->appendMode = rbuf->appendMode;
Comment thread src/rrdEventProcess.c
Comment on lines 670 to 673
while (str[source] != '\0')
{
if (isalnum(str[source]) || str[source] == ',' || str[source] == '.')
if (isalnum(str[source]) || str[source] == ',' || str[source] == '.' || str[source] == '_'|| str[source] == '-')
{
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.

3 participants