feat(interp): support context-aware function bridges#138
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe function bridge treats an exact first ChangesContext-aware function marshaling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GoCaller
participant GoWrapper
participant Interpreter
participant VMFunction
GoCaller->>GoWrapper: call with optional context
GoWrapper->>Interpreter: invoke with context or context.Background()
Interpreter->>VMFunction: execute VM function
VMFunction-->>Interpreter: return result or cancellation
Interpreter-->>GoWrapper: return execution result
GoWrapper-->>GoCaller: return Go value or error
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.44.1)interp/threaded.goast-grep timed out on this file Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@interp/interp_test.go`:
- Around line 2448-2467: Check and assert the error returned by setup.Close() in
the “function receives active context” test, and apply the same handling to the
other setup.Close() call at the referenced location. Use the test’s existing
require-based error assertion style.
- Around line 2588-2609: Update the context.WithValue call in the “VM function
context identity” test to use the file’s existing contextKey type instead of an
anonymous struct{} key, preserving the current context value and identity
assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 908096b4-780b-42a7-856e-526ab8e705ca
📒 Files selected for processing (4)
docs/host-integration.mdinterp/interp.gointerp/interp_test.gointerp/marshal.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
===========================================
- Coverage 59.39% 27.61% -31.79%
===========================================
Files 82 82
Lines 54215 59959 +5744
===========================================
- Hits 32200 16555 -15645
- Misses 13029 42252 +29223
+ Partials 8986 1152 -7834 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Changes Made
context.Contextas host-only in marshaled Go functions and exported host-object methods.Related Issues
Additional Information
Validated with:
go vet ./interpgo test -count=1 -race -run '^TestInterpreter_(Marshal|Unmarshal)$' ./interp\n-go test -count=1 -race ./interp\n-go test -count=1 -race ./...Summary by CodeRabbit
context.Background().context.Contextparameter is treated specially; other positions are passed through normally.context.Contextbehavior.