intersystems / intersystems/pyprod
XML special characters in setting values break production definition generation
- Dominant language
- Python
- Stars
- 10
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
- iris kit details: 'any — issue is in the Python code generator'
- operating system: 'any'
- python version: 'any'
- error message: 'IRIS compilation error on the generated production class due to invalid XML'
#### Steps to Reproduce:
1. Define a ServiceItem/ProcessItem/OperationItem with a setting value containing `&`, `<`, `>`, or `"`
2. Run the code generator
#### Minimal Example
```
from intersystems_pyprod import Production, ServiceItem
class MyProduction(Production):
services = [
ServiceItem(
"MyService",
"EnsLib.File.PassthroughService",
adapter_settings={
"FilePath": "/data/input&output",
},
)
]
```
#### Expected Behaviour
The value is XML-escaped (`&`) in the generated `` element.
#### Actual Behaviour
Raw `&` is interpolated, producing invalid XML that fails to compile on IRIS side.
#### Additional Information
Root cause: `_production_definition.py:_create_item_target_settings` uses f-string
interpolation with no escaping. Same applies to item attributes (name, comment, schedule)
in `_create_production_item`.
Related to #6 (same category of unescaped interpolation into generated code).
Contributor guide
Research direction
Start in _production_definition.py, especially _create_item_target_settings and _create_production_item, then reproduce the minimal ServiceItem example with special characters. Confirm that setting values and item attributes are safely represented in the generated XML and that the resulting production definition no longer fails IRIS compilation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100