זרימת עבודה של תרומה
מדריך זה מנחה אותך בתהליך השלם של תרומה ל-XOOPS, מההגדרה הראשונית ועד לבקשת המשיכה הממוזגת.
דרישות מוקדמות
Section titled “דרישות מוקדמות”לפני שתתחיל לתרום, ודא שיש לך:
- Git מותקן ומוגדר
- חשבון GitHub (חינם)
- PHP 7.4+ לפיתוח XOOPS
- Composer לניהול תלות
- ידע בסיסי בתהליכי עבודה של Git
- היכרות עם קוד ההתנהגות
שלב 1: מזלג את המאגר
Section titled “שלב 1: מזלג את המאגר”על ממשק האינטרנט GitHub
Section titled “על ממשק האינטרנט GitHub”- נווט אל המאגר (לדוגמה,
XOOPS/XoopsCore27) - לחץ על הלחצן מזלג בפינה השמאלית העליונה
- בחר היכן לחלק (החשבון האישי שלך)
- המתן עד שהמזלג יסתיים
למה מזלג?
Section titled “למה מזלג?”- אתה מקבל עותק משלך לעבוד עליו
- מתחזקים לא צריכים לנהל סניפים רבים
- יש לך שליטה מלאה על המזלג שלך
- Pull Requests מתייחסות למזלג שלך ולריפו במעלה הזרם
שלב 2: שיבוט המזלג שלך באופן מקומי
Section titled “שלב 2: שיבוט המזלג שלך באופן מקומי”# Clone your fork (replace YOUR_USERNAME)git clone https://github.com/YOUR_USERNAME/XoopsCore27.gitcd XoopsCore27
# Add upstream remote to track original repositorygit remote add upstream https://github.com/XOOPS/XoopsCore27.git
# Verify remotes are set correctlygit remote -v# origin https://github.com/YOUR_USERNAME/XoopsCore27.git (fetch)# origin https://github.com/YOUR_USERNAME/XoopsCore27.git (push)# upstream https://github.com/XOOPS/XoopsCore27.git (fetch)# upstream https://github.com/XOOPS/XoopsCore27.git (nofetch)שלב 3: הגדר סביבת פיתוח
Section titled “שלב 3: הגדר סביבת פיתוח”התקנת תלות
Section titled “התקנת תלות”# Install Composer dependenciescomposer install
# Install development dependenciescomposer install --dev
# For module developmentcd modules/mymodulecomposer installהגדר את Git
Section titled “הגדר את Git”# Set your Git identitygit config user.name "Your Name"git config user.email "your.email@example.com"
# Optional: Set global Git configgit config --global user.name "Your Name"git config --global user.email "your.email@example.com"הפעל בדיקות
Section titled “הפעל בדיקות”# Make sure tests pass in clean state./vendor/bin/phpunit
# Run specific test suite./vendor/bin/phpunit --testsuite unitשלב 4: צור סניף תכונה
Section titled “שלב 4: צור סניף תכונה”אמנת מתן שמות של סניפים
Section titled “אמנת מתן שמות של סניפים”עקוב אחר הדפוס הזה: <type>/<description>
סוגים:
feature/- תכונה חדשהfix/- תיקון באגיםdocs/- תיעוד בלבדrefactor/- ריפקטור קודtest/- תוספות בדיקהchore/- תחזוקה, כלי עבודה
דוגמאות:
# Feature branchgit checkout -b feature/add-two-factor-auth
# Bug fix branchgit checkout -b fix/prevent-xss-in-forms
# Documentation branchgit checkout -b docs/update-api-guide
# Always branch from upstream/main (or develop)git checkout -b feature/my-feature upstream/mainשמור את הסניף מעודכן
Section titled “שמור את הסניף מעודכן”# Before you start work, sync with upstreamgit fetch upstreamgit merge upstream/main
# Later, if upstream has changedgit fetch upstreamgit rebase upstream/mainשלב 5: בצע את השינויים שלך
Section titled “שלב 5: בצע את השינויים שלך”שיטות פיתוח
Section titled “שיטות פיתוח”- כתוב קוד בהתאם לתקני PHP
- כתוב מבחנים לפונקציונליות חדשה
- עדכן תיעוד במידת הצורך
- הפעל linters ומעצבי קוד
בדיקות איכות קוד
Section titled “בדיקות איכות קוד”# Run all tests./vendor/bin/phpunit
# Run with coverage./vendor/bin/phpunit --coverage-html coverage/
# Run PHP CS Fixer./vendor/bin/php-cs-fixer fix --dry-run
# Run PHPStan static analysis./vendor/bin/phpstan analyse class/ src/בצע שינויים טובים
Section titled “בצע שינויים טובים”# Check what you changedgit statusgit diff
# Stage specific filesgit add class/MyClass.phpgit add tests/MyClassTest.php
# Or stage all changesgit add .
# Commit with descriptive messagegit commit -m "feat(auth): add two-factor authentication support"שלב 6: שמור סניף מסונכרן
Section titled “שלב 6: שמור סניף מסונכרן”בזמן העבודה על התכונה שלך, הענף הראשי עשוי להתקדם:
# Fetch latest changes from upstreamgit fetch upstream
# Option A: Rebase (preferred for clean history)git rebase upstream/main
# Option B: Merge (simpler but adds merge commits)git merge upstream/main
# If conflicts occur, resolve them then:git add .git rebase --continue # or git merge --continueשלב 7: דחף אל המזלג שלך
Section titled “שלב 7: דחף אל המזלג שלך”# Push your branch to your forkgit push origin feature/my-feature
# On subsequent pushesgit push
# If you rebased, you might need force push (use carefully!)git push --force-with-lease origin feature/my-featureשלב 8: צור בקשת משיכה
Section titled “שלב 8: צור בקשת משיכה”בממשק האינטרנט GitHub
Section titled “בממשק האינטרנט GitHub”- עבור אל המזלג שלך ב-GitHub
- תראה הודעה ליצירת יחסי ציבור מהסניף שלך
- לחץ על “השוואה ומשוך בקשה”
- או לחץ ידנית על “בקשת משיכה חדשה” ובחר את הסניף שלך
כותרת ותיאור יחסי ציבור
Section titled “כותרת ותיאור יחסי ציבור”פורמט כותרת:
<type>(<scope>): <subject>דוגמאות:
feat(auth): add two-factor authenticationfix(forms): prevent XSS in text inputdocs: update installation guiderefactor(core): improve performanceתבנית תיאור:
## DescriptionBrief explanation of what this PR does.
## Changes- Changed X from A to B- Added feature Y- Fixed bug Z
## Type of Change- [ ] New feature (adds new functionality)- [ ] Bug fix (fixes an issue)- [ ] Breaking change (API/behavior change)- [ ] Documentation update
## Testing- [ ] Added tests for new functionality- [ ] All existing tests pass- [ ] Manual testing performed
## Screenshots (if applicable)Include before/after screenshots for UI changes.
## Related IssuesCloses #123Related to #456
## Checklist- [ ] Code follows style guidelines- [ ] Self-reviewed own code- [ ] Commented complex code- [ ] Updated documentation- [ ] No new warnings generated- [ ] Tests pass locallyרשימת ביקורת ליחסי ציבור
Section titled “רשימת ביקורת ליחסי ציבור”לפני השליחה, ודא:
- הקוד עומד בתקני PHP
- מבחנים כלולים ועוברים
- התיעוד עודכן (במידת הצורך)
- אין התנגשויות מיזוג
- הודעות התחייבות ברורות
- יש התייחסות לנושאים קשורים
- תיאור יחסי הציבור מפורט
- אין קוד ניפוי באגים או יומני מסוף
שלב 9: השב למשוב
Section titled “שלב 9: השב למשוב”במהלך סקירת קוד
Section titled “במהלך סקירת קוד”- קרא תגובות בעיון - הבן את המשוב
- שאל שאלות - אם לא ברור, בקשו הבהרה
- לדון בחלופות - דיון בכבוד על גישות
- בצע שינויים מבוקשים - עדכן את הסניף שלך
- התחייבויות מעודכנות בכוח דחיפה - אם משכתבים את ההיסטוריה
# Make changesgit add .git commit --amend # Modify last commitgit push --force-with-lease origin feature/my-feature
# Or add new commitsgit commit -m "Address feedback on PR review"git push origin feature/my-featureצפו לאיטרציה
Section titled “צפו לאיטרציה”- רוב אנשי יחסי הציבור דורשים סבבי ביקורת מרובים
- היו סבלניים ובונים
- ראה משוב כהזדמנות למידה
- מנהלי התחזוקה עשויים להציע רפקטורים
שלב 10: מיזוג וניקוי
Section titled “שלב 10: מיזוג וניקוי”לאחר אישור
Section titled “לאחר אישור”לאחר שהמתחזקים מאשרים וממזגים:
- GitHub מתמזג אוטומטית או קליקים של מנהלים מתמזגים
- הסניף שלך נמחק (בדרך כלל אוטומטי)
- השינויים הם במעלה הזרם
ניקוי מקומי
Section titled “ניקוי מקומי”# Switch to main branchgit checkout main
# Update main with merged changesgit fetch upstreamgit merge upstream/main
# Delete local feature branchgit branch -d feature/my-feature
# Delete from your fork (if not auto-deleted)git push origin --delete feature/my-featureתרשים זרימת עבודה
Section titled “תרשים זרימת עבודה”graph LR A[Fork Repository] --> B[Clone Fork] B --> C[Create Branch] C --> D[Make Changes] D --> E[Commit & Push] E --> F[Create PR] F --> G{Review} G -->|Approved| H[Merge] G -->|Changes Needed| I[Update PR] I --> G H --> J[Cleanup] J --> K[Done]תרחישים נפוצים
Section titled “תרחישים נפוצים”סנכרון לפני התחלה
Section titled “סנכרון לפני התחלה”# Always start freshgit fetch upstreamgit checkout -b feature/new-thing upstream/mainהוספת התחייבויות נוספות
Section titled “הוספת התחייבויות נוספות”# Just push againgit add .git commit -m "feat: additional changes"git push origin feature/new-thingתיקון טעויות
Section titled “תיקון טעויות”# Last commit has wrong messagegit commit --amend -m "Correct message"git push --force-with-lease
# Revert to previous state (careful!)git reset --soft HEAD~1 # Keep changesgit reset --hard HEAD~1 # Discard changesטיפול בהתנגשויות מיזוג
Section titled “טיפול בהתנגשויות מיזוג”# Rebase and resolve conflictsgit fetch upstreamgit rebase upstream/main
# Edit conflicted files to resolve# Then continuegit add .git rebase --continuegit push --force-with-leaseשיטות עבודה מומלצות
Section titled “שיטות עבודה מומלצות”- שמור סניפים ממוקדים בנושאים בודדים
- בצע התחייבויות קטנות והגיוניות
- כתוב הודעות מחויבות תיאוריות
- עדכן את הסניף שלך לעתים קרובות
- בדוק לפני הדחיפה
- שינויים במסמכים
- היו קשובים למשוב
אל תעשה
Section titled “אל תעשה”- עבודה ישירות על סניף main/master
- מערבבים שינויים לא קשורים ב-PR אחד
- Commit קבצים שנוצרו או node_modules
- דחיפה בכוח לאחר שיחסי ציבור הם ציבוריים (השתמש ב—force-with-חכירה)
- התעלם ממשוב על סקירת קוד
- צור יחסי ציבור ענקיים (פרוץ לקטנים יותר)
- העברת נתונים רגישים (API מפתחות, סיסמאות)
טיפים להצלחה
Section titled “טיפים להצלחה”- שאלו שאלות בנושאים לפני תחילת העבודה
- בקשו הדרכה לגבי שינויים מורכבים
- לדון בגישה בתיאור יחסי הציבור
- השב למשוב מייד
פעל לפי התקנים
Section titled “פעל לפי התקנים”- עיין בתקני PHP
- בדוק את ההנחיות לדיווח על בעיות
- קרא סקירה כללית של תרומה
- פעל לפי הנחיות Pull Request
למד את בסיס הקוד
Section titled “למד את בסיס הקוד”- קרא דפוסי קוד קיימים
- למד יישומים דומים
- להבין את הארכיטקטורה
- בדוק את מושגי ליבה
תיעוד קשור
Section titled “תיעוד קשור”- קוד התנהגות
- משוך הנחיות בקשה
- דיווח על בעיות
- PHP תקני קידוד
- סקירה תורמת
#xoops #git #github #contributing #workflow #pull-request