Skip to content

fix NIC data parsing for report - #392

Merged
harp-intel merged 2 commits into
mainfrom
nicparsing
Jun 26, 2025
Merged

fix NIC data parsing for report#392
harp-intel merged 2 commits into
mainfrom
nicparsing

Conversation

@harp-intel

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel
harp-intel requested a review from Copilot June 26, 2025 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Refactors parseNicInfo to consolidate repetitive CutPrefix calls into a map-driven loop and moves model-name cleanup to a single post-processing step.

  • Introduce fieldMap for mapping prefixes to struct fields
  • Replace inline CutPrefix calls with a loop over fieldMap
  • Apply a unified trim of any parentheses in nic.Model after parsing
Comments suppressed due to low confidence (1)

internal/report/table_helpers.go:1392

  • [nitpick] Add unit tests for the new model-parentheses trimming logic to verify that NIC models containing parentheses are correctly handled.
		nic.Model = strings.TrimSpace(strings.Split(nic.Model, "(")[0])

Comment thread internal/report/table_helpers.go
Comment thread internal/report/table_helpers.go
@harp-intel
harp-intel merged commit 6e5c185 into main Jun 26, 2025
4 checks passed
@harp-intel
harp-intel deleted the nicparsing branch June 26, 2025 16:45
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