Context
During the pypi-support branch work, tests were written that called resolve_sequence_commands("seq") without the required device_name parameter. The method signature requires a device name to resolve vendor-specific sequences.
Identified in PR for pypi-support branch merge.
Current State
resolve_sequence_commands(sequence_name, device_name) requires both parameters
- Global sequences don't need device context to resolve
- Current implementation always requires device_name even when looking up global sequences
Desired State
Make device_name optional for resolving global sequences:
def resolve_sequence_commands(
self,
sequence_name: str,
device_name: str | None = None
) -> list[str] | None:
"""
Resolve a sequence name to its commands.
Args:
sequence_name: Name of the sequence to resolve
device_name: Optional device name for vendor/device-specific resolution
Returns:
List of commands if found, None otherwise
Resolution order:
1. Global sequences (no device_name needed)
2. Vendor sequences (requires device_name for device_type lookup)
3. Device sequences (requires device_name)
"""
Implementation Notes
- Global sequences should be resolvable without device context
- When device_name is None, only check global sequences
- When device_name is provided, check vendor and device sequences too
- Maintain backwards compatibility with existing callers
Files Likely Affected
src/network_toolkit/config.py - Modify resolve_sequence_commands signature
src/network_toolkit/common/sequence_manager.py - May need updates
tests/test_config.py - Add tests for optional device_name
Acceptance Criteria
Related
- pypi-support branch merge PR
Context
During the pypi-support branch work, tests were written that called
resolve_sequence_commands("seq")without the requireddevice_nameparameter. The method signature requires a device name to resolve vendor-specific sequences.Identified in PR for pypi-support branch merge.
Current State
resolve_sequence_commands(sequence_name, device_name)requires both parametersDesired State
Make
device_nameoptional for resolving global sequences:Implementation Notes
Files Likely Affected
src/network_toolkit/config.py- Modify resolve_sequence_commands signaturesrc/network_toolkit/common/sequence_manager.py- May need updatestests/test_config.py- Add tests for optional device_nameAcceptance Criteria
Related