Accessing Preview Environments #
This guide shows you how to find and access your Preview Environment after it’s been created.
Finding the Preview URL #
There are three ways to access your Preview Environment:
Method 1: PR Comments (Easiest) #
- Navigate to your Pull Request on GitHub
- Scroll to the comments section
- Look for the automated comment from “github-actions” bot:
๐ Preview environment created!
| Resource | URL |
|----------|-----|
| ๐ Application | [Open Preview](https://app--dev--coder-preview-123--john.coder.internal.gotofu.com/) |
Workspace: coder-preview-123
- Click the “Open Preview” link
Method 2: PR Description #
- Go to your Pull Request
- Look at the PR description (top of the page)
- You’ll see a section like this:
## ๐ Preview Environment
Your preview environment is ready!
| Resource | URL |
| -------------- | -------------------------------------------------------------------- |
| ๐ Application | https://app--dev--coder-preview-123--john.coder.internal.gotofu.com/ |
Workspace: coder-preview-123
๐ก Note: This environment will be automatically updated when you push new commits,
and deleted when the PR is closed.
Method 3: Coder Dashboard #
- Go to Coder Workspaces
- Find your workspace named
coder-preview-{PR-number} - Click on it to open the workspace page
- Look for the “Apps” section
- Click on the “app” link
Understanding the URL Structure #
Preview Environment URLs follow this format:
https://app--dev--{workspace-name}--{owner}.coder.internal.gotofu.com/
Components:
app- The application subdomain (main BonsAI app)dev- The Coder template being used{workspace-name}- Your workspace name (e.g.,coder-preview-123){owner}- The Coder username who owns the workspacecoder.internal.gotofu.com- Coder domain
Example:
https://app--dev--coder-preview-123--john.coder.internal.gotofu.com/
Available Services #
Each Preview Environment exposes multiple services:
Main Application #
- URL Pattern:
https://app--dev--{workspace}--{owner}.coder.internal.gotofu.com/ - Description: The main BonsAI web application
- Port: 9000 (proxied through Nginx)
- Use For: Testing frontend features, user workflows
Swagger Editor #
- URL Pattern:
https://swagger-editor--dev--{workspace}--{owner}.coder.internal.gotofu.com/ - Description: Interactive API specification editor
- Port: 8000
- Use For: Editing and testing OpenAPI specifications
Internal API Documentation #
- URL Pattern:
https://swagger-internal--dev--{workspace}--{owner}.coder.internal.gotofu.com/ - Description: Internal API documentation (Swagger UI)
- Port: 8001
- Use For: Viewing API endpoints and testing API calls
CloudBeaver (Database Management) #
- Access Via: Coder workspace apps section
- Description: Web-based database management tool
- Port: 8978
- Use For: Inspecting database state, running queries
Portainer (Docker Management) #
- Access Via: Coder workspace apps section
- Description: Docker container management interface
- Port: 9443
- Use For: Viewing container logs, restarting services
Authentication #
First-Time Access #
When you first access the Preview Environment:
- You’ll be redirected to the authentication page
- Sign in with your BonsAI credentials
- You’ll be automatically redirected back to the application
- Your session will be maintained for subsequent visits
Session Management #
- Session Duration: 24 hours
- Re-authentication: Required after session expires
- Shared Access: Each user must authenticate separately
Sharing with Team Members #
For Developers and QA #
Team members can access the Preview Environment using the same URL:
- Share the preview URL from the PR comments or description
- Recipients must authenticate with their own credentials
- All users see the same environment and data
Example Message:
Hi team! Please test my new feature in this preview environment:
https://app--dev--coder-preview-123--john.coder.internal.gotofu.com/
Focus areas:
- Invoice processing workflow
- Xero integration sync
Let me know if you find any issues!
For External Stakeholders (Customers, Partners) #
โ ๏ธ Note: Preview environments are internal only. For external demos:
- Create a test account in the preview environment
- Record a demo video or screenshots
- Alternatively, use the staging environment for external demos
Testing Different Scenarios #
As a Regular User #
- Access the main application URL
- Sign in with your test account
- Navigate through the features being tested
- Verify functionality works as expected
As a Developer (API Testing) #
- Access the Internal API Documentation URL
- Use the Swagger UI to test API endpoints
- Check request/response payloads
- Verify authentication and authorization
As a QA Engineer #
Frontend Testing:
- Access the main application
- Test user workflows end-to-end
- Verify UI/UX changes
- Check different screen sizes and browsers
Backend Testing:
- Use Swagger UI for API testing
- Access CloudBeaver for database inspection
- Check background job processing
- Verify integration behavior
Integration Testing:
- Configure integrations (see Integration Setup)
- Test data sync workflows
- Verify external service connections
- Check error handling
Browser Considerations #
Supported Browsers #
Preview Environments work best with:
- โ Chrome (recommended)
- โ Firefox
- โ Safari
- โ Edge
Browser Settings #
SSL/TLS Certificates:
- The preview environment uses valid SSL certificates
- No need to accept security warnings
Cookies:
- Ensure cookies are enabled for authentication
- Session cookies are required
JavaScript:
- Must be enabled
- The application won’t work without it
Accessing Workspace Terminal #
For advanced debugging, you can access the workspace terminal:
Via Coder Web Terminal #
- Go to Coder Workspaces
- Find your workspace (
coder-preview-{PR-number}) - Click on the workspace name
- Click “Terminal” in the top navigation
- You now have shell access to the environment
Via SSH (Advanced) #
If you prefer SSH access:
- Go to your Coder workspace page
- Click “Connect via SSH” in the workspace details
- Copy the SSH command
- Run it in your local terminal
Example:
ssh coder.coder-preview-123
Common Terminal Commands #
Once in the terminal:
# Check service status
cd ~/bonsai
docker compose -f docker-compose.preview.yml ps
# View service logs
docker compose -f docker-compose.preview.yml logs -f bonsapi
# Restart a service
docker compose -f docker-compose.preview.yml restart webapp
# Run database migrations
mise run db-migrate
# Access database shell
psql $DATABASE_URL
Mobile Testing #
While Preview Environments are optimized for desktop testing:
Option 1: Responsive Mode #
- Open Chrome DevTools (F12)
- Click the device toggle icon
- Select a mobile device preset
- Test responsive behavior
Option 2: Actual Device Testing #
- Ensure your mobile device is on the same network
- Access the preview URL on your mobile browser
- Sign in with your credentials
- Test mobile-specific features
โ ๏ธ Note: Mobile devices must have network access to *.coder.internal.gotofu.com. This typically requires VPN access for remote devices.
Environment Information #
How to Find Environment Details #
Workspace Name:
- Look in PR comments or description
- Format:
coder-preview-{PR-number}
Build Version:
- Check the GitHub Actions run number
- View commit SHA in the PR
Runtime Info:
- Instance type: t3.2xlarge
- Memory: 32 GB
- CPU: 8 vCPUs
- Storage: 500 GB
Checking Service Health #
Use the Coder workspace terminal:
# Check all services
docker compose -f docker-compose.preview.yml ps
# Check individual service health
docker inspect --format='{{.State.Health.Status}}' bonsapi
# View resource usage
docker stats
Limitations and Considerations #
Performance #
- Preview environments run on t3.2xlarge instances
- May be slower during builds or heavy operations
Data Isolation #
- Each preview has its own database
- Data is NOT shared between previews or with production
- Data persists during updates but is deleted when PR closes
External Services #
- Integration credentials need manual configuration
- OAuth redirects must be updated for preview URL
- See Integration Setup for details
Concurrent Users #
- Multiple users can access simultaneously
- Recommended max: 5 concurrent users
- Performance may degrade with heavy concurrent usage
Next Steps #
- Setting Up Integrations - Connect external services
- Troubleshooting - Resolve common issues
- Cleaning Up - What happens when PR closes