feat(network-policy): add network policies#720
Conversation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PR Titlefeat(network-policy): add network policies Summary of ChangesThis PR adds comprehensive support for network policies in the Runloop SDK, enabling users to control egress network traffic from devboxes. The implementation includes:
Network policies support:
The implementation follows existing SDK patterns, with resource classes structured identically to Blueprint and StorageObject classes. Review FindingsConventionsIssue Found and Fixed: Formatting inconsistency in list comprehensions
All other code follows repository conventions:
KISS PrincipleNo issues found The implementation is appropriately simple and follows established patterns:
Code DuplicationNo issues found While NetworkPolicy and AsyncNetworkPolicy share similar structure, this is intentional and follows the established pattern in the codebase:
Changes Made
The changes were committed and pushed with message: Review performed in Runloop Devbox |
🤖 PR Review Agent✅ Set up devbox environment
|
sid-rl
left a comment
There was a problem hiding this comment.
add SDKNetworkPolicyUpdateParams and fix network policy ids in tests
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PR Review ReportPR Titlefeat(network-policy): add network policies Summary of ChangesThis PR adds comprehensive support for network policies in the Runloop SDK, enabling users to control egress network traffic from devboxes. The implementation includes both synchronous and asynchronous NetworkPolicy resource classes, high-level NetworkPolicyOps managers, SDK integration, type definitions, and comprehensive test coverage. The feature allows users to create allow-lists of hostnames with wildcard support, enable/disable egress traffic, and control devbox-to-devbox communication via tunnels. Review FindingsConventionsNo issues found. The implementation follows existing patterns in the SDK perfectly:
KISS PrincipleNo issues found. The implementation is appropriately simple:
Code DuplicationNo issues found. While the sync and async implementations are similar (which is by design and consistent with the rest of the SDK), there is no inappropriate duplication:
Verification ResultsBuildN/A - Python project does not have a separate build step LintResult: PASSED (with one fix applied)
TestsResult: PASSED All tests passed successfully:
Test coverage includes:
Changes Made
SummaryThis PR is ready to merge. The implementation:
The only change required was a minor formatting fix to async_benchmark.py, which has been committed and pushed. Review performed in Runloop Devbox |
🤖 PR Review Agent✅ Set up devbox environment
|
…d rename test IDs - Use SDKNetworkPolicyUpdateParams in update methods for both sync and async NetworkPolicy classes - Rename network policy test IDs from npo_123 to np_123 across all test files - Update test expectations to match new parameter unpacking behavior Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PR Review ReportPR Titlefeat(network-policy): add network policies Summary of ChangesThis PR adds comprehensive support for network policies in the Runloop SDK, enabling users to control egress network traffic from devboxes. The implementation includes both synchronous and asynchronous NetworkPolicy resource classes, high-level NetworkPolicyOps managers, SDK integration, type definitions, and comprehensive test coverage. Network policies allow users to create allow-lists of hostnames with wildcard support, enable/disable egress traffic, and control devbox-to-devbox communication via tunnels. Review FindingsConventionsNo issues found. The implementation follows existing patterns in the SDK perfectly. All code follows proper Python conventions, uses appropriate type hints, and maintains consistency with other resource classes in the codebase. KISS PrincipleNo issues found. The implementation is appropriately simple and follows established patterns without over-engineering. Methods have single, clear purposes, and there's no unnecessary complexity or premature optimization. Code DuplicationNo issues found. While sync and async implementations share similar structure, this is intentional and consistent with the existing pattern in the codebase (Blueprint/AsyncBlueprint, StorageObject/AsyncStorageObject, etc.). Each implementation serves a distinct purpose and maintains proper separation of concerns. Reviewer Feedback AddressedAll reviewer feedback has been successfully addressed:
Verification ResultsBuildN/A - Python project does not have a separate build step. LintResult: ✅ PASSED All linting tools passed successfully:
TestsResult: ✅ PASSED All tests passed successfully:
All tests verify proper functionality including:
Changes Made
SummaryThis PR is ready to merge. All reviewer feedback has been addressed:
The implementation is clean, well-tested, and follows all established SDK patterns. Review performed in Runloop Devbox |
🤖 PR Review Agent❌ Set up devbox environment |
🤖 PR Review Agent✅ Set up devbox environment
Reviewer Comments to Address
|
🤖 PR Review Agent✅ Set up devbox environment
Reviewer Comments to Address
|
🤖 PR Review Agent✅ Set up devbox environment
Reviewer Comments to Address
|
This PR adds comprehensive support for network policies in the Runloop SDK, enabling users to control egress network traffic from devboxes.
What's Added
Implementation Details
Network policies allow users to:
The implementation follows existing patterns in the SDK, with resource classes matching the structure of Blueprint and StorageObject classes. The update methods use SDKNetworkPolicyUpdateParams for parameter unpacking, consistent with other SDK resource update methods.
Usage Example
Changes from Review Feedback
npo_123tonp_123for consistency with other resource naming conventions