Overview
Instead of shutting down the devbox after pushing a branch and recreating a fresh environment every time you get feedback, you can use Runloop’s suspend and resume functionality to preserve the devbox’s disk state. This allows you to respond to code review comments and make incremental changes without losing your in-progress work.1
Push branch and create a pull request
Push your branch to the remote repository and create a pull request for review.
2
Suspend the devbox
Suspend the devbox to save the disk state while stopping compute costs. The devbox can be resumed later to continue working.
3
Wait for PR comment and process feedback
Wait for a comment on your pull request. When a comment is received, call a function to resume the devbox and process the feedback. In a production workflow, you would typically use GitHub webhooks (or at least a more robust polling loop) to detect when a comment is added; for simplicity, this example checks for comments manually in a loop.
For production use, prefer GitHub webhooks together with a GitHub App to receive PR comment events and trigger your workflow, instead of relying on a long-running polling loop as shown here.
4
Define the feedback processing function
Define the function that resumes the devbox and processes the PR feedback. This function handles resuming the devbox, recreating the shell, making changes based on feedback, and pushing updates.
You can repeat the suspend/resume cycle as many times as needed to iterate on PR feedback. The devbox preserves all your work between sessions, making it easy to pick up where you left off.
Next Steps
- Learn how to share a live preview of your changes in pull requests
- Explore devbox lifecycle management for more details on suspend and resume
