Skip to content

update core file pattern matching for cisco#5270

Open
nkrishk wants to merge 1 commit intoopenconfig:mainfrom
nkrishk:nkirshk_cisco_core_pattern
Open

update core file pattern matching for cisco#5270
nkrishk wants to merge 1 commit intoopenconfig:mainfrom
nkrishk:nkirshk_cisco_core_pattern

Conversation

@nkrishk
Copy link
Copy Markdown

@nkrishk nkrishk commented Mar 27, 2026

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:

  1. 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.

  2. 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

@nkrishk nkrishk requested a review from a team as a code owner March 27, 2026 09:03
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Regex Update: Updated the Cisco core dump file pattern to be more specific and robust.
  • Path Flexibility: Added support for an optional /coredumps subdirectory within the file path.
  • Compression Support: Extended the pattern to explicitly match compressed core dump files with .gz, .lz4, or .txt extensions.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@OpenConfigBot
Copy link
Copy Markdown

Pull Request Functional Test Report for #5270 / be97a34

No tests identified for validation.

Help

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

@nkrishk
Copy link
Copy Markdown
Author

nkrishk commented Mar 27, 2026

closing this PR #4821 as this PR will take care of the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants