Skip to content

Conversation

@mchromin
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 19, 2025 14:19
Copy link

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

This PR fixes an issue where network interfaces weren't being sorted naturally before applying index-based selection, which could lead to incorrect interface selection when interface names don't sort lexicographically (e.g., "eth1", "eth9", "eth10").

Key Changes:

  • Added a natural_key function to properly sort interface names using natural sorting (treating numeric portions as integers)
  • Updated _filter_interfaces_info to sort interfaces before applying index-based selection
  • Added comprehensive test coverage for the natural sorting functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
mfd_network_adapter/network_adapter_owner/base.py Introduced natural_key function and integrated natural sorting into interface filtering logic
tests/unit/test_mfd_network_adapter/test_network_adapter_owner/test_network_owner_base.py Added tests verifying natural sorting behavior and index-based filtering with non-lexicographic interface names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mfd-intel-bot
Copy link
Contributor

We don't publish DEVs .whl.
To build .whl, run 'pip install git+https://intel/mfd-network-adapter@idxsort'

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.

3 participants