Skip to content

Refine batch failure handling#3

Closed
dnagoda wants to merge 1 commit into
dc.batch-2-preserve-json-orderfrom
dc.batch-3-failure-handling
Closed

Refine batch failure handling#3
dnagoda wants to merge 1 commit into
dc.batch-2-preserve-json-orderfrom
dc.batch-3-failure-handling

Conversation

@dnagoda

@dnagoda dnagoda commented Jul 2, 2026

Copy link
Copy Markdown
Owner

📚 Stack (bottom → top)

  1. Add batch mode for processing multiple inputs via JSONL #1 Add batch mode for processing multiple inputs via JSONL
  2. Preserve JSON input object order #2 Preserve JSON input object order
  3. Refine batch failure handling #3 Refine batch failure handling
  4. Reuse the compiled provider across runs #4 Reuse the compiled provider across runs
  5. Compute humanized bytes lazily #5 Compute humanized bytes lazily
  6. Add minimal batch output with --batch-full-output opt-in #6 Add minimal batch output with --batch-full-output opt-in

Stacked draft PRs on the fork; review bottom-up. Merge target is Shopify/function-runner once upstream write access is available.


Why

The initial batch mode counted every run that returned Ok as a success — even
when the function itself returned success: false — so batch summaries were
wrong.

What

  • Keep --batch-continue-on-error (opt-in; batch stops on the first error by
    default
    ). No new flag.
  • Count real successes/failures from FunctionRunResult.success; track
    processed / successful / failed.
  • Treat a function-level failure (success: false) like an error: it stops the
    batch by default, and is recorded-but-skipped under --batch-continue-on-error.
  • The stderr summary reports processed, successful, and failed counts.
  • Switch integration tests to assert_cmd::cargo::cargo_bin! (the
    non-deprecated API) in place of Command::cargo_bin.

Testing

  • cargo test batch_
  • cargo test

Keep --batch-continue-on-error (opt-in; batch stops on the first error by
default) but fix the success/failure accounting. Previously every run that
returned Ok was counted as a success, even when the function itself returned
success: false.

Now batch mode tracks processed/successful/failed counts from
FunctionRunResult.success, and a function-level failure is treated like an
error: it stops the batch by default and is skipped (still recorded) under
--batch-continue-on-error. The stderr summary reports processed, successful,
and failed counts.

Add integration coverage for default stop-on-failure behavior and for
--batch-continue-on-error processing every row with accurate counts. Also
switch integration tests to assert_cmd::cargo::cargo_bin! instead of the
deprecated Command::cargo_bin helper.

Verified with:
- cargo test batch_
- cargo test

Assisted-By: devx/c659e918-9568-4750-b122-e3890447348a
@dnagoda dnagoda force-pushed the dc.batch-3-failure-handling branch from 0ecdade to 388e7a4 Compare July 2, 2026 21:51
@dnagoda

dnagoda commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Moved upstream to Shopify#591 now that write access is available. Closing this fork PR.

@dnagoda dnagoda closed this Jul 6, 2026
@dnagoda dnagoda deleted the dc.batch-3-failure-handling branch July 6, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant