Pull Request Creation
Complete guide to creating pull requests in the Volare project with automated quality gates.
Overview
Section titled “Overview”The /pr-create slash command automates pull request creation with built-in quality checks:
- Rebase validation - Ensures branch is up-to-date with master
- PHPStan analysis - Validates static analysis passes for PHP changes
- Comprehensive PR description - Guides reviewers through changes
Quick Start
Section titled “Quick Start”/pr-createThe command will:
- Check if your branch needs rebasing
- Check if PHPStan analysis is required (PHP files changed)
- Create PR with comprehensive description
- Link to related GitHub issue
Quality Gates
Section titled “Quality Gates”Gate 1: Rebase Validation
Section titled “Gate 1: Rebase Validation”Purpose: Ensure your branch includes all changes from master.
What Happens If Failed:
⚠️ Master branch has advanced since your branch was created.
Please run `/rebase-master` first to rebase your branch onto the latest master.Action Required: Run /rebase-master then retry /pr-create
Gate 2: PHPStan Analysis
Section titled “Gate 2: PHPStan Analysis”Purpose: Ensure all PHP code passes static analysis.
Conditional Behavior:
- If no PHP files changed → Gate passes automatically
- If PHP files changed → Gate requires PHPStan validation
What Happens If Failed:
⚠️ This branch contains PHP file changes.
Please run `/fix-phpstan` first to ensure all PHPStan analysis passes.Action Required: Run /fix-phpstan then retry /pr-create
Complete Workflow Examples
Section titled “Complete Workflow Examples”Backend PR with PHP Changes
Section titled “Backend PR with PHP Changes”# 1. Finish implementing featuregit add ./commit "Implement booking validation service"
# 2. Create PR/pr-create
# Output: ⚠️ Master has advanced...
# 3. Rebase onto latest master/rebase-master
# 4. Retry PR creation/pr-create
# Output: ⚠️ PHP files changed...
# 5. Run PHPStan analysis/fix-phpstan
# 6. Commit PHPStan fixesy
# 7. Create PR successfully/pr-create
# Output: ✅ PR created: https://github.com/gocimit/volare/pull/123Frontend-Only Changes
Section titled “Frontend-Only Changes”# 1. Finish frontend changesgit add ./commit "Update flight search UI styles"
# 2. Create PR (no quality gates trigger)/pr-create
# Output:# ✅ Master is up-to-date# ✅ No PHP files changed - skipping PHPStan check# Creating PR...Documentation-Only Changes
Section titled “Documentation-Only Changes”# 1. Update documentationgit add ./commit "Update API documentation"
# 2. Create PR/pr-create
# Output: ✅ PR created (no quality gates needed)PR Description Template
Section titled “PR Description Template”The command generates this structure:
## Summary[1-2 sentence overview]
## Changes Made
### What Changed- [Specific change 1]- [Specific change 2]
### Why These Changes[Brief explanation]
## Testing
### Tests Added/Modified- [Test 1 description]
### Manual Testing Performed- [ ] [Test scenario 1]- [ ] [Test scenario 2]
## Review Guidance
### Where to Start1. Start with [file] to understand [concept]2. Then review [file] for [logic]
### Focus Areas- [Area 1]: [Why it needs attention]
## Related Links- Related PR: #[number]- Documentation: [link]
## Security Considerations[Note any security implications]
## Breaking Changes[Describe any breaking changes]
---Closes #ISSUE_NUMBERBest Practices
Section titled “Best Practices”Before Running /pr-create
Section titled “Before Running /pr-create”- Commit all changes - Ensure working directory is clean
- Run tests locally - Verify all tests pass
- Review your changes - Do a self-review
- Format code - Run Laravel Pint for backend changes
When Quality Gates Stop You
Section titled “When Quality Gates Stop You”DO:
- Follow the recommended commands
- Fix issues identified by quality gates
- Retry
/pr-createafter resolving issues
DON’T:
- Skip quality gates unless necessary
- Force-push without running checks
- Create PRs with known analysis errors
Troubleshooting
Section titled “Troubleshooting””Master has advanced” Repeatedly
Section titled “”Master has advanced” Repeatedly”Cause: Your branch keeps diverging from master.
Solution:
- Run
/rebase-masterto sync - Complete your work quickly
- Consider syncing more frequently
PHPStan Finds Errors in Untouched Code
Section titled “PHPStan Finds Errors in Untouched Code”Cause: PHPStan analyzes all PHP files in the diff.
Solution:
- Run
/fix-phpstanon specific directory - Fix errors in files you modified
- Escalate to team if errors exist elsewhere
Quality Gate Hangs or Times Out
Section titled “Quality Gate Hangs or Times Out”Solution:
- Check internet connectivity
- Verify GitHub is accessible
- Retry the command
Need to Skip for Urgent Hotfix
Section titled “Need to Skip for Urgent Hotfix”Solution:
- Explicitly confirm to skip when prompted
- Document in PR description why gates were skipped
- Create follow-up issue for skipped checks
- Get tech lead approval before merging
Why is PHPStan required for PRs?
Section titled “Why is PHPStan required for PRs?”PHPStan catches type-related bugs at compile-time that would otherwise only appear in production. It enforces:
- Complete type hints
- Proper array type annotations
- Laravel best practices
Can I skip the PHPStan check?
Section titled “Can I skip the PHPStan check?”Yes, but only by explicitly confirming. This should be rare and documented. Valid reasons:
- Urgent hotfix for production
- PHPStan false positive (document and create issue)
What happens if I push after gates pass?
Section titled “What happens if I push after gates pass?”Quality gates run at PR creation time. Additional commits:
- Won’t re-run quality gates
- Will trigger CI/CD checks
- May prompt reviewers to request re-check
Does PHPStan check run on frontend changes?
Section titled “Does PHPStan check run on frontend changes?”No. PHPStan only triggers when PHP files are detected in the diff.
How long does PHPStan check take?
Section titled “How long does PHPStan check take?”- Initial analysis: ~30-60 seconds
- Automatic fixes: ~2-5 minutes
- Verification: ~30-60 seconds
- Total: ~5-10 minutes for typical PR
Related Documentation
Section titled “Related Documentation”- Slash Commands Reference - All commands
- Queue System - Queue infrastructure