-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
v4-enhancementEnhancement planned for hier_config v4.0.0Enhancement planned for hier_config v4.0.0
Description
Description
Currently drivers can extend behavior two ways: declarative rules (via HConfigDriverRules) and imperative method overrides (idempotent_for(), swap_negation(), config_preprocessor()). This dual mechanism makes behavior harder to predict and prevents drivers from being fully serializable.
Proposed Change
Move all imperative overrides into the rule system:
- XR's ACL sequence number logic →
IdempotentKeyExtractorRuleor similar - FortiOS/VyOS/Juniper
swap_negation()→ unified negation rule system (v4: Unify negation rules into single NegationRule with strategy enum #220) config_preprocessor()→FullTextSubRuleor newPreprocessorRule
Benefits
- All driver behavior lives in
HConfigDriverRules - Drivers become fully serializable (could be loaded from YAML/JSON)
- Easier to test — no method mocking needed, just rule configuration
- Users can extend drivers without subclassing
Breaking Change
Yes — all drivers that override methods must be rewritten to use rules.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
v4-enhancementEnhancement planned for hier_config v4.0.0Enhancement planned for hier_config v4.0.0