Skip to content

fix NIC data parsing for report #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2025
Merged

fix NIC data parsing for report #392

merged 2 commits into from
Jun 26, 2025

Conversation

harp-intel
Copy link
Contributor

No description provided.

Signed-off-by: Harper, Jason M <[email protected]>
Signed-off-by: Harper, Jason M <[email protected]>
@harp-intel harp-intel requested a review from Copilot June 26, 2025 16:19
Copy link
Contributor

@Copilot 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

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])

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

1 participant