Richtlijnen voor pull-aanvragen
Dit document biedt uitgebreide richtlijnen voor het indienen van pull-aanvragen bij XOOPS-projecten. Het volgen van deze richtlijnen zorgt voor soepele codebeoordelingen en snellere samenvoegtijden.
Voordat u een pull-verzoek aanmaakt
Section titled “Voordat u een pull-verzoek aanmaakt”Stap 1: Controleer op bestaande problemen
Section titled “Stap 1: Controleer op bestaande problemen”1. Visit the GitHub repository2. Go to Issues tab3. Search for existing issues related to your change4. Check both open and closed issuesStap 2: Fork en kloon de repository
Section titled “Stap 2: Fork en kloon de repository”# Fork the repository on GitHub# Click "Fork" button on the repository page
# Clone your forkgit clone https://github.com/YOUR_USERNAME/XOOPS.gitcd XOOPS
# Add upstream remotegit remote add upstream https://github.com/XOOPS/XOOPS.git
# Verify remotesgit remote -v# Should show: origin (your fork) and upstream (official)Stap 3: Maak een functievertakking
Section titled “Stap 3: Maak een functievertakking”# Update main branchgit fetch upstreamgit checkout maingit merge upstream/main
# Create feature branch# Use descriptive names: bugfix/issue-number or feature/descriptiongit checkout -b bugfix/123-fix-database-connectiongit checkout -b feature/add-psr-7-supportStap 4: breng uw wijzigingen aan
Section titled “Stap 4: breng uw wijzigingen aan”# Make changes to your files# Follow code style guidelines
# Stage changesgit add .
# Commit with clear messagegit commit -m "Fix database connection timeout issue"
# Create multiple commits for logical changesgit commit -m "Add connection retry logic"git commit -m "Improve error messages for debugging"Commit-berichtstandaarden
Section titled “Commit-berichtstandaarden”Goede commit-berichten
Section titled “Goede commit-berichten”Gebruik duidelijke, beschrijvende berichten volgens deze patronen:
# Format<type>: <subject>
<body>
<footer>
# Example 1: Bug fixfix: resolve database connection timeout
Add exponential backoff retry mechanism to database connection.Connections now retry up to 3 times with increasing delays.
Fixes #123# Example 2: Featurefeat: implement PSR-7 HTTP message interfaces
Implement Psr\Http\Message interfaces for request/response handling.Provides type-safe HTTP message handling across the framework.
BREAKING CHANGE: Updated RequestHandler signatureCategorieën van committypes
Section titled “Categorieën van committypes”| Typ | Beschrijving | Voorbeeld |
|---|---|---|
feat | Nieuwe functie | feat: add user dashboard widget |
fix | Bugfix | fix: resolve cache invalidation bug |
docs | Documentatie | docs: update API reference |
style | Codestijl (geen logische verandering) | style: format imports |
refactor | Herstructurering van code | refactor: simplify service layer |
perf | Prestatieverbetering | perf: optimize database queries |
test | Wijzigingen testen | test: add integration tests |
chore | Wijzigingen in constructie/tooling | chore: update dependencies |
Beschrijving van pull-verzoek
Section titled “Beschrijving van pull-verzoek”PR-sjabloon
Section titled “PR-sjabloon”## DescriptionClear description of changes made and why.
## Type of Change- [ ] Bug fix- [ ] New feature- [ ] Breaking change- [ ] Documentation update
## Related IssuesCloses #123Related to #456
## Changes Made- Change 1- Change 2- Change 3
## Testing- [ ] Tested locally- [ ] All tests pass- [ ] Added new tests- [ ] Manual testing steps included
## Checklist- [ ] Code follows style guidelines- [ ] Self-review completed- [ ] Comments added for complex logic- [ ] Documentation updated- [ ] No new warnings generated- [ ] Added tests for new functionality- [ ] All tests passingCodekwaliteitsvereisten
Section titled “Codekwaliteitsvereisten”Codestijl
Section titled “Codestijl”Volg de Code-Style-richtlijnen:
<?php// Good: PSR-12 stylenamespace MyModule\Controller;
use MyModule\Model\Item;use MyModule\Repository\ItemRepository;
class ItemController{ private ItemRepository $repository;
public function __construct(ItemRepository $repository) { $this->repository = $repository; }
public function indexAction() { $items = $this->repository->findAll(); return $this->render('items', ['items' => $items]); }}Testvereisten
Section titled “Testvereisten”Eenheidstests
Section titled “Eenheidstests”namespace Tests\Feature;
use PHPUnit\Framework\TestCase;use Xoops\Database\XoopsDatabase;
class DatabaseConnectionTest extends TestCase{ private XoopsDatabase $database;
protected function setUp(): void { $this->database = new XoopsDatabase(); }
public function testConnectionWithValidCredentials() { $result = $this->database->connect(); $this->assertTrue($result); }
public function testConnectionWithInvalidCredentials() { $this->database->setCredentials('invalid', 'invalid'); $result = $this->database->connect(); $this->assertFalse($result); }}Tests uitvoeren
Section titled “Tests uitvoeren”# Run all testsvendor/bin/phpunit
# Run specific test filevendor/bin/phpunit tests/Feature/DatabaseConnectionTest.php
# Run with coveragevendor/bin/phpunit --coverage-html coverage/Werken met filialen
Section titled “Werken met filialen”Branch up-to-date houden
Section titled “Branch up-to-date houden”# Fetch latest from upstreamgit fetch upstream
# Rebase on latest maingit rebase upstream/main
# Or merge if you prefergit merge upstream/main
# Force push if rebased (warning: only on your branch!)git push -f origin bugfix/123-fix-database-connectionHet pull-verzoek maken
Section titled “Het pull-verzoek maken”PR-titelformaat
Section titled “PR-titelformaat”[Type] Short description (fix/feature/docs)
Examples:- [FIX] Resolve database connection timeout issue (#123)- [FEATURE] Implement PSR-7 HTTP message interfaces- [DOCS] Update API reference for Criteria classCodebeoordelingsproces
Section titled “Codebeoordelingsproces”Waar recensenten naar op zoek zijn
Section titled “Waar recensenten naar op zoek zijn”-
Juistheid
- Lost de code het gestelde probleem op?
- Worden randgevallen afgehandeld?
- Is foutafhandeling adequaat?
-
Kwaliteit
- Volgt het de coderingsnormen?
- Is het onderhoudbaar?
- Is het goed getest?
-
Prestaties
- Zijn er prestatieregressies?
- Zijn zoekopdrachten geoptimaliseerd?
- Is geheugengebruik redelijk?
-
Beveiliging
- Invoervalidatie?
- SQL injectiepreventie?
- Authenticatie/autorisatie?
Reageren op feedback
Section titled “Reageren op feedback”# Address feedback# Edit files based on review comments
# Commit changesgit commit -m "Address code review feedback
- Add additional error handling- Improve test coverage for edge cases- Update documentation"
# Push changesgit push origin bugfix/123-fix-database-connectionVeelvoorkomende PR-problemen en oplossingen
Section titled “Veelvoorkomende PR-problemen en oplossingen”Probleem 1: PR is te groot
Section titled “Probleem 1: PR is te groot”Probleem: Reviewers kunnen enorme PR’s niet effectief beoordelen
Oplossing: Verdeel kleinere PR’s
- Eerste PR: Kernveranderingen
- Tweede PR: Proeven
- Derde PR: Documentatie
Probleem 2: Geen tests inbegrepen
Section titled “Probleem 2: Geen tests inbegrepen”Probleem: Reviewers kunnen de functionaliteit niet verifiëren
Oplossing: Voeg uitgebreide tests toe voordat u deze indient
Probleem 3: Conflicten met Main
Section titled “Probleem 3: Conflicten met Main”Probleem: Uw vertakking is niet gesynchroniseerd met de hoofdtak
Oplossing: Rebase op de nieuwste main
git fetch upstreamgit rebase upstream/maingit push -f origin your-branchNa samenvoegen
Section titled “Na samenvoegen”Opruimen
Section titled “Opruimen”# Switch to maingit checkout main
# Update maingit pull upstream main
# Delete local branchgit branch -d bugfix/123-fix-database-connection
# Delete remote branchgit push origin --delete bugfix/123-fix-database-connectionSamenvatting van beste praktijken
Section titled “Samenvatting van beste praktijken”- Maak beschrijvende commit-berichten
- Maak gerichte PR’s voor één doel
- Inclusief tests voor nieuwe functionaliteit
- Documentatie bijwerken
- Referentiegerelateerde problemen
- Houd PR-beschrijvingen duidelijk
- Reageer snel op beoordelingen
Niet doen
Section titled “Niet doen”- Voeg niet-gerelateerde wijzigingen toe
- Main samenvoegen met uw branch (gebruik rebase)
- Forceer push nadat de beoordeling is gestart
- Sla tests over
- Werk in uitvoering indienen
- Negeer feedback over codebeoordelingen
Gerelateerde documentatie
Section titled “Gerelateerde documentatie”- ../Bijdragen - Bijdragenoverzicht
- Codestijl - Richtlijnen voor codestijl
- ../../03-Module-Development/Best-Practices/Testing - Best practices testen
- ../Architecture-Decisions/ADR-Index - Architectuurrichtlijnen
Bronnen
Section titled “Bronnen”Laatst bijgewerkt: 31-01-2026 Van toepassing op: Alle XOOPS-projecten Repository: https://github.com/XOOPS/XOOPS