update core file pattern matching for cisco#5270
update core file pattern matching for cisco#5270nkrishk wants to merge 1 commit intoopenconfig:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the regular expression used for identifying Cisco core dump files. By tightening the matching criteria and accounting for variations in directory structure and file compression, the change improves the accuracy of core dump detection and prevents non-core files from being incorrectly flagged. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the regular expression for Cisco device core file patterns in internal/core/core.go. The new pattern is more specific, accounting for an optional /coredumps subdirectory, using word boundaries for the 'core' keyword, and restricting matches to specific file extensions (.gz, .lz4, .txt). I have no feedback to provide.
|
closing this PR #4821 as this PR will take care of the same |
PR Description:
This PR updates the regular expression used to identify Cisco core dump files within the vendorCoreFileNamePattern map in internal/core/core.go.
Changes Introduced:
Optional /coredumps directory: The regex now accounts for an optional /coredumps subdirectory within /misc/disk1, making the pattern more flexible for different Cisco device configurations.
Support for compressed core dumps: The pattern has been extended to explicitly match core dump files ending with .gz or .lz4 or .txt extensions, which are common for compressed core dumps.
Motivation:
The previous regex (/misc/disk1/.core.) was less specific and could potentially miss valid core dump files that are compressed or located within the /coredumps subdirectory. This enhancement improves the accuracy and robustness of core dump detection for Cisco devices, ensuring that compressed core dumps are correctly identified and processed.
Some of the informative files inside coredumps folder is mistakenly treated as core file. This change will avoid detecting these two files as core file
=== RUN TestMain
error notifying tests are done: errors running AfterTestsCallbacks: [error on callback "github.com/openconfig/featureprofiles/internal/core.registerAfter": core file check found cores:
Delta Core Files by DUT:
DUT: R3-10.85.84.51:2014
/misc/disk1/coredumps/core_info
/misc/disk1/coredumps/last_core_timestamp]
Affected File:
internal/core/core.go