Directives de Demande de Tirage
Ce document fournit des directives complètes pour soumettre des demandes de tirage aux projets XOOPS. Suivre ces directives assure des révisions de code fluides et des délais de fusion plus rapides.
Before Creating a Pull Request
Section intitulée « Before Creating a Pull Request »Step 1: Check for Existing Issues
Section intitulée « Step 1: Check for Existing Issues »1. Visit the GitHub repository2. Go to Issues tab3. Search for existing issues related to your change4. Check both open and closed issuesStep 2: Fork and Clone the Repository
Section intitulée « Step 2: Fork and Clone the 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)Step 3: Create a Feature Branch
Section intitulée « Step 3: Create a Feature Branch »# 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-supportStep 4: Make Your Changes
Section intitulée « Step 4: Make Your Changes »# 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 Message Standards
Section intitulée « Commit Message Standards »Good Commit Messages
Section intitulée « Good Commit Messages »Use clear, descriptive messages following these patterns:
# 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 signatureCommit Type Categories
Section intitulée « Commit Type Categories »| Type | Description | Example |
|---|---|---|
feat | New feature | feat: add user dashboard widget |
fix | Bug fix | fix: resolve cache invalidation bug |
docs | Documentation | docs: update API reference |
style | Code style (no logic change) | style: format imports |
refactor | Code refactoring | refactor: simplify service layer |
perf | Performance improvement | perf: optimize database queries |
test | Test changes | test: add integration tests |
chore | Build/tooling changes | chore: update dependencies |
Pull Request Description
Section intitulée « Pull Request Description »PR Template
Section intitulée « PR Template »## 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 passingCode Quality Requirements
Section intitulée « Code Quality Requirements »Code Style
Section intitulée « Code Style »Follow Code-Style guidelines:
<?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]); }}Testing Requirements
Section intitulée « Testing Requirements »Unit Tests
Section intitulée « Unit Tests »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); }}Running Tests
Section intitulée « Running Tests »# Run all testsvendor/bin/phpunit
# Run specific test filevendor/bin/phpunit tests/Feature/DatabaseConnectionTest.php
# Run with coveragevendor/bin/phpunit --coverage-html coverage/Working with Branches
Section intitulée « Working with Branches »Keep Branch Updated
Section intitulée « Keep Branch Updated »# 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-connectionCreating the Pull Request
Section intitulée « Creating the Pull Request »PR Title Format
Section intitulée « PR Title Format »[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 classCode Review Process
Section intitulée « Code Review Process »What Reviewers Look For
Section intitulée « What Reviewers Look For »-
Correctness
- Does the code solve the stated problem?
- Are edge cases handled?
- Is error handling appropriate?
-
Quality
- Does it follow coding standards?
- Is it maintainable?
- Is it well-tested?
-
Performance
- Any performance regressions?
- Are queries optimized?
- Is memory usage reasonable?
-
Security
- Input validation?
- SQL injection prevention?
- Authentication/authorization?
Responding to Feedback
Section intitulée « Responding to 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-connectionCommon PR Issues and Solutions
Section intitulée « Common PR Issues and Solutions »Issue 1: PR is Too Large
Section intitulée « Issue 1: PR is Too Large »Problem: Reviewers can’t review massive PRs effectively
Solution: Break into smaller PRs
- First PR: Core changes
- Second PR: Tests
- Third PR: Documentation
Issue 2: No Tests Included
Section intitulée « Issue 2: No Tests Included »Problem: Reviewers can’t verify functionality
Solution: Add comprehensive tests before submitting
Issue 3: Conflicts with Main
Section intitulée « Issue 3: Conflicts with Main »Problem: Your branch is out of sync with main
Solution: Rebase on latest main
git fetch upstreamgit rebase upstream/maingit push -f origin your-branchAfter Merge
Section intitulée « After Merge »# 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-connectionBest Practices Summary
Section intitulée « Best Practices Summary »- Create descriptive commit messages
- Make focused, single-purpose PRs
- Include tests for new functionality
- Update documentation
- Reference related issues
- Keep PR descriptions clear
- Respond promptly to reviews
- Include unrelated changes
- Merge main into your branch (use rebase)
- Force push after review starts
- Skip tests
- Submit work in progress
- Ignore code review feedback
Documentation Connexe
Section intitulée « Documentation Connexe »- ../Contributing - Aperçu de la contribution
- Code-Style - Directives de style de code
- ../../03-Module-Development/Best-Practices/Testing - Meilleures pratiques de test
- ../Architecture-Decisions/ADR-Index - Directives architecturales
Ressources
Section intitulée « Ressources »- Documentation Git
- Aide GitHub pour les Demandes de Tirage
- Commits Conventionnels
- Organisation GitHub XOOPS
Dernière Mise à Jour: 2026-01-31 S’applique À: Tous les projets XOOPS Dépôt: https://github.com/XOOPS/XOOPS