Feature/UUID debug.txt#193
Conversation
…ypeEvent Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/76cad72a-f67f-4c05-8fb5-bfadf0c173b3 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/125526c2-7b70-48f5-8bec-fd725eea8a04 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
…suffix Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/904bf10d-546b-4038-a60c-9bc76094a225 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
… built-in special-char removal) Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/00abcaba-8a41-4b88-ae12-07b5ff780ff9 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/4de31e24-70d8-496c-ac6a-a5376771d936 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
…ectly rrd_logproc_convert_issue_type() was converting '-' to '_', turning the suffix '_Search-67768-67' into '_SEARCH_67768_67'. This added extra '_' separators into the archive filename that broke the analytics portal's filename parser — it could no longer identify the timestamp field, so download requests used an incorrect S3 key. Fix: keep '-' as '-' in the sanitized output. The archive filename now uses '_' to separate structural fields (MAC, issueType, timestamp) and '-' within the UUID suffix, giving the portal a reliable delimiter. Also increase issue_type_sanitized buffer in uploadRRDLogs.c from 64 to 256 bytes so a full UUID suffix never causes a silent truncation failure. Before: 04B86A12F9F8_DEVICE_DEVICEIP_SEARCH_67768_67_<timestamp>_RRD_DEBUG_LOGS.tgz After: 04B86A12F9F8_DEVICE_DEVICEIP_SEARCH-67768-67_<timestamp>_RRD_DEBUG_LOGS.tgz All 331 tests pass. Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/981b6bc1-c9d2-4150-9e9d-851004942ffc Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
…9 rule
split_issue_type() now discards any suffix whose total length (including
the leading '_') exceeds 9 characters. The old _Search-/_LogSearch-
prefix validation is removed entirely.
Rule:
strlen(underscore) <= 9 → suffix accepted
strlen(underscore) > 9 → suffix discarded
This means:
- Short session tokens (e.g. "_ab12345", 8 chars) are carried through
- Long UUID-based suffixes like "_Search-b6877385-...) are discarded,
preventing extra '_' delimiters from breaking the portal filename parser
Affected tests updated:
- UnderscoreSplitsBaseAndSuffix : uses a short accepted suffix
- MultipleUnderscoresSplitsAtFirst: "_def_ghi" (8 chars) now kept
- BaseTruncatedWhenTooSmall / ExactFitBase: "_suffix" (7 chars) now kept
- SuffixTruncatedWhenTooSmall: uses 9-char suffix with 5-byte buffer
- OnlyUnderscoreInput: "_" (1 char) now kept
- LogSearchSuffixIsValid → NineCharSuffixIsAccepted (boundary test)
- SearchSuffixIsValid → LongSuffixIsDiscarded
- InvalidSuffixPrefixDiscarded / SearchWithoutHyphenIsInvalid /
LogSearchWithoutHyphenIsInvalid: updated comments (same outcomes)
- ProcessIssueTypeEvntTest comments updated to reflect new rule
All 331 tests pass.
Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448
Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
…tests
- Expand the RRD_MAX_SUFFIX_LEN comment to explain why 9 chars is the limit
- Rename misleading test names that referenced old prefix-based validation:
InvalidSuffixPrefixDiscarded → SuffixExceedingMaxLengthDiscarded
SearchWithoutHyphenIsInvalid → SuffixSeventeenCharsDiscarded
LogSearchWithoutHyphenIsInvalid → SuffixTwentyCharsDiscarded
- LongSuffixIsDiscarded: switch to a neutral _1234567890 example so the
test does not imply any Search-specific behavior
All 331 tests pass.
Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448
Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Code Coverage Summary |
|
@copilot |
There was a problem hiding this comment.
Pull request overview
This PR adds support for carrying an “issue type suffix” through the remote debugger flow so it can be appended to the upload artifact name, and updates sanitization logic/tests to preserve hyphens (for UUID-like tokens) while also expanding/adjusting unit test coverage.
Changes:
- Introduces
split_issue_type()and a newdata_buf::suffixfield, then appends the suffix to the upload issue name incheckIssueNodeInfo(). - Updates issue-type tokenization/sanitization flow and adjusts unit tests accordingly (including new tests for splitting behavior and suffix lifecycle).
- Preserves hyphens in
rrd_logproc_convert_issue_type()and adds a new.gitignorefor build/test artifacts.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/uploadRRDLogs.c | Enlarges sanitized issue type buffer to align with archive filename sizing. |
| src/unittest/rrdUnitTestRunner.cpp | Updates/extends gtest coverage for issue splitting, suffix handling, and sanitization expectations. |
| src/rrdJsonParser.h | Exposes the new split_issue_type() helper. |
| src/rrdJsonParser.c | Adds split_issue_type() and appends suffix into the upload issue name; cleans up suffix on error/exit paths. |
| src/rrdInterface.c | Initializes and frees the newly added data_buf::suffix. |
| src/rrdEventProcess.c | Changes issue token handling to split base/suffix and sanitize base post-split; removes pre-split sanitization. |
| src/rrdCommon.h | Adds suffix field to data_buf. |
| src/rrd_logproc.c | Preserves hyphens during issue type sanitization. |
| .gitignore | Adds ignore rules for autotools/build artifacts and test outputs. |
| /* Maximum allowed suffix length (including the leading '_'). | ||
| * The analytics portal parses archive filenames by splitting on '_'. A suffix | ||
| * longer than this limit would introduce extra '_' delimiters that shift the | ||
| * timestamp field to a wrong position, causing download failures. | ||
| * 9 characters = '_' + up to 8 alphanumeric/short-token chars: long UUID-based | ||
| * suffixes (e.g. "_Search-b6877385-...") are always > 9 and are therefore | ||
| * discarded before the archive name is built. */ | ||
| #define RRD_MAX_SUFFIX_LEN 9 |
| void split_issue_type(const char *input, char *base, size_t base_len, char *suffix, size_t suffix_len) | ||
| { | ||
| if (base && base_len > 0) | ||
| { | ||
| base[0] = '\0'; | ||
| } | ||
| if (suffix && suffix_len > 0) | ||
| { | ||
| suffix[0] = '\0'; | ||
| } | ||
|
|
||
| if (!input || !base || !suffix) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| if (base_len == 0 || suffix_len == 0) | ||
| { |
| while (str[source] != '\0') | ||
| { | ||
| if (isalnum(str[source]) || str[source] == ',' || str[source] == '.') | ||
| //if (isalnum(str[source]) || str[source] == ',' || str[source] == '.' || str[source] == '_'|| str[source] == '-') | ||
| if (isalnum(str[source]) || str[source] == ',' || str[source] == '.') | ||
| { |
| for (size_t i = 0; input[i] && j < size-1; ++i) { | ||
| char c = input[i]; | ||
| if (isalnum((unsigned char)c)) output[j++] = toupper((unsigned char)c); | ||
| else if (c == '_' || c == '-' || c == '.') output[j++] = '_'; | ||
| else if (c == '_' || c == '.') output[j++] = '_'; | ||
| else if (c == '-') output[j++] = '-'; // preserve hyphens so suffix UUID tokens remain distinct | ||
| // skip other chars |
| cmdBuff = (data_buf *)malloc(sizeof(data_buf)); | ||
| if (cmdBuff) | ||
| { | ||
| dataMsgLen = strlen(cmdMap[index]) + 1; | ||
| char base[128] = {0}; | ||
| char local_suffix[128] = {0}; |
| int cnt = 1, i = 0; | ||
| char *str = input_str; | ||
|
|
||
| removeSpecialCharacterfromIssueTypeList(str); | ||
| while (*str == delimeter) | ||
| str++; | ||
|
|
…name Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/2420015b-82ba-469b-b752-921aeccf2a63 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Done in ce81da8. The suffix is now appended to |
| * 9 characters = '_' + up to 8 alphanumeric/short-token chars: long UUID-based | ||
| * suffixes (e.g. "_Search-b6877385-...") are always > 9 and are therefore | ||
| * discarded before the archive name is built. */ | ||
| #define RRD_MAX_SUFFIX_LEN 50 |
| while (str[source] != '\0') | ||
| { | ||
| if (isalnum(str[source]) || str[source] == ',' || str[source] == '.') | ||
| //if (isalnum(str[source]) || str[source] == ',' || str[source] == '.' || str[source] == '_'|| str[source] == '-') | ||
| if (isalnum(str[source]) || str[source] == ',' || str[source] == '.') | ||
| { |
| int cnt = 1, i = 0; | ||
| char *str = input_str; | ||
|
|
||
| removeSpecialCharacterfromIssueTypeList(str); | ||
| while (*str == delimeter) | ||
| str++; | ||
|
|
| for (size_t i = 0; input[i] && j < size-1; ++i) { | ||
| char c = input[i]; | ||
| if (isalnum((unsigned char)c)) output[j++] = toupper((unsigned char)c); | ||
| else if (c == '_' || c == '-' || c == '.') output[j++] = '_'; | ||
| else if (c == '_' || c == '.') output[j++] = '_'; | ||
| else if (c == '-') output[j++] = '-'; // preserve hyphens so suffix UUID tokens remain distinct | ||
| // skip other chars |
| } | ||
| dataMsgLen = strlen(base) + 1; | ||
| RRD_data_buff_init(cmdBuff, EVENT_MSG, RRD_DEEPSLEEP_INVALID_DEFAULT); /* Setting Deafult Values*/ | ||
| cmdBuff->inDynamic = rbuf->inDynamic; | ||
| if(cmdBuff->inDynamic) |
No description provided.