Skip to content

refactor(socketforward): migrate from x/net/context to std context - #35

Open
janishorsts wants to merge 2 commits into
mainfrom
chore-context
Open

janishorsts wants to merge 2 commits into
mainfrom
chore-context

Conversation

@janishorsts

@janishorsts janishorsts commented Oct 1, 2026 •

Copy link
Copy Markdown

Earthly accidentally added the x/net/context (instead of the std context) import.

Summary by CodeRabbit

  • Compatibility
    • Updated socket forwarding to use Go’s standard context types. This may affect callers that explicitly use the former golang.org/x/net/context types.

@janishorsts janishorsts self-assigned this Oct 1, 2026
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 606795bc-04b5-4d19-9c15-1dfa1063971e

📥 Commits

Reviewing files that changed from the base of the PR and between ce8ce00 and ecee3b3.

📒 Files selected for processing (8)
  • session/socketforward/copy.go
  • session/socketforward/socket.go
  • vendor/golang.org/x/net/context/context.go
  • vendor/golang.org/x/net/context/go17.go
  • vendor/golang.org/x/net/context/go19.go
  • vendor/golang.org/x/net/context/pre_go17.go
  • vendor/golang.org/x/net/context/pre_go19.go
  • vendor/modules.txt
💤 Files with no reviewable changes (6)
  • vendor/modules.txt
  • vendor/golang.org/x/net/context/context.go
  • vendor/golang.org/x/net/context/pre_go19.go
  • vendor/golang.org/x/net/context/go19.go
  • vendor/golang.org/x/net/context/go17.go
  • vendor/golang.org/x/net/context/pre_go17.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The socketforward package now uses the standard-library context package for its context references and Copy API. The vendored golang.org/x/net/context implementation and its vendor manifest entry were removed.

Changes

Context migration

Layer / File(s) Summary
Use standard-library context
session/socketforward/copy.go, session/socketforward/socket.go
Both files now import the standard-library context package. Copy now accepts the standard-library context.Context type.
Remove vendored context package
vendor/golang.org/x/net/context/*, vendor/modules.txt
The vendored context implementations and the package entry in vendor/modules.txt were removed.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to ecee3

No supported build or context-propagation regression is established, so this change has no actionable merge-blocking risk.

Architecture Summary

Architecture risk: 🔵 Low · up to ecee3

The change affects 1 system.

Changed systems: session

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — session (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in session/socketforward/copy.go: The imports now use the standard library context package; the golang.org/x/net/context import was removed. Consequently, Copy uses the standard library context type.
  • observed — Modified behavior in session/socketforward/socket.go: Replaced the golang.org/x/net/context import with the standard-library context import; the other imports in this range remain unchanged.
  • observed — Modified behavior in vendor/golang.org/x/net/context/context.go: The deleted file defined the golang.org/x/net/context package, documented context propagation and usage rules, and exported Background() and TODO() functions returning the corresponding empty contexts.
  • observed — Modified behavior in vendor/golang.org/x/net/context/go17.go: The Go 1.7 build-tagged file was deleted, removing its standard-library-backed context error variables and wrappers for cancellation, deadlines, timeouts, and values.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: migrating socketforward from golang.org/x/net/context to the standard-library context package.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

➖ Are we earthbuild yet?

No change in "earthly" occurrences

📈 Overall Progress

Branch Total Count
main 217
This PR 217
Difference +0

Keep up the great work migrating from Earthly to Earthbuild! 🚀

💡 Tips for finding more occurrences

Run locally to see detailed breakdown:

./.github/scripts/count-earthly.sh

Note that the goal is not to reach 0.
There is anticipated to be at least some occurences of earthly in the source code due to backwards compatibility with config files and language constructs.

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