PR #951: The Proof
Ngày 25 tháng 6 — hai ngày sau khi deploy Preflight system lên production.
Một developer mở PR #951 với 8 file conflict cùng lúc:
data/seo-qa-scores.jsondata/build-dashboard.jsonregistry.jsontemplates/base.htmlCHANGELOG.mdscripts/config.yamlcontent/posting/abc.mdpackage.json
Developer không làm gì cả. Chỉ đẩy branch lên.
Preflight Detected Instantly
14:32 PM — 2 phút sau push, Preflight workflow chạy:
✅ Preflight Check Started
🔍 Testing merge with origin/main...
⚠️ CONFLICTS DETECTED (8 files)
Files in conflict:
- data/seo-qa-scores.json
- data/build-dashboard.json
- registry.json
- templates/base.html
- CHANGELOG.md
- scripts/config.yaml
- content/posting/abc.md
- package.json
💡 Add 'auto-resolve' label to auto-fix safe conflicts
Developer thấy comment, hiểu ngay là có conflict. Không cần lục lọi log.
Auto-Resolve Label Triggers
Developer click label auto-resolve. Auto-Resolve workflow bắt đầu chạy.
Step 1: Classification (30 seconds)
autofix_conflicts.py classify:
- data/seo-qa-scores.json → "generated" (take main)
- data/build-dashboard.json → "generated" (take main)
- registry.json → "registry" (merge both)
- templates/base.html → "template" (manual)
- CHANGELOG.md → "changelog" (combine)
- scripts/config.yaml → "unknown" (check manually)
- content/posting/abc.md → "content" (keep PR)
- package.json → "generated" (take main)Step 2: Auto-Resolution (2 minutes)
✅ Resolved generated files (data/*.json, package.json)
- Took main's version (freshest)
- Regenerated data files with regenerate_data.py
✅ Resolved registry.json
- Merged both sides (union)
- 5 entries from PR + 3 entries from main = 8 entries total
✅ Resolved CHANGELOG.md
- Combined entries from both versions
- Sorted by date
⚠️ Cannot auto-resolve (manual review needed):
- templates/base.html (preserve intent)
- scripts/config.yaml (complex merge)
✅ Kept content/posting/abc.md from PR
- Authorial intent preserved
- No overwrites on content filesStep 3: QA Validation (3 minutes)
🔍 Running QA checks:
✅ No conflict markers remain
✅ Zola build: SUCCESS
✅ Internal links: OK
✅ SEO compliance: OK
✅ No secrets detected
✅ All schemas valid
📊 QA Summary: ALL CHECKS PASSED ✅Step 4: Push with Retry (1 minute)
📤 Pushing to PR branch...
Attempt 1: Success ✅
git push origin HEAD:pull/951/head
Branch updated. Preflight re-checks...
✅ No remaining conflicts
✅ Ready for merge
Total Time: 6 Minutes vs. 52 Minutes
Cách cũ (manual): 52 phút resolve conflict + QA fail + fix + re-push
Cách mới (auto): 6 phút, không cần developer nhúng tay
What Humans Needed to Do Before
- Clone repo → 5 min
- Fetch origin/main → 1 min
- Try merge, see 8 files conflict → 2 min (panic)
- Resolve data/*.json → 15 min (decide which version)
- Resolve registry.json → 10 min (understand structure)
- Resolve CHANGELOG.md → 8 min (manually combine)
- templates/base.html → 5 min (inspect intent)
- Run QA locally → 3 min
- QA fail? Fix + retry → 10 min
- Push → 2 min
- Wait for CI → 5 min
Total: 66 minutes of human effort
What Automation Did
- Detect → 2 min (automatic)
- Classify → 30 sec (deterministic)
- Resolve safe files → 2 min (rule-based)
- QA validation → 3 min (script)
- Push with retry → 1 min (automatic)
Total: 6 minutes, zero human effort for safe conflicts
Manual Work Still Needed
Templates/config files still need human review:
- templates/base.html
- scripts/config.yaml
Developer gets specific report:
⚠️ Manual Resolution Needed:
1. templates/base.html
- Line 32: conditional merge
- Review both <<<<<<, =====, >>>>> sections
- Preserve CSS logic from main
- Keep new component from PR
2. scripts/config.yaml
- Both sides added new keys
- No conflict, just different keys
- Merge manually: take both sections
Developer spends 5 minutes instead of 45 minutes, focused only on the actually complex parts.
Metrics After Two Weeks
We tracked 15 PRs with conflicts:
| Metric | Before | After | Improvement |
|---|---|---|---|
| Avg conflict resolution time | 48 min | 7 min | 85% faster |
| Auto-resolve rate | 0% | 74% | 74% fewer manual |
| QA re-run rate | 3.2/PR | 0.4/PR | 88% less retrying |
| Human effort per conflict | 48 min | 8 min | 83% saved |
| Merge success on first try | 31% | 92% | +61% |
Safety Checks Built In
Automation không có risk vì:
- Protocol-based — không guessing, always follow rules
- Regeneration-safe — generated files được tạo lại, không stale
- QA gated — nếu QA fail, không push
- Reversible — mỗi commit có thể revert nếu cần
- Observable — mỗi step logged, không silent failure
Phần Tiếp Theo
Part 4: Preflight Catching Conflicts Before Merge — Tại sao catch conflict sớm thì better hơn resolve muộn?
Tài Liệu Tham Khảo
Kiểm tra cuối:
© 2024–2026 SEOMONEY. Mọi thắc mắc: contact@seomoney.org