Complete Workflow Guide - Step by Step
π― Overview of the Workflow
Feature Branch β Pull Request β Preview URL β Code Review β Develop (Staging) β Main (Production)π Table of Contents
- Initial Setup
- Daily Development Workflow
- Creating Features
- Testing on Preview URLs
- Deploying to Staging
- Deploying to Production
- Emergency Hotfixes
- Common Scenarios
π Initial Setup
First Time Only - Create Develop Branch
# Run the setup scriptcd /Users/larryanglin/Projects/HelpDesk./scripts/setup-develop-branch.shConfigure Branch Protection
- Go to https://github.com/LarryAnglin/HelpDesk/settings/branches
- Add protection rules for
mainanddevelopbranches - See
BRANCH_PROTECTION_SETUP.mdfor detailed settings
π» Daily Development Workflow
Starting Your Day
# Always start by updating your local develop branchgit checkout developgit pull origin developCreating a New Feature
Step 1: Create Feature Branch
# Create a new feature branch from developgit checkout -b feature/add-user-export
# For bug fixesgit checkout -b fix/ticket-loading-error
# For updatesgit checkout -b update/improve-ui-colorsStep 2: Make Your Changes
# Work on your featurecd reactnpm run dev
# Make changes to files# Test locally at http://localhost:5173Step 3: Commit Your Changes
# Check what you've changedgit status
# Add filesgit add .
# Or add specific filesgit add react/src/components/NewComponent.tsx
# Commit with descriptive messagegit commit -m "Add user export functionality to admin panel
- Add export button to user list- Implement CSV export function- Add date range filter for exports"Step 4: Push to GitHub
# First pushgit push -u origin feature/add-user-export
# Subsequent pushesgit pushπ Creating a Pull Request
Step 1: Go to GitHub
After pushing, GitHub will show a banner:
- Click βCompare & pull requestβ
Or manually:
- Go to https://github.com/LarryAnglin/HelpDesk
- Click βPull requestsβ
- Click βNew pull requestβ
Step 2: Fill Out PR Template
## DescriptionAdded user export functionality to allow admins to download user data as CSV
## Type of Change- [x] β¨ New feature (non-breaking change which adds functionality)
## Testing- [x] Tested locally- [ ] Tested on preview URL (will do after PR creation)- [ ] Tested on staging
## Screenshots[Add screenshot of export button]Step 3: Create the PR
- Base branch:
develop(NOT main!) - Compare branch:
feature/add-user-export - Click βCreate pull requestβ
Step 4: Wait for Preview URL
Within 2-3 minutes, a bot will comment:
π₯ Preview deployed to: https://your-project-id--pr-42.web.appπ§ͺ Testing on Preview URLs
Finding Your Preview URL
- Check the PR comments for the preview URL
- Or go to Actions tab β Click your workflow β Find the URL in logs
Testing Checklist
- [ ] Feature works as expected- [ ] No console errors- [ ] Mobile responsive- [ ] Cross-browser testing- [ ] Share with stakeholders for feedbackUpdating After Feedback
# Make requested changesgit add .git commit -m "Address PR feedback - improve error handling"git push
# Preview URL auto-updates!π¦ Deploying to Staging
After PR Approval
- Click βMerge pull requestβ on GitHub
- Choose βSquash and mergeβ (recommended)
- Edit commit message if needed
- Click βConfirm mergeβ
Automatic Staging Deployment
- Staging URL: https://your-project-idβstaging.web.app
- Deploys automatically when PR merges to develop
- Takes 2-3 minutes
Testing on Staging
Staging Testing Checklist:- [ ] All features work correctly- [ ] No integration issues- [ ] Performance is acceptable- [ ] Error handling works- [ ] Data persistence worksπ Deploying to Production
Creating a Production PR
# Ensure develop is up to dategit checkout developgit pull origin develop
# Create PR from develop to main# Do this on GitHub:- Go to https://github.com/LarryAnglin/HelpDesk
- Click βNew pull requestβ
- Base:
mainβ Compare:develop - Title: βRelease: v1.2.0 - User Export Featureβ
Production PR Description
## Release v1.2.0
### Features- Add user export functionality (#42)- Improve UI responsiveness (#43)
### Bug Fixes- Fix ticket loading error (#44)
### Tested- [x] All features tested on staging- [x] No breaking changes- [x] Ready for productionDeploying
- Get approval (required by branch protection)
- Click βMerge pull requestβ
- Production deploys automatically
- Monitor at: https://your-project-id.web.app
π¨ Emergency Hotfixes
For Critical Production Bugs
# Create hotfix from main (not develop!)git checkout maingit pull origin maingit checkout -b hotfix/critical-auth-bug
# Make minimal fixgit add .git commit -m "Fix critical authentication bug"git push -u origin hotfix/critical-auth-bugHotfix PR Process
- Create PR:
hotfix/critical-auth-bugβmain - Mark as urgent in PR description
- Get expedited review
- Merge to main
- Important: Also merge to develop!
# After hotfix is in productiongit checkout developgit pull origin developgit merge maingit push origin developπ Common Scenarios
Scenario 1: Working on Multiple Features
# Feature 1git checkout developgit checkout -b feature/feature-1# work and push
# Feature 2 (while feature 1 is in review)git checkout develop # Always branch from develop!git checkout -b feature/feature-2# work and pushScenario 2: Updating Your Branch
# If develop has new changes while you're workinggit checkout developgit pull origin developgit checkout feature/my-featuregit merge develop
# Resolve conflicts if anygit pushScenario 3: Abandoning a Feature
# Delete local branchgit checkout developgit branch -D feature/abandoned-feature
# Delete remote branchgit push origin --delete feature/abandoned-featureScenario 4: Cherry-picking a Single Commit
# If you need just one commit from a featuregit checkout developgit cherry-pick <commit-hash>git pushπ― Best Practices
Commit Messages
# Goodgit commit -m "Add CSV export for user data with date filtering"
# Badgit commit -m "Update files"Branch Names
# Goodfeature/add-user-exportfix/login-error-handlingupdate/react-dependencies
# Badfeature/stuffmy-branchtest123PR Sizes
- Ideal: 200-400 lines changed
- Maximum: 1000 lines
- If larger: Split into multiple PRs
Review Process
- Self-review before requesting others
- Respond to all feedback
- Test the preview URL
- Approve only after testing
π Checking Deployment Status
View All Environments
# See all Firebase hosting channelsfirebase hosting:channel:listCheck Current Deployments
- Production: https://your-project-id.web.app
- Staging: https://your-project-idβstaging.web.app
- PR Preview: Check PR comments
Monitor GitHub Actions
- Go to https://github.com/LarryAnglin/HelpDesk/actions
- Click on the latest workflow
- Watch real-time logs
π Troubleshooting
Preview URL Not Working
# Check if build passed# Go to Actions tab β Check for errors
# Common fixes:npm install # Update dependenciesnpm run build # Test build locallyMerge Conflicts
# Update your branchgit checkout feature/my-featuregit merge develop
# Resolve conflicts in VS Code# Then:git add .git commit -m "Resolve merge conflicts with develop"git pushDeployment Failed
- Check GitHub Actions logs
- Common issues:
- Missing environment variables
- Build errors
- Firebase quota exceeded
π Workflow Summary Card
ββββββββββββββββββββββββββββββββββββββββββββ QUICK WORKFLOW REFERENCE ββββββββββββββββββββββββββββββββββββββββββββ€β 1. git checkout -b feature/name ββ 2. Make changes ββ 3. git add . && git commit -m "msg" ββ 4. git push -u origin feature/name ββ 5. Create PR β develop ββ 6. Test preview URL ββ 7. Merge to develop (staging) ββ 8. Test staging ββ 9. PR develop β main ββ 10. Merge to main (production) ββββββββββββββββββββββββββββββββββββββββββββπ Youβre Ready!
This workflow ensures:
- β No accidental production deployments
- β Everything is tested before going live
- β Easy rollbacks if needed
- β Clear history of all changes
- β Collaborative development
Start with your first feature branch and experience the smooth deployment process!