Skip to content

Enhanced iRule Reference Discovery #57

@DumpySquare

Description

@DumpySquare

Summary

Implement comprehensive discovery of object references within iRules. This is critical for accurate app extraction - iRules often reference other objects that need to be included when migrating configurations.

Current State

We have partial implementations that are tested but not integrated into the main extraction flow:

  • poolsInRule() - discovers pool references in iRules (in src/pools.ts)
  • digDataGroupsiniRule() - discovers data-group references (in src/digiRules.ts)

These need to be hooked into digVsConfig() in src/digConfigs.ts similar to how poolsInPolicy() is used for Local Traffic Policies.

Proposed Enhancements

Reference Type iRule Example Priority
Pools pool /Common/my_pool High - have code
Data-groups class match [class lookup...] High - have code
Nodes node 10.1.1.1 80 Medium
Virtual servers virtual /Common/other_vs Medium
Other iRules call /Common/lib_rule Medium
iFiles ifile get /Common/myfile Medium
Profiles Less common in iRules Low

Implementation Notes

  • iRule parsing is complex due to TCL syntax
  • Need to handle commented-out references (lines starting with #)
  • Variable-based references (e.g., pool $poolVar) are harder to track
  • Consider searching iRules for known object names rather than regex pattern matching

Related Code

  • src/pools.ts - poolsInRule(), poolsInPolicy()
  • src/digiRules.ts - digDataGroupsiniRule()
  • src/digConfigs.ts - main extraction logic, lines 143-155 handle iRules
  • tests/025_pools.tests.ts - existing tests for pool/data-group discovery

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions