feat(devgen/modules): categorize committypes and improve changelog/release note formattingAdd separate categories for Performance, Refactor, Tests, Style, and Chore; update ordering and emojis; improve remote push detection and fetch strategy; enhance error logging.

- New Features  - Introduced distinct sections for Performance, Refactor, Tests, Style, and Chore in changelog generation.
  - Added dedicated emojis for each new category.
  - Updated section ordering to reflect the new categories.
- Enhancements
  - Enhanced push logic to fetch upstream before push, avoiding non‑fast‑forward rejections.
  - Refactored `is_ahead_of_remote` with a fetch flag to reduce network calls and TOCTOU windows.
  - Improved error logging with full traceback for group processing failures.
- Bug Fixes
  - Fixed emoji mappings for "Style" and "Other Changes".
  - Corrected handling of empty upstream ref to prevent errors.
  - Ensured proper exception handling when remote branch is missing.
This commit is contained in:
sankalp committed 2026-06-06 16:27:12 +05:45
1 parent 51d2b7549f
commit fd3ce03484
3 files changed
+81 -27

No files matched your search

+22 -12
View File
@@ -87,16 +87,16 @@ class ChangelogGenerator:
groups["Bug Fixes"].append(entry)
elif c_type in ["docs"]:
groups["Documentation"].append(entry)
elif c_type in [
"style",
"refactor",
"perf",
"test",
"build",
"ci",
"chore",
]:
groups["Other Changes"].append(entry)
elif c_type == "perf":
groups["Performance"].append(entry)
elif c_type == "refactor":
groups["Refactor"].append(entry)
elif c_type == "test":
groups["Tests"].append(entry)
elif c_type == "style":
groups["Style"].append(entry)
elif c_type in ["build", "ci", "chore"]:
groups["Chore"].append(entry)
else:
groups["Other Changes"].append(entry)
else:
@@ -122,12 +122,17 @@ class ChangelogGenerator:
date_str = datetime.now().strftime("%Y-%m-%d")
md = [f"## {version} ({date_str})\n"]
# Order: Breaking, Features, Fixes, Docs, Others
# Order: Breaking, Features, Fixes, Docs, Refactor, Perf, Tests, Style, Chore, Others
order = [
"BREAKING CHANGES",
"Features",
"Bug Fixes",
"Performance",
"Documentation",
"Refactor",
"Tests",
"Style",
"Chore",
"Other Changes",
]
@@ -135,8 +140,13 @@ class ChangelogGenerator:
"BREAKING CHANGES": "💥 BREAKING CHANGES",
"Features": "✨ Features",
"Bug Fixes": "🐛 Bug Fixes",
"Performance": "⚡ Performance",
"Documentation": "📚 Documentation",
"Other Changes": "🔨 Other Changes",
"Refactor": "♻️ Refactor",
"Tests": "✅ Tests",
"Style": "💄 Style",
"Chore": "🔧 Chore",
"Other Changes": "🧹 Other Changes",
}
for section in order: