Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Expression Language §2.2.6 defines repr_py as following Python's repr, so a
# control character in the value must be escaped in the emitted literal.
#
# repr_py("a\nb") is handed to ast.literal_eval, CPython's own parser, and the
# result compared to the input. Paired with
# WRAP_ACTIONS/jobs/wrap-repr-py-escapes-newline-in-wrapped-args, which pins the
# same rule through RFC 0008's forwarding pattern.
#
# The round-trip must print NEWLINE:PASS. A repr that quotes without escaping
# emits a raw newline, and CPython raises SyntaxError before the comparison runs.
# The failure marker is split across two literals because Windows echoes the
# child command line into the output the harness scans for forbidden strings.
template:
specificationVersion: jobtemplate-2023-09
extensions:
- EXPR
name: TestJob
steps:
- name: Step1
let:
- 'q = repr_py("a\nb")'
script:
actions:
onRun:
command: python
args:
- -c
- |
import ast
import sys
got = ast.literal_eval(sys.argv[1])
print("NEWLINE:" + ("PASS" if got == "a\nb" else "FA" "IL got=" + repr(got)))
- "{{ q }}"
expected:
output:
- NEWLINE:PASS
forbidden:
- FAIL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quorum verdict: GOOD-WITH-NITS (4 reviewers flagged variants of the same two issues) — spec: EL §2.2.6 repr_py (newline must be escaped — spec gives the exact worked example) via RFC 0008 WrappedAction.Args forwarding.

(1) Spec self-tension, correctly disclosed but under-weighted: the fixture's own onRun args contain a literal U+000A, which §5.2's ArgString Cc-exclusion arguably forbids — as written the template may be spec-invalid, so promotion is contingent on resolving §5.2 vs the multi-line python -c convention (which the Deadline Docker container env also relies on; if §5.2 is enforced, that breaks service-wide). Resolve the spec question first.
(2) Attribution: README says "implementation bug (openjd-rs)" but the 2026-08-12 sweep shows it fails BOTH implementations — state Python's status.
(3) Partial overlap with PR #165's expr2.2.6--repr-py-newline-roundtrip (same root defect); the end-to-end wrap path justifies keeping both, but cross-reference them.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Expression Language §2.2.6 defines repr_py as following Python's repr, and RFC
# 0008's reference forwarding pattern round-trips WrappedAction.Args through it.
#
# The wrapped action's arg is a two-line python -c program, the suite's own
# portable-fixture convention. All three hooks forward it. Paired with
# EXPR/jobs/expr2.2.6--repr-py-newline-roundtrip, which pins the same rule
# without the forwarding layer.
#
# The grand-child must run and print GRAND_CHILD_RAN. A repr that quotes without
# escaping embeds the newline raw, and the generated program dies with
# SyntaxError before reaching subprocess.run.
template:
specificationVersion: jobtemplate-2023-09
name: WrapReprPyEscapesNewlineInWrappedArgs
steps:
- name: Step1
script:
actions:
onRun:
command: python
args:
- "-c"
- "import sys\nprint('GRAND_CHILD_RAN')"
environments:
- specificationVersion: environment-2023-09
extensions:
- WRAP_ACTIONS
- EXPR
environment:
name: WrapEnv
script:
actions:
onWrapEnvEnter:
command: python
args:
- "-c"
- "import subprocess,sys; sys.exit(subprocess.run([{{repr_py(WrappedAction.Command)}}]+{{repr_py(WrappedAction.Args)}}).returncode)"
onWrapTaskRun:
command: python
args:
- "-c"
- "import subprocess,sys; sys.exit(subprocess.run([{{repr_py(WrappedAction.Command)}}]+{{repr_py(WrappedAction.Args)}}).returncode)"
onWrapEnvExit:
command: python
args:
- "-c"
- "import subprocess,sys; sys.exit(subprocess.run([{{repr_py(WrappedAction.Command)}}]+{{repr_py(WrappedAction.Args)}}).returncode)"
expected:
output:
- GRAND_CHILD_RAN
Loading