|
| 1 | +# Workshop Troubleshooting Guide |
| 2 | + |
| 3 | +## Quick Fix for GitHub Actions Failures |
| 4 | + |
| 5 | +If your GitHub Actions validation is failing for any workshop step, use the troubleshooting prompt to automatically diagnose and fix the issue. |
| 6 | + |
| 7 | +### How to Use |
| 8 | + |
| 9 | +1. **Open GitHub Copilot Chat** in VS Code |
| 10 | +2. **Select "Agent" mode** from the dropdown (not "Ask" or "Edit") |
| 11 | +3. **Run the fix command** with your step number: |
| 12 | + |
| 13 | +```prompt |
| 14 | +/fix-step 2 |
| 15 | +``` |
| 16 | + |
| 17 | +Replace `2` with the step number you're stuck on (2, 3, 4, or 5). |
| 18 | + |
| 19 | +### Available Commands |
| 20 | + |
| 21 | +- `/fix-step 2` - Fix Step 2: Application Initial Setup (requirements.txt) |
| 22 | +- `/fix-step 3` - Fix Step 3: Django Project Setup (settings.py, populate_db.py) |
| 23 | +- `/fix-step 4` - Fix Step 4: Django REST Framework (codespace URLs) |
| 24 | +- `/fix-step 5` - Fix Step 5: React Frontend (component API endpoints) |
| 25 | + |
| 26 | +### What the Prompt Does |
| 27 | + |
| 28 | +The troubleshooting prompt will automatically: |
| 29 | + |
| 30 | +1. **Diagnose** - Check what files exist and what's missing |
| 31 | +2. **Compare** - Verify file contents against GitHub Actions requirements |
| 32 | +3. **Fix** - Create or update files to meet validation criteria |
| 33 | +4. **Verify** - Confirm all checks will pass |
| 34 | +5. **Report** - Tell you what was wrong and what was fixed |
| 35 | + |
| 36 | +### Common Issues by Step |
| 37 | + |
| 38 | +#### Step 2 Issues |
| 39 | +- ❌ `requirements.txt` missing or in wrong location |
| 40 | +- ❌ `Django==4.1` not in requirements.txt |
| 41 | +- ✅ **Fix**: Creates file with all required packages |
| 42 | + |
| 43 | +#### Step 3 Issues |
| 44 | +- ❌ Django project not created in correct directory |
| 45 | +- ❌ `settings.py` missing MongoDB configuration |
| 46 | +- ❌ `populate_db.py` management command doesn't exist |
| 47 | +- ✅ **Fix**: Creates Django project, configures MongoDB, adds data population script |
| 48 | + |
| 49 | +#### Step 4 Issues |
| 50 | +- ❌ Codespace URL not in `settings.py` ALLOWED_HOSTS |
| 51 | +- ❌ API root in `urls.py` not using codespace URL format |
| 52 | +- ✅ **Fix**: Updates both files with proper codespace URL configuration |
| 53 | + |
| 54 | +#### Step 5 Issues |
| 55 | +- ❌ React components missing API endpoint URLs |
| 56 | +- ❌ Components not fetching from `-8000.app.github.dev` domain |
| 57 | +- ❌ Wrong endpoint paths in component files |
| 58 | +- ✅ **Fix**: Updates all 5 components with correct API URLs |
| 59 | + |
| 60 | +### Example Usage |
| 61 | + |
| 62 | +``` |
| 63 | +User: /fix-step 3 |
| 64 | +
|
| 65 | +Copilot Agent Mode: |
| 66 | +- Checking Step 3 validation requirements... |
| 67 | +- Found issue: settings.py missing 'djongo' configuration |
| 68 | +- Found issue: populate_db.py doesn't exist |
| 69 | +- Creating management command structure... |
| 70 | +- Updating settings.py with MongoDB configuration... |
| 71 | +- Creating populate_db.py with test data... |
| 72 | +- Verifying fixes against validation criteria... |
| 73 | +- ✅ All Step 3 checks will now pass! |
| 74 | +- Committing changes to build-octofit-app branch... |
| 75 | +
|
| 76 | +Ready to push! Your changes should pass GitHub Actions validation. |
| 77 | +``` |
| 78 | + |
| 79 | +### Tips |
| 80 | + |
| 81 | +- **Wait for completion** - Agent mode may take a minute to analyze and fix issues |
| 82 | +- **Press Continue** - Allow agent mode to execute commands when prompted |
| 83 | +- **Keep changes** - Don't cancel or undo files created by the agent |
| 84 | +- **Push after fixing** - Remember to push your changes after the fix completes |
| 85 | +- **Re-run if needed** - You can run the fix command multiple times |
| 86 | + |
| 87 | +### When to Use This |
| 88 | + |
| 89 | +Use the fix-step prompt when: |
| 90 | +- ⚠️ GitHub Actions workflow fails validation |
| 91 | +- ⚠️ Mona reports validation errors in the issue comments |
| 92 | +- ⚠️ You're not sure what's missing or incorrect |
| 93 | +- ⚠️ You want to quickly verify your work meets requirements |
| 94 | + |
| 95 | +### Manual Verification |
| 96 | + |
| 97 | +After running the fix prompt, you can manually verify: |
| 98 | + |
| 99 | +**Step 2:** |
| 100 | +```bash |
| 101 | +cat octofit-tracker/backend/requirements.txt | grep "Django==4.1" |
| 102 | +``` |
| 103 | + |
| 104 | +**Step 3:** |
| 105 | +```bash |
| 106 | +grep -i "octofit_db" octofit-tracker/backend/octofit_tracker/settings.py |
| 107 | +grep -i "djongo" octofit-tracker/backend/octofit_tracker/settings.py |
| 108 | +cat octofit-tracker/backend/octofit_tracker/management/commands/populate_db.py |
| 109 | +``` |
| 110 | + |
| 111 | +**Step 4:** |
| 112 | +```bash |
| 113 | +grep "8000.app.github.dev" octofit-tracker/backend/octofit_tracker/settings.py |
| 114 | +grep "8000.app.github.dev" octofit-tracker/backend/octofit_tracker/urls.py |
| 115 | +``` |
| 116 | + |
| 117 | +**Step 5:** |
| 118 | +```bash |
| 119 | +grep "8000.app.github.dev/api/activities" octofit-tracker/frontend/src/components/Activities.js |
| 120 | +grep "8000.app.github.dev/api/leaderboard" octofit-tracker/frontend/src/components/Leaderboard.js |
| 121 | +grep "8000.app.github.dev/api/teams" octofit-tracker/frontend/src/components/Teams.js |
| 122 | +grep "8000.app.github.dev/api/users" octofit-tracker/frontend/src/components/Users.js |
| 123 | +grep "8000.app.github.dev/api/workouts" octofit-tracker/frontend/src/components/Workouts.js |
| 124 | +``` |
| 125 | + |
| 126 | +### Still Having Issues? |
| 127 | + |
| 128 | +If the automatic fix doesn't resolve your issue: |
| 129 | + |
| 130 | +1. **Check the branch** - Ensure you're on `build-octofit-app` branch |
| 131 | +2. **Verify file paths** - Files must be in exact locations specified |
| 132 | +3. **Check for typos** - Validation is case-insensitive but requires exact strings |
| 133 | +4. **Review the step instructions** - Re-read the step requirements in `.github/steps/` |
| 134 | +5. **Check GitHub Actions logs** - Review the actual error messages in the Actions tab |
| 135 | + |
| 136 | +### Need More Help? |
| 137 | + |
| 138 | +- Review step instructions: `.github/steps/[1-6]-*.md` |
| 139 | +- Check instruction files: `.github/instructions/*.md` |
| 140 | +- Review other prompts: `.github/prompts/*.prompt.md` |
| 141 | +- Ask Copilot: "What did I miss in Step X?" |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +**Remember**: This troubleshooting prompt is designed to save you time by automatically fixing common validation issues. Let agent mode do the heavy lifting! |
0 commit comments