Skip to content

Add nil-element validation for chunks in ExecutionResult and Payload - #8689

Merged
zhangchiqing merged 1 commit into
leo/nil-validation-timeout-certificatefrom
leo/nil-validation-execution-result-payload
Sep 23, 2026
Merged

zhangchiqing merged 1 commit into
leo/nil-validation-timeout-certificatefrom
leo/nil-validation-execution-result-payload

Conversation

@zhangchiqing

@zhangchiqing zhangchiqing commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Add nil-element validation for the [Chunks] slice in [ExecutionResult] and nested chunk validation in [Payload]. Rejects CBOR-decoded null elements in chunk lists before they become trusted model objects.

This PR depends on #8688. It is part of a PR stack that splits up #8668.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • Invalid execution data containing nil chunks is now rejected with a clear validation error.
    • Payload creation also reports the location of nil chunks within execution results.
  • Tests

    • Added coverage to verify nil chunks are consistently rejected when creating execution results and payloads.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d6ab1155-2dfc-4c7c-b8f6-e461945207dc

📥 Commits

Reviewing files that changed from the base of the PR and between 28cb04c and e46fddf.

📒 Files selected for processing (4)
  • model/flow/execution_result.go
  • model/flow/execution_result_test.go
  • model/flow/payload.go
  • model/flow/payload_test.go

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The execution result and payload constructors now reject nil chunk elements. Tests cover both validation paths and their indexed error messages.

Changes

Nil chunk validation

Layer / File(s) Summary
Constructor validation and tests
model/flow/execution_result.go, model/flow/payload.go, model/flow/execution_result_test.go, model/flow/payload_test.go
NewExecutionResult and NewPayload reject nil chunk elements with indexed errors. Tests verify nil results and the reported error messages.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 3dfe3

This change only rejects malformed inputs that contain empty chunk entries when building execution results and block payloads, returning a clear error instead of accepting them. Valid data behaves exactly as before and both rejection paths are covered by tests, so there is no notable merge risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding nil-element validation for chunks in both ExecutionResult and Payload.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch leo/nil-validation-execution-result-payload

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-execution-result-payload branch from 0d1ea68 to 9997d08 Compare September 15, 2026 19:19
@zhangchiqing
zhangchiqing removed this pull request from stack #8691 September 15, 2026 19:26
@zhangchiqing
zhangchiqing added this pull request to stack #8700 September 15, 2026 19:28
@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-execution-result-payload branch from 9997d08 to e46fddf Compare September 15, 2026 19:28
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-execution-result-payload branch from e46fddf to 29bc37c Compare September 15, 2026 20:43
@blacksmith-sh

This comment has been minimized.

@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-execution-result-payload branch from 29bc37c to 3dfe322 Compare September 16, 2026 00:40
@zhangchiqing
zhangchiqing added this pull request to the merge queue Sep 23, 2026
Merged via the queue into master with commit cad7282 Sep 23, 2026
62 checks passed
@zhangchiqing
zhangchiqing deleted the leo/nil-validation-execution-result-payload branch September 23, 2026 22:51
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.

4 participants