MohammadHijjawi97 opened a new pull request, #73864:
URL: https://github.com/apache/airflow/pull/73864
`JenkinsJobTriggerOperator` documents string `parameters` as JSON. It also
lists `.json` in `template_ext`, and the system example suggests passing a JSON
file. But the string is parsed with `ast.literal_eval`. Any JSON document
containing `true`, `false` or `null`, for example a boolean build parameter
such as `{"DRY_RUN": true}`, therefore fails with `ValueError: malformed node
or string` before the build is triggered.
This PR parses string parameters with `json.loads` first and falls back to
`ast.literal_eval`. Strings in Python-literal form, such as a dict rendered by
Jinja as `{'key': 'value'}`, keep working as before.
Tests: added a parametrized test for a JSON string with booleans and for a
Python-literal string. `pytest
providers/jenkins/tests/unit/jenkins/operators/test_jenkins_job_trigger.py`: 21
passed; the JSON case fails without the change. `ruff format` / `ruff check`
are clean.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
I used an AI coding assistant (Claude Code) while writing the fix and tests;
I reviewed the changes and ran the checks listed above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]