Skip to content

Conversation

@jtdub
Copy link
Contributor

@jtdub jtdub commented Nov 6, 2025

closes #157

@jtdub jtdub self-assigned this Nov 6, 2025
@jtdub jtdub marked this pull request as draft November 6, 2025 20:01
@jtdub jtdub changed the title Resolves idempotency in future() Resolves idempotency issue in future() Nov 6, 2025
@jtdub jtdub requested review from aedwardstx and Copilot November 6, 2025 22:50
@jtdub jtdub marked this pull request as ready for review November 6, 2025 22:50
Copy link
Contributor

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 pull request introduces structural idempotency matching for the future() method to correctly distinguish between commands that share common prefixes but have different structural identities (like BGP neighbor configurations with different IP addresses). The changes include new idempotency key generation logic, a comprehensive regression test, and documentation updates for the new feature and Fortinet FortiOS driver support.

  • Enhanced idempotency matching algorithm using structural keys based on match rules
  • Added regression test for BGP neighbor description preservation
  • Documented structural idempotency matching feature (version 3.3.1)
  • Added Fortinet FortiOS to the list of supported platforms

Reviewed Changes

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

Show a summary per file
File Description
tests/test_hier_config.py Adds regression test verifying BGP neighbor descriptions are correctly preserved during future/rollback operations
hier_config/platforms/driver_base.py Implements structural idempotency key generation with helper methods for matching prefixes, suffixes, contains, and regex patterns
docs/future-config.md Documents the new structural idempotency matching feature introduced in version 3.3.1
docs/drivers.md Adds Fortinet FortiOS driver documentation and formatting improvements throughout the driver documentation sections
docs/index.md Adds Fortinet FortiOS to the supported platforms list
README.md Adds Fortinet FortiOS to supported platforms, new Highlights section showcasing the improved future() functionality, and formatting improvements

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

jtdub and others added 7 commits January 11, 2026 18:53
- Increase driver_base.py coverage from 78% to 98%
- Add 25 new tests covering all idempotency key code paths
- Test all match rule types: equals, startswith, endswith, contains, regex
- Test edge cases: negated commands, lineage mismatch, tuple matching
- Test regex features: capture groups, greedy patterns, normalization
- Verify issue #157 fix with comprehensive test scenarios

All tests pass (74 in test_hier_config.py, 118 total)
- Move all imports to top-level (fix PLC0415)
- Add noqa: SLF001 for intentional private member access
- Sort imports properly (fix I001)

All tests passing, ruff checks clean.
- Add module docstring and pylint disable for too-many-lines
- Add pyright ignore comments for intentional private member access (25 instances)
- Fix pylint C1803: Change 'key == ()' to 'not key' for implicit boolean check

All tests passing, pyright 0 errors, ruff checks clean.
…ptions-diaeV

Fix BGP neighbor descriptions dropped in future config
@jtdub jtdub merged commit 81ec52b into master Jan 17, 2026
5 checks passed
@jtdub jtdub deleted the issue157 branch January 17, 2026 04:31
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.

idempotent_for() method causes dropped lines in future config - HConfigDriverBase

3 participants