Repository navigation
fix(#74): align runner expression functions with Actions - #143
fullsend-ai-coder[bot] wants to merge 3 commits into
Conversation
The emulator runner finishes expressions the server defers beside a runner-only value. A few functions there still differed from Actions and from the server's evaluator. - Runner: contains, startsWith and endsWith compare strings case-insensitively; contains over an array matches items with Actions' loose equality (_loose_equal), as the server does. - Runner: parse object filters (.* and [*]) with the server's element-wise semantics; a bare filter or index path goes through the parser. - Server: _json_literal escapes braces inside the encoded JSON strings directly instead of swapping them for U+FDD0/U+FDD1, which turned those characters (and their escape text) into braces. - Server: build_job_graph refuses a job whose step uses: holds an expression, as GitHub rejects such a workflow. The reference is neither rendered nor named in the refusal. Tests in tests/actions/test_render_github_parity.py render each case on the server with a runner-only operand, finish it on the emulator runner and compare with Actions' value. Ledger entry added under docs/bugs/fixed/ and indexed in PLAN.md. Verification: ruff 0.17.3 and the pre-commit-hooks checks were run directly on the changed files (pre-commit could not fetch hook repos in the sandbox); all passed. Full suite: 1632 passed, 2 failed; both failures (test_runner_shutdown shutdown signal, and security headers needing a built frontend/dist) fail identically on main in this sandbox. Closes #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 11:12 PM UTC · Completed 11:18 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.42 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
🤖 Finished Fix · ✅ Success · Started 11:21 PM UTC · Completed 11:44 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.81 |
…zation
Reusable-workflow materialization substitutes inputs into step uses:
before build_job_graph runs, so an input-based reference such as
actions/checkout@${{ inputs.ref }} lost its expression and the job
ran. Record the steps holding an expression before substitution and
have build_job_graph refuse on that record too.
Note: pre-commit could not fetch hook repositories in the sandbox and
ruff is not installed, so hooks were not run. Full suite: 3 failures,
none from this change (test_composite_env fails identically without it;
test_runner_shutdown and test_security_headers are environmental).
Addresses #143
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (bot-triggered)Addressed the single review finding (expression uses: lost during reusable-workflow materialization) in the earlier commit, and this run fixed the ruff import-block spacing in tests/actions/test_workflow_call_fidelity.py that blocked the pre-commit gate. Full test suite had 3 failures unrelated to this change (test_composite_env, test_runner_shutdown, test_security_headers). Fixed (1):
Tests: passed Decision points
Finding threads:
Next steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 11:47 PM UTC · Completed 11:53 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.03 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk change aligning runner expression functions with GitHub Actions across 7 files and 373 lines, with clear issue scope and no protected paths, but modifying existing workflow services without feature flag gating. |
|
Looks good to me |
Superseded by updated review
Summary
Since #35, an expression that reads a runner-only value (
github.workspace,github.token,job.status...) is left for the runner. The emulator runner then evaluates the whole expression itself. This PR closes the remaining gaps between that evaluator, the server's evaluator and Actions.Emulator runner (
src/runners/emulator/runner.py)contains,startsWithandendsWithnow compare strings case-insensitively.containsover an array matches items with Actions' loose equality (_loose_equal), so1matches'1'andnullmatches''. An object contains nothing. Example:${{ github.workspace && contains('ABC', 'a') }}now renderstrue, as on GitHub..*and[*]). An accessor after a filter applies to each element and keeps the elements that have the property (even when it is null), as on the server. The name token no longer swallows a trailing dot. A bare filter or index path (${{ steps.x.outputs.* }}) now goes through the parser instead of the dotted-path lookup.Server (
src/app/services/workflow_expressions.py,workflow_service.py)_json_literalnow escapes braces inside the encoded JSON strings directly, instead of swapping them for U+FDD0/U+FDD1 while encoding. Before, a value that already held one of those characters, or the plain text�, came back as a brace.build_job_graphnow refuses a job when any step'suses:contains${{. GitHub rejects such a workflow. This follows the existing container/services refusal: one failing step with an::error::annotation. The reference is never rendered, and the message gives only the step numbers, so nothing from it (such as a deferred${{ github.token }}) is evaluated or logged.Ledger:
docs/bugs/fixed/emulator-runner-expression-functions-differ-from-actions.md, indexed inPLAN.md.Testing
New tests in
tests/actions/test_render_github_parity.py. Each one renders on the server with a runner-only operand, finishes on the emulator runner, and compares with the value Actions gives:contains('ABC', 'a'),startsWith('ABC', 'ab'),endsWith('ABC', 'bc')and server-bound strings: true on both the server and the runner.[1, "Two", true, null]..*.name,[*].name,contains(... .*.name, 'C'), baresteps.x.outputs.*) on a step output only the runner resolves.}}with${{ github.token }}round-trip unchanged, both deferred and as server-resolved text.uses:refuses the job. The refusal fails, and its output contains neither the reference nor the job token.All six new tests fail on
mainexcept the control testtest_a_step_uses_without_an_expression_is_kept.ruff check(v0.17.3) and the pre-commit-hooks checks pass on the changed files. They were run directly becausepre-commitcould not fetch hook repositories in the sandbox. Full suite: 1632 passed, 2 failed. Both failures fail the same way onmainin the sandbox:test_runner_shutdown(the step does not stop on the shutdown signal) andtest_security_headers(it needs a builtsrc/frontend/dist).Notes
steps.*without a runner-only operand (for example${{ toJSON(steps.x.outputs.y) }}inenv:) is still evaluated on the server, wherestepsis empty. That predates this issue and is not changed here.uses:holds an expression are not checked. The issue covers workflow steps.🤖 Generated with Claude Code
Closes #74
Post-script verification
agent/74-runner-expression-functions)fdad287855ddb6f1e85a045e407b1f09948ade1c..HEAD)