Test, Fix, Commit and Push Workflow
Test, fix, commit, and push changes to the repository
Execute a complete development workflow that ensures code quality before pushing changes to the remote repository.
Workflow Steps
1. Run All Tests
Execute comprehensive testing across the entire project:
Backend Tests:
Run all Go unit tests:
go test ./...Run RADIUS protocol tests:
go test ./internal/radiusd/...Run benchmark tests if applicable:
go test -bench=. ./internal/radiusd/Check for race conditions:
go test -race ./...
Frontend Tests:
Navigate to
web/directoryRun frontend tests:
npm testornpm run testRun build validation:
npm run buildto ensure production build succeeds
Integration Tests:
Verify database migrations work: Check
app.MigrateDB()functionalityTest RADIUS authentication flow end-to-end if changes affect core services
Validate API endpoints if admin API routes were modified
2. Fix Issues
If any tests fail:
Analyze the failure output carefully
Trace the root cause through the codebase
Apply fixes following project conventions:
Maintain consistent error handling patterns
Follow existing logging standards (zap with namespace)
Preserve architectural patterns (errgroup for services, app.GDB() for database access)
Update vendor-specific code according to specifications
Re-run ALL tests after each fix
Iterate until all tests pass
Do not proceed to commit until all tests pass successfully.
3. Commit Changes
Once all tests pass, commit the changes with proper organization:
Commit Strategy:
Small changes (1-5 files): Single commit
Large changes: Categorize into logical batches:
Group by feature/component (e.g., "auth service", "admin API", "frontend UI")
Separate backend and frontend changes
Isolate refactoring from new features
Keep test updates with their corresponding code changes
Commit Message Format:
Follow conventional commits specification:
Types:
feat: New featurefix: Bug fixrefactor: Code restructuring without behavior changeperf: Performance improvementtest: Adding or updating testsdocs: Documentation changeschore: Build process, dependencies, configsstyle: Code formatting (not UI styles)
Scope examples:
radiusd: RADIUS service coreadminapi: Admin API routeswebserver: Web server/middlewaredomain: Data modelsvendors: Vendor-specific implementationsfrontend: React Admin UIconfig: Configuration handling
Examples:
Commit Command Pattern:
4. Push to Remote
After all commits are created:
Pre-push Checklist:
✅ All tests passing
✅ Commits follow conventional format
✅ Related changes grouped logically
✅ Commit messages are clear and descriptive
✅ No sensitive data in commits
✅ Branch is up to date with remote (pull/rebase if needed)
Error Handling
If push fails:
Conflict: Pull latest changes, resolve conflicts, re-test, then push
Rejected: Check if branch protection requires PR or review
Authentication: Verify Git credentials and remote URL
Success Criteria
The workflow is complete when:
All backend and frontend tests pass
All changes are committed with proper messages
Commits are successfully pushed to remote repository
No errors or warnings in the process
Notes
Never skip tests even for "small" changes
Always verify production build succeeds for frontend changes
Keep commits atomic and focused
Write commit messages for future maintainers, not just yourself
Follow ToughRADIUS coding standards from
.github/copilot-instructions.md
Last updated
Was this helpful?