-
Notifications
You must be signed in to change notification settings - Fork 174
Fix type mismatch error in property substitution #4814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… }}` was returning string instead of the correct type ([microsoft#4813](microsoft#4813))
Unit Test Results669 tests 669 ✅ 7s ⏱️ Results for commit d7f6117. ♻️ This comment has been updated with latest results. |
…JC-wk/AzureTRE into fix-property-substitution-types
marrobi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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 PR fixes a type mismatch error where property substitution in pipeline templates was converting boolean and integer values to strings instead of preserving their original types. This resolves an issue where substituting parent resource properties like {{ resource.parent.properties.enable_backup }} would return "True" (string) instead of True (boolean), causing validation errors.
Changes:
- Modified substitution logic to preserve primitive types (bool, int, etc.) when the entire value is a single substitution token
- Added comprehensive tests for boolean, integer, and string concatenation scenarios
- Enhanced documentation with parent resource property access examples and reference table
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| api_app/service_bus/substitutions.py | Added type preservation logic: returns original type when value is exactly one token, otherwise falls back to string concatenation |
| api_app/tests_ma/test_service_bus/test_substitutions.py | Added tests verifying boolean and integer type preservation, plus string concatenation fallback |
| docs/tre-templates/pipeline-templates/pipeline-schema.md | Added parent resource property access documentation with table showing available references for each resource type |
| docs/tre-workspace-authors/authoring-workspace-templates.md | Added reference to pipeline schema documentation and minor fix to mention both install and uninstall pipelines |
| api_app/_version.py | Incremented API version from 0.25.10 to 0.25.11 (PATCH version for bug fix) |
| CHANGELOG.md | Added bug fix entry referencing issue #4813 |
Resolves #4813 #4284
What is being addressed
Substituted properties will now retain their types unless they are part of a longer string see the issue for more detail
How is this addressed