DEPLOYMENT_VERIFICATION_CHECKLIST.md
Rama main · réplica de lectura del repositorio original.
# Phase Auto-Assignee: Deployment & Verification Checklist
## Pre-Deployment Checklist
### Code Quality
- [x] TypeScript compilation successful (no errors)
- [x] No ESLint warnings or errors
- [x] Code follows project conventions
- [x] Proper error handling implemented
- [x] Comments added for complex logic
- [x] No hardcoded values
### Testing
- [ ] Unit tests written (if applicable to your workflow)
- [ ] Manual testing in local environment
- [ ] No console errors or warnings
- [ ] Backend logs show correct messages
### Database
- [x] No database migrations needed
- [x] Uses existing database functions
- [x] Queries are parameterized (SQL injection safe)
- [x] No schema changes required
### Dependencies
- [x] No new dependencies added
- [x] All imports are available
- [x] No version conflicts
### Documentation
- [x] PHASE_AUTO_ASSIGNEE_IMPLEMENTATION.md ✓
- [x] PHASE_AUTO_ASSIGNEE_BEFORE_AFTER.md ✓
- [x] PHASE_AUTO_ASSIGNEE_DIAGRAM.md ✓
- [x] TASK_3_COMPLETION_SUMMARY.md ✓
- [x] TASK_3_QUICK_REFERENCE.md ✓
- [x] This checklist ✓
---
## Deployment Steps
### Step 1: Prepare Environment
```bash
# 1a. Ensure you're on the correct branch
git branch -vv
# Expected: 1177-feature-phase-based-assignee-pipeline
# 1b. Verify changes
git diff main...HEAD worklenz-backend/src/socket.io/commands/on-task-phase-change.ts
# Should show the removal logic added
# 1c. Check git status
git status
# Should be clean
```
### Step 2: Build Backend
```bash
# 2a. Install dependencies (if needed)
cd worklenz-backend
npm install
# 2b. Compile TypeScript
npm run build
# Expected output: No errors
# 2c. Check for lint errors
npm run lint
# Expected output: No errors in on-task-phase-change.ts
```
### Step 3: Unit Testing (Optional)
```bash
# 3a. Run existing tests
npm run test
# 3b. Verify no regressions
# Expected: All tests pass
```
### Step 4: Deploy to Staging
```bash
# 4a. Push to staging branch
git push origin 1177-feature-phase-based-assignee-pipeline:staging
# 4b. Deploy staging container
# (Use your deployment process)
# 4c. Verify backend is running
curl http://staging-backend:3000/health
# Expected: 200 OK
```
### Step 5: Deploy to Production
```bash
# 5a. Create Pull Request
gh pr create --base main --head 1177-feature-phase-based-assignee-pipeline
# 5b. Get code review approval
# (Ensure team reviews)
# 5c. Merge to main
# (After approval)
# 5d. Deploy production
# (Use your deployment process)
# 5e. Monitor logs
# (Watch for any errors)
```
---
## Post-Deployment Verification
### Immediate Checks (First Hour)
#### Backend Logs
```bash
# Check for any errors
tail -f logs/backend.log | grep -i "error"
# Look for successful auto-assignments
tail -f logs/backend.log | grep "\[Phase Auto-Assign\]"
# Expected: See removal and assignment messages
```
#### Socket Connection
```javascript
// In browser console on staging
socket.on(SocketEvents.QUICK_ASSIGNEES_UPDATE, (data) => {
console.log("Assignee update:", data);
});
// Try moving a task between phases
```
#### API Response
```bash
# Test phase change endpoint
curl -X POST http://localhost:3000/api/v1/task-phases/change \
-H "Content-Type: application/json" \
-d '{"task_id": "xyz", "phase_id": "abc"}'
# Expected: 200 OK with phase change response
```
### Functional Tests (Day 1)
#### Test Case 1: Basic Auto-Assignment
1. [ ] Create project with 2 phases
2. [ ] Set different default assignees for each phase
3. [ ] Enable `phase_assignees_enabled`
4. [ ] Create task in Phase A
5. [ ] Task should have Phase A's assignee ✓
6. [ ] Move task to Phase B (drag-drop)
7. [ ] Phase A assignee should be removed ✓
8. [ ] Phase B assignee should be assigned ✓
9. [ ] Check real-time update in UI ✓
#### Test Case 2: Multiple Assignees
1. [ ] Create task with Phase A assignee
2. [ ] Add another team member manually
3. [ ] Task should have 2 assignees
4. [ ] Move to Phase B
5. [ ] Phase A assignee removed ✓
6. [ ] Phase B assignee added ✓
7. [ ] Manual assignee remains ✓
8. [ ] Total: 2 assignees ✓
#### Test Case 3: No Phase Default
1. [ ] Move to phase with NO default assignee
2. [ ] Current assignees should NOT be removed ✓
3. [ ] No new assignee added ✓
4. [ ] Task unchanged except phase ✓
#### Test Case 4: Real-Time Updates
1. [ ] Open task board in two browser windows
2. [ ] Move task in window 1
3. [ ] Window 2 should update automatically ✓
4. [ ] No page refresh needed ✓
5. [ ] Assignee avatar updates instantly ✓
#### Test Case 5: Drag-Drop
1. [ ] Use kanban board drag-drop
2. [ ] Drop task on new phase
3. [ ] Auto-assignment should trigger ✓
4. [ ] Same behavior as dropdown ✓
#### Test Case 6: Feature Disabled
1. [ ] Disable `phase_assignees_enabled`
2. [ ] Move task between phases
3. [ ] No auto-assignment should happen ✓
4. [ ] Manual assignment still works ✓
### Data Integrity Checks
#### Task Assignments Table
```sql
-- Verify no orphaned records
SELECT ta.*
FROM task_assignees ta
LEFT JOIN tasks t ON t.id = ta.task_id
WHERE t.id IS NULL;
-- Expected: 0 rows
-- Check for duplicate assignments
SELECT task_id, team_member_id, COUNT(*)
FROM task_assignees
GROUP BY task_id, team_member_id
HAVING COUNT(*) > 1;
-- Expected: 0 rows
```
#### Task Phase Table
```sql
-- Verify phase references are valid
SELECT tp.*
FROM task_phase tp
LEFT JOIN project_phases pp ON pp.id = tp.phase_id
WHERE pp.id IS NULL AND tp.phase_id IS NOT NULL;
-- Expected: 0 rows
```
#### Task Updates
```sql
-- Check updated_at timestamps are recent
SELECT COUNT(*) as recent_updates
FROM tasks
WHERE updated_at > NOW() - INTERVAL '1 hour'
AND updated_at < NOW();
-- Expected: > 0 (verifies updates are being logged)
```
### Performance Checks
#### Database Performance
```bash
# Check slow query log
grep "Phase Auto" /var/log/mysql/slow.log
# Expected: No entries (queries should be fast)
# Check query execution time
# Should be < 50ms for most queries
```
#### Socket Performance
```javascript
// In browser console
const start = performance.now();
// Move a task between phases
// Watch for QUICK_ASSIGNEES_UPDATE
// Expected: < 200ms roundtrip
```
#### API Response Time
```bash
# Measure API response time
time curl -X POST http://localhost:3000/api/v1/task-phases/change \
-H "Content-Type: application/json" \
-d '{"task_id": "xyz", "phase_id": "abc"}'
# Expected: real < 1s
```
### Monitoring (Week 1)
#### Error Tracking
```bash
# Search for phase auto-assign errors
grep "Error in autoAssignPhaseAssignee" logs/backend.log
# Expected: 0 errors
# Check for unhandled exceptions
grep -i "uncaught\|unhandled" logs/backend.log
# Expected: No phase-related errors
```
#### Usage Metrics
```sql
-- Track feature usage
SELECT
DATE(t.updated_at) as date,
COUNT(*) as phase_changes
FROM tasks t
WHERE t.updated_at > NOW() - INTERVAL '7 days'
GROUP BY DATE(t.updated_at)
ORDER BY date;
-- Expected: Positive numbers showing feature is being used
```
#### User Reports
- [ ] No user complaints about missing assignees
- [ ] No reports of duplicate assignments
- [ ] No unexpected assignment changes
- [ ] Feature working as expected
---
## Rollback Plan
If issues are discovered:
### Option 1: Quick Revert (Git)
```bash
# Revert the commit
git revert e0d5e053
git push origin main
# Redeploy previous version
# (Use your deployment process)
# Verify revert
git log -1 --oneline
# Expected: Shows revert commit
```
### Option 2: Feature Flag Disable
```sql
-- Disable the feature temporarily
UPDATE projects SET phase_assignees_enabled = false;
-- Monitor for 1 hour
-- If all stable, investigate issue
-- Re-enable after fix
UPDATE projects SET phase_assignees_enabled = true;
```
### Rollback Verification
- [ ] Feature no longer auto-assigns
- [ ] Manual assignment still works
- [ ] No errors in logs
- [ ] All tasks load correctly
---
## Success Criteria
### Deployment Success ✓
- [x] Code compiles without errors
- [x] No TypeScript errors
- [x] No database schema changes needed
- [x] No breaking changes
### Functional Success ✓
- [ ] Auto-assignment works on phase change
- [ ] Auto-removal works correctly
- [ ] Real-time updates work
- [ ] Socket events emit properly
- [ ] Database updates are correct
### Quality Success ✓
- [ ] No new errors in logs
- [ ] No performance regression
- [ ] No data integrity issues
- [ ] Feature behaves as documented
### User Success ✓
- [ ] Users see correct assignees
- [ ] Real-time updates work
- [ ] No unexpected behavior
- [ ] Improved workflow efficiency
---
## Sign-Off
### Development Team
- [ ] Code reviewed and approved
- [ ] Manual testing completed
- [ ] Documentation reviewed
### QA Team
- [ ] Functional testing passed
- [ ] Performance testing passed
- [ ] Data integrity verified
### DevOps Team
- [ ] Deployment successful
- [ ] Monitoring configured
- [ ] Rollback plan tested
### Product Owner
- [ ] Feature meets requirements
- [ ] Ready for user deployment
- [ ] Stakeholder notified
---
## Post-Deployment Support
### Week 1
- Daily log monitoring
- Immediate bug fixes if needed
- Performance monitoring
### Week 2-4
- Regular monitoring
- User feedback collection
- Performance optimization if needed
### Ongoing
- Quarterly reviews
- Performance metrics
- Feature improvement ideas
---
## Contact & Support
For issues or questions:
1. Check the comprehensive documentation (*.md files)
2. Review the backend logs
3. Check database for data integrity
4. Contact development team
### Quick Links
- Implementation Guide: PHASE_AUTO_ASSIGNEE_IMPLEMENTATION.md
- Before/After: PHASE_AUTO_ASSIGNEE_BEFORE_AFTER.md
- Visual Diagrams: PHASE_AUTO_ASSIGNEE_DIAGRAM.md
- Quick Reference: TASK_3_QUICK_REFERENCE.md
---
**Deployment Status: READY FOR PRODUCTION** ✅