Testing Pull Requests with GitHub Codespaces
This guide walks you through testing new features and bug fixes from pull requests using GitHub Codespaces. No technical setup required—everything runs in your browser.
What is Codespaces?
Section titled “What is Codespaces?”GitHub Codespaces is a cloud-based development environment. Think of it as a complete computer running in your browser that’s already set up with everything needed to run the application. When you start a Codespace, GitHub automatically:
- Creates a virtual machine in the cloud
- Installs all the required software
- Starts the application for you
This means you can test changes without installing anything on your own computer.
What You’ll Need
Section titled “What You’ll Need”- A GitHub account (free to create at github.com)
- A modern web browser (Chrome, Firefox, Safari, or Edge)
- About 5-10 minutes for first-time setup
Step-by-Step: Starting a Codespace from a Pull Request
Section titled “Step-by-Step: Starting a Codespace from a Pull Request”Step 1: Navigate to the Pull Request
Section titled “Step 1: Navigate to the Pull Request”- Go to the Benefit Decision Toolkit repository on GitHub
- Click on the Pull requests tab near the top of the page (next to “Issues” and “Actions”)
- Find and click on the pull request you want to test
You should now see the pull request page with a title, description, and various tabs like “Conversation”, “Commits”, and “Files changed”.
Step 2: Open the Code Menu
Section titled “Step 2: Open the Code Menu”- Look for a green button labeled Code on the right side of the page
- This button is typically located above the file list or in the pull request header area
- Click the Code button
- A dropdown menu will appear with two tabs: Local and Codespaces
Step 3: Create the Codespace
Section titled “Step 3: Create the Codespace”- Click on the Codespaces tab in the dropdown
- You’ll see a button that says Create codespace on [branch-name]
- The branch name will match the pull request’s branch (shown in the dropdown)
- Click that button
A new browser tab will open and begin setting up your Codespace.
Waiting for Setup
Section titled “Waiting for Setup”After clicking to create your Codespace, you’ll see a loading screen. Here’s what to expect:
What You’ll See
Section titled “What You’ll See”- Initial loading: A dark screen with “Setting up your codespace” message
- Building: Progress messages about building the development environment
- Starting services: The environment installs dependencies and starts the application
How Long Does It Take?
Section titled “How Long Does It Take?”- First time: 3-5 minutes (the environment needs to be built from scratch)
- Subsequent times: 1-2 minutes (if you’ve used this Codespace before)
How to Know When It’s Ready
Section titled “How to Know When It’s Ready”The setup is complete when:
- You see an interface that looks like VS Code (a code editor) in your browser
- A terminal panel appears at the bottom of the screen
- The terminal shows services starting up with colored status indicators
- The browser pops up the frontend application in a new tab
Accessing the Application
Section titled “Accessing the Application”Once the Codespace is ready and services are running, you can access the application:
Step 0: You Might Already Be There
Section titled “Step 0: You Might Already Be There”If all went well during setup and you waited patiently for everything to spin up, then the browser should have automatically opened the frontend application.
If the frontend didn’t pop up for whatever reason, then proceed to step 1.
Step 1: Find the Ports Panel
Section titled “Step 1: Find the Ports Panel”- Look at the bottom of the VS Code interface
- Find the tab labeled Ports (next to “Terminal” and “Problems”)
- Click on Ports to open the ports panel
Step 2: Open the Application
Section titled “Step 2: Open the Application”- In the Ports panel, find the row showing port 5173 (this is the Frontend)
- You’ll see columns for Port, Local Address, and Running Process
- Look for a small globe icon in that row
- Hovering over it may show “Open in Browser”
- Click the globe icon
A new browser tab will open with the application.
Note: this will only work if there is already a Running Process listed for port 5173 (be patient).
Alternative Method
Section titled “Alternative Method”If you don’t see the globe icon:
- Right-click on the port 5173 row
- Select Open in Browser from the context menu
What URL to Expect
Section titled “What URL to Expect”The URL will look something like:
https://[random-name]-5173.app.github.devThis is your personal test instance of the application.
Browser Popup Blockers
Section titled “Browser Popup Blockers”If clicking the globe icon doesn’t open a new tab:
- Check if your browser blocked a popup
- Look for a popup blocker notification in your browser’s address bar
- Allow popups from
github.devdomains
Logging In to the Application
Section titled “Logging In to the Application”The application uses a test authentication system, so you don’t need any real accounts.
- On the application’s login page, click the Continue with Google
- A simple login window will pop-up (this is the Firebase Emulator, not real Google Firebase authentication)
- You can either:
- Click Add new account to create a fake google account
- If you’ve logged in previously with this codespace, pick an existing fake google account
- Click Sign in with Google.com.
Important Notes
Section titled “Important Notes”- This is a test environment—no real Google account is used
- Any data you create is isolated to this Codespace
- Your test data won’t affect anyone else and will be deleted when the Codespace is deleted
Testing the Feature
Section titled “Testing the Feature”Now you’re ready to test! Here are some tips:
- Review the pull request description for specific things to test
- Try the new feature as described in the pull request
- Test edge cases (unusual inputs, empty fields, etc.)
- Check for visual issues (layout problems, missing text, etc.)
- Document any issues you find by commenting on the pull request
When You’re Done Testing
Section titled “When You’re Done Testing”Simply Close the Tab
Section titled “Simply Close the Tab”When you’re finished testing, you can simply close the browser tab. The Codespace will automatically stop (shutdown) after 30 minutes of inactivity. The Codespace will remain available to start again for 30 days (by default).
Deleting the Codespace (Recommended when done testing)
Section titled “Deleting the Codespace (Recommended when done testing)”Deleting a Codespace will delete all data you’ve created during testing. You’ll want to do this to save storage costs paid by Code for Philly.
To clean up:
- Go to github.com/codespaces
- Find your Codespace in the list on the left and click to select it
- Click the three dots menu on the right side
- Select Delete
Troubleshooting
Section titled “Troubleshooting””Application not loading”
Section titled “”Application not loading””Symptoms: The browser shows a blank page or error after clicking the globe icon
Solutions:
- Wait a minute longer—services may still be starting
- Check the Terminal panel for error messages
- Try refreshing the application page
- In the terminal, type
devbox services listand press Enter to see a summary of which services are running (or not) - In the terminal, type
devbox services attachand press Enter to show the logs of the running services and look for errors
”Port not showing in the Ports panel”
Section titled “”Port not showing in the Ports panel””Symptoms: The Ports panel is empty or doesn’t show port 5173
Solutions:
- Click the refresh icon in the Ports panel header
- Wait for services to fully start (check the Terminal for progress)
- In the terminal, type
devbox services upand press Enter - In the terminal, type
devbox services attachand press Enter to show the logs of the running services and look for errors
”Services crashed or stopped”
Section titled “”Services crashed or stopped””Symptoms: The terminal shows errors or services have stopped
Solutions:
- In the terminal at the bottom of VS Code, type:
devbox services up
- Press Enter
- Wait for services to restart (you’ll see status messages)
“Codespace won’t start”
Section titled ““Codespace won’t start””Symptoms: Stuck on loading screen for more than 10 minutes
Solutions:
- Close the tab and try again
- Go to github.com/codespaces
- Delete the stuck Codespace
- Create a new one from the pull request
”I need to test a different pull request”
Section titled “”I need to test a different pull request””Each pull request needs its own Codespace. You can either:
- Delete your current Codespace and create a new one for the other PR
- Keep multiple Codespaces running (note: this uses more of your free tier hours)
Need More Help?
Section titled “Need More Help?”If you’re stuck:
- Ask in the pull request comments
- Reach out to the development team
- Check the project’s main README for additional resources