Skip to content

Conversation

@AshokThangavel
Copy link
Contributor

Support Recursive Placeholder Resolution in Module Parameter

Description

This PR introduces deeply nested variables or chained configuration settings where one ${variable} depends on another.
with a safety handle complex dependencies and prevent infinite loops in the case of circular references.

fixes: #1009

Changes

  • Recursive Logic: Updated ResolvePlaceholders to use a while loop that continues as long as substitutions are being made.
  • Efficiency: The loop exits immediately if a pass results in no changes, ensuring no performance penalty for simple configurations.

Testing Performed

  1. Unit Tests: Verified with complex nested strings:
  • ${A} -> ${B} -> ${C} -> FinalValue.
  1. Integration Test: Added a new integration test class Test.PM.Integration.Module that:
  • Generates a module.xml from XData.
  • Writes it to the filesystem.
  • Executes an IPM load command to verify the full lifecycle of the variable resolution.

Test Execution Results: Test.PM.Integration.Module

Counter Action Status Description
1 LogMessage passed start Loading the demo-module1 module
2 AssertStatusOK passed Directory created /home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/varresolver/
3 AssertStatusOK passed module.xml File created on /home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/varresolver/
4 AssertStatusOK passed Created the xml file on /home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/varresolver/
5 AssertStatusOK passed Loaded varresolver module successfully from /home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/varresolver/
6 AssertTrue passed Module demo-module1 exists in IPM and version is 1.0.0
7 LogMessage passed List all modules
8 AssertStatusOK passed uninstalled module demo-module1 successfully.
9 AssertStatusOK passed Deleted the module.xml file from /home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/varresolver/
10 LogMessage passed Duration of execution: 1.193466 sec.

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.

Allow ${variables} in Default parameters

1 participant