Smernice za zahtevo za vlečenje
Ta dokument vsebuje izčrpne smernice za oddajo zahtevkov za vlečenje za XOOPS projektov. Upoštevanje teh smernic zagotavlja gladke preglede kode in hitrejše spajanje.
Pred ustvarjanjem zahteve za vlečenje
Section titled “Pred ustvarjanjem zahteve za vlečenje”1. korak: Preverite obstoječe težave
Section titled “1. korak: Preverite obstoječe težave”1. Visit the GitHub repository2. Go to Issues tab3. Search for existing issues related to your change4. Check both open and closed issues2. korak: Razcepite in klonirajte repozitorij
Section titled “2. korak: Razcepite in klonirajte repozitorij”# 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)3. korak: Ustvarite vejo funkcij
Section titled “3. korak: Ustvarite vejo funkcij”# 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-support4. korak: Izvedite svoje spremembe
Section titled “4. korak: Izvedite svoje spremembe”# 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"Standardi sporočila potrditve
Section titled “Standardi sporočila potrditve”Dobra sporočila o potrditvi
Section titled “Dobra sporočila o potrditvi”Uporabite jasna, opisna sporočila po teh vzorcih:
# 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 signatureKategorije vrste potrditve
Section titled “Kategorije vrste potrditve”| Vrsta | Opis | Primer |
|---|---|---|
feat | Nova funkcija | feat: add user dashboard widget |
fix | Popravek napak | fix: resolve cache invalidation bug |
docs | Dokumentacija | docs: update API reference |
style | Slog kode (brez logične spremembe) | style: format imports |
refactor | Preoblikovanje kode | refactor: simplify service layer |
perf | Izboljšanje zmogljivosti | perf: optimize database queries |
test | Testne spremembe | test: add integration tests |
chore | Build/tooling spremembe | chore: update dependencies |
Opis zahteve za vleko
Section titled “Opis zahteve za vleko”PR predloga
Section titled “PR predloga”## 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 passingZahteve glede kakovosti kode
Section titled “Zahteve glede kakovosti kode”Slog kode
Section titled “Slog kode”Sledite smernicam Code-Style:
<?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]); }}Zahteve za testiranje
Section titled “Zahteve za testiranje”Preizkusi enot
Section titled “Preizkusi enot”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); }}Izvajanje testov
Section titled “Izvajanje testov”# Run all testsvendor/bin/phpunit
# Run specific test filevendor/bin/phpunit tests/Feature/DatabaseConnectionTest.php
# Run with coveragevendor/bin/phpunit --coverage-html coverage/Delo s podružnicami
Section titled “Delo s podružnicami”Naj bo veja posodobljena
Section titled “Naj bo veja posodobljena”# 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-connectionUstvarjanje zahteve za vlečenje
Section titled “Ustvarjanje zahteve za vlečenje”PR oblika naslova
Section titled “PR oblika naslova”[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 classPostopek pregleda kode
Section titled “Postopek pregleda kode”Kaj pregledovalci iščejo
Section titled “Kaj pregledovalci iščejo”-
Korektnost
- Ali koda rešuje navedeni problem?
- Ali se obravnavajo robni primeri?
- Ali je obravnava napak primerna?
-
Kakovost
- Ali sledi standardom kodiranja?
- Ali ga je mogoče vzdrževati?
- Ali je dobro preizkušen?
-
Zmogljivost
- Kakšna regresija uspešnosti? – Ali so poizvedbe optimizirane?
- Ali je uporaba pomnilnika razumna?
-
Varnost
- Preverjanje vnosa?
- SQL preprečevanje vbrizgavanja?
- Authentication/authorization?
Odgovarjanje na povratne informacije
Section titled “Odgovarjanje na povratne informacije”# 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-connectionPogoste težave z odnosi z javnostmi in rešitve
Section titled “Pogoste težave z odnosi z javnostmi in rešitve”1. težava: PR je prevelik
Section titled “1. težava: PR je prevelik”Težava: Pregledovalci ne morejo učinkovito pregledati množičnih PR-jev
Rešitev: Razdelite se na manjše PR-je
- Prvi PR: Temeljne spremembe
- Drugi PR: Testi
- Tretji PR: Dokumentacija
2. težava: testi niso vključeni
Section titled “2. težava: testi niso vključeni”Težava: Pregledovalci ne morejo preveriti funkcionalnosti
Rešitev: Pred oddajo dodajte obsežne teste
Težava 3: Konflikti z glavnim
Section titled “Težava 3: Konflikti z glavnim”Težava: Vaša veja ni sinhronizirana z glavno
Rešitev: Ponovno nastavite na najnovejšo glavno
git fetch upstreamgit rebase upstream/maingit push -f origin your-branchPo spajanju
Section titled “Po spajanju”Čiščenje
Section titled “Čiščenje”# 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-connectionPovzetek najboljših praks
Section titled “Povzetek najboljših praks”Naredi
Section titled “Naredi”- Ustvarite opisna sporočila o objavi
- Ustvarite osredotočene, enonamenske PR-je
- Vključite teste za novo funkcionalnost
- Posodobite dokumentacijo
- Težave, povezane z referencami
- Opisi PR naj bodo jasni
- Hitro se odzovite na ocene
- Vključite nepovezane spremembe
- Spojite main v svojo vejo (uporabite rebase)
- Prisilni pritisk po začetku pregleda
- Preskoči teste
- Predloži delo v teku
- Ignorirajte povratne informacije o pregledu kode
Povezana dokumentacija
Section titled “Povezana dokumentacija”- ../Contributing - Pregled prispevanja
- Code-Style - Smernice za slog kode
- ../../03-Module-Development/Best-Practices/Testing - Testiranje najboljših praks
- ../Architecture-Decisions/ADR-Index - Arhitekturne smernice
Nazadnje posodobljeno: 2026-01-31 Velja za: Vse XOOPS projekte Repozitorij: https://github.com/XOOPS/XOOPS