Skip to content

fix: forward step_name through the _v1 Session.run_task wrapper - #345

Merged
seant-aws merged 2 commits into
OpenJobDescription:mainlinefrom
seant-aws:run-task-step-name
Aug 6, 2026
Merged

fix: forward step_name through the _v1 Session.run_task wrapper#345
seant-aws merged 2 commits into
OpenJobDescription:mainlinefrom
seant-aws:run-task-step-name

Conversation

@seant-aws

Copy link
Copy Markdown
Contributor

What was the problem/requirement? (What/Why)

The Rust binding's run_task accepts step_name and seeds RFC 0008's WrappedStep.Name from it, but the _v1 Python wrapper did not expose the kwarg. Callers could not supply a step name, so {{WrappedStep.Name}} always rendered as an empty string inside an onWrapTaskRun hook.

What was the solution? (How)

Add step_name: Optional[str] = None to the _v1 Session.run_task wrapper and forward it to the binding. Bump the openjd-model floor to 0.11.2 — the first release whose binding accepts the kwarg; on 0.11.1 the unconditional forward would raise TypeError on every run_task call.

What is the impact of this change?

_v1 callers can now pass the step name so wrap-action hooks resolve WrappedStep.Name correctly. No behavior change for callers that omit it (defaults to None, matching the binding's default of an empty name).

How was this change tested?

  • Have you run the unit tests? Yes — 924 passed / 39 skipped / 16 xfailed; ruff + black + mypy clean. Added test/openjd/sessions_v1/test_wrap_task_run.py verifying the wrapper plumbs the kwarg through against a real _v1 session. Full WrappedStep.Name resolution inside an onWrapTaskRun hook was additionally validated downstream via a differential runtime test in deadline-cloud-worker-agent using a wheel built from this branch.

Was this change documented?

Yes — the run_task internal comment documents the kwarg's RFC 0008 semantics.

Is this a breaking change?

No — a new optional keyword-only parameter with a None default.

Does this change impact security?

No — no new files, permissions, or process behavior.

Cross-port to openjd-rs

  • Cross-porting is not applicable for this change because: the Rust implementation already supports step_name (this change exposes existing Rust-side functionality through the Python _v1 wrapper).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The Rust binding's run_task accepts step_name and seeds RFC 0008's
WrappedStep.Name from it, but the _v1 Python wrapper did not expose the
kwarg, so callers could not supply a step name and the variable always
rendered as an empty string inside onWrapTaskRun hooks.

Add step_name to the wrapper signature and forward it to the binding.
Bump the openjd-model floor to 0.11.2, the first release whose binding
accepts the kwarg: on 0.11.1 the unconditional forward would raise
TypeError on every run_task call.

Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com>
@seant-aws
seant-aws requested a review from a team as a code owner August 5, 2026 22:30
Comment thread pyproject.toml
# only StepTemplate.let, StepScript.let and SymbolTable.expr_types, so this
# package fails at import against it.
"openjd-model >= 0.11.1,< 0.12",
"openjd-model >= 0.11.2,< 0.12",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The floor was bumped to 0.11.2, but the comment above still explains only why 0.11.1 was the floor ("0.11.1 is the floor because…"). Since run_task now forwards step_name to the Rust binding, 0.11.2 is presumably required because it is the first release whose Session.run_task accepts step_name / surfaces WrappedStep.Name. Worth adding a line documenting that so the rationale for the new floor is captured (otherwise a future reader could mistakenly relax it back to 0.11.1, which would break run_task(step_name=…) at runtime).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK since we're doing minor bumps.

Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com>
@seant-aws
seant-aws force-pushed the run-task-step-name branch from 7b9924b to fec81d8 Compare August 6, 2026 16:51
@seant-aws
seant-aws merged commit 9ca3a4a into OpenJobDescription:mainline Aug 6, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants