Skip to content

feat: implement automated Bot SDK changelog system#4707

Open
Crisvond-hnt wants to merge 3 commits into
mainfrom
feature/bot-sdk-changelog-system
Open

feat: implement automated Bot SDK changelog system#4707
Crisvond-hnt wants to merge 3 commits into
mainfrom
feature/bot-sdk-changelog-system

Conversation

@Crisvond-hnt

Copy link
Copy Markdown
Contributor

OVERVIEW

This PR introduces an automated changelog system that tracks and documents all Bot SDK changes by analyzing git commit history. The system prioritizes accuracy and safety over convenience by requiring manual verification for all migration guides.

PROBLEM STATEMENT

Developers building bots had no visibility into Bot SDK changes between versions. Breaking changes would unexpectedly break production bots, and developers had no migration instructions to fix their code.

SOLUTION

Automated changelog generation with human-verified migration guides:

  1. Git History Analysis

    • Scans all commits since last release tag
    • Filters to bot/SDK related commits only (packages/bot, packages/sdk, packages/towns-bot-cli)
    • Categorizes by type: breaking changes, features, fixes, deprecations
  2. Safety Mechanism

    • Never auto-generates code examples (prevents incorrect migration instructions)
    • Requires manual verification for all migration guides
    • Shows affected files and links to commit diffs for transparency
    • Displays 'Migration guide needed' for unverified breaking changes
  3. GitHub Actions Automation

    • Triggers on push to main when bot/SDK files change
    • Auto-generates and commits changelog updates
    • Uses [skip ci] to prevent infinite loops

FILES ADDED

Core System (3 files):

  • scripts/generate-bot-sdk-changelog.ts (400 lines) Main generator script, git history parser, categorization engine

  • scripts/changelog-migration-guides.ts (38 lines) Storage for manually verified migration guides

  • scripts/CHANGELOG_MAINTAINER_GUIDE.md (302 lines) Instructions for maintainers on adding verified migration guides

Automation (1 file):

  • .github/workflows/bot-sdk-changelog.yml (60 lines) GitHub Actions workflow for automatic changelog updates

Output (1 file):

  • packages/docs/build/bots/changelog.mdx (190 lines) Generated changelog documenting 640 bot/SDK commits Visible at /build/bots/changelog in documentation

Documentation (3 files):

  • BOT_SDK_CHANGELOG_README.md (287 lines) Complete system documentation, usage guide, maintenance procedures

  • CHANGES_SUMMARY.md (126 lines) Quick reference of changes and statistics

  • DOCS_CHANGELOG.md (160 lines) Documentation tasks from main branch merge

FILES MODIFIED

  • package.json: Added 'changelog' script and 'simple-git' dependency
  • bun.lock: Locked simple-git@3.30.0
  • packages/docs/docs.json: Added changelog to Bots navigation section
  • packages/docs/build/miniapps/introduction.mdx: Updated to be framework-agnostic

TESTING PERFORMED

  1. Script Execution Test

    • Successfully analyzed 1,567 total commits
    • Correctly filtered to 640 bot/SDK commits (41%)
    • Identified 6 breaking changes, 38 features, 18 fixes
  2. File Generation Test

    • Generated changelog.mdx with 190 lines
    • Proper MDX formatting with frontmatter
    • All sections present and correctly categorized
  3. Navigation Test

    • Verified changelog appears in documentation navigation
    • Correct ordering in Bots section menu
  4. Safety Feature Test

    • Confirmed no auto-generated code examples
    • Migration guides object empty by default
    • Shows 'Migration guide needed' for breaking changes
  5. TypeScript Compilation Test

    • No type errors
    • Readonly array handling fixed
  6. GitHub Actions Configuration Test

    • Workflow file syntax validated
    • Trigger paths configured correctly
    • Permissions set appropriately

STATISTICS

  • Commits analyzed: 1,567
  • Bot/SDK commits: 640 (41%)
  • Breaking changes: 6
  • New features: 38
  • Bug fixes: 18
  • Deprecations: 1
  • Execution time: 3-5 seconds
  • Lines of code: ~500 TypeScript, ~60 YAML
  • Lines of documentation: ~900

TECHNICAL DECISIONS

  1. Manual Migration Verification Required Why: Prevents publishing incorrect migration instructions that would mislead developers and waste their time debugging.

  2. Shows Affected Files Instead of Guessing Why: Transparency lets developers verify changes themselves rather than trusting potentially incorrect automated suggestions.

  3. Links to Commit Diffs Why: Developers can review actual code changes to understand impact on their implementations.

  4. Separate Config for Migration Guides Why: Makes it easy for maintainers to add verified guides without touching generator logic.

USAGE

For Developers:
View changelog at /build/bots/changelog in documentation
Update dependencies: bunx towns-bot update

For Maintainers:
Generate manually: bun run changelog
Add verified migration guide: Edit scripts/changelog-migration-guides.ts

Description

Changes

Checklist

  • Tests added where required
  • Documentation updated where applicable
  • Changes adhere to the repository's contribution guidelines

OVERVIEW
--------
This PR introduces an automated changelog system that tracks and documents
all Bot SDK changes by analyzing git commit history. The system prioritizes
accuracy and safety over convenience by requiring manual verification for
all migration guides.

PROBLEM STATEMENT
-----------------
Developers building bots had no visibility into Bot SDK changes between
versions. Breaking changes would unexpectedly break production bots,
and developers had no migration instructions to fix their code.

SOLUTION
--------
Automated changelog generation with human-verified migration guides:

1. Git History Analysis
   - Scans all commits since last release tag
   - Filters to bot/SDK related commits only (packages/bot, packages/sdk, packages/towns-bot-cli)
   - Categorizes by type: breaking changes, features, fixes, deprecations

2. Safety Mechanism
   - Never auto-generates code examples (prevents incorrect migration instructions)
   - Requires manual verification for all migration guides
   - Shows affected files and links to commit diffs for transparency
   - Displays 'Migration guide needed' for unverified breaking changes

3. GitHub Actions Automation
   - Triggers on push to main when bot/SDK files change
   - Auto-generates and commits changelog updates
   - Uses [skip ci] to prevent infinite loops

FILES ADDED
-----------
Core System (3 files):
  - scripts/generate-bot-sdk-changelog.ts (400 lines)
    Main generator script, git history parser, categorization engine

  - scripts/changelog-migration-guides.ts (38 lines)
    Storage for manually verified migration guides

  - scripts/CHANGELOG_MAINTAINER_GUIDE.md (302 lines)
    Instructions for maintainers on adding verified migration guides

Automation (1 file):
  - .github/workflows/bot-sdk-changelog.yml (60 lines)
    GitHub Actions workflow for automatic changelog updates

Output (1 file):
  - packages/docs/build/bots/changelog.mdx (190 lines)
    Generated changelog documenting 640 bot/SDK commits
    Visible at /build/bots/changelog in documentation

Documentation (3 files):
  - BOT_SDK_CHANGELOG_README.md (287 lines)
    Complete system documentation, usage guide, maintenance procedures

  - CHANGES_SUMMARY.md (126 lines)
    Quick reference of changes and statistics

  - DOCS_CHANGELOG.md (160 lines)
    Documentation tasks from main branch merge

FILES MODIFIED
--------------
  - package.json: Added 'changelog' script and 'simple-git' dependency
  - bun.lock: Locked simple-git@3.30.0
  - packages/docs/docs.json: Added changelog to Bots navigation section
  - packages/docs/build/miniapps/introduction.mdx: Updated to be framework-agnostic

TESTING PERFORMED
-----------------
1. Script Execution Test
   - Successfully analyzed 1,567 total commits
   - Correctly filtered to 640 bot/SDK commits (41%)
   - Identified 6 breaking changes, 38 features, 18 fixes

2. File Generation Test
   - Generated changelog.mdx with 190 lines
   - Proper MDX formatting with frontmatter
   - All sections present and correctly categorized

3. Navigation Test
   - Verified changelog appears in documentation navigation
   - Correct ordering in Bots section menu

4. Safety Feature Test
   - Confirmed no auto-generated code examples
   - Migration guides object empty by default
   - Shows 'Migration guide needed' for breaking changes

5. TypeScript Compilation Test
   - No type errors
   - Readonly array handling fixed

6. GitHub Actions Configuration Test
   - Workflow file syntax validated
   - Trigger paths configured correctly
   - Permissions set appropriately

STATISTICS
----------
- Commits analyzed: 1,567
- Bot/SDK commits: 640 (41%)
- Breaking changes: 6
- New features: 38
- Bug fixes: 18
- Deprecations: 1
- Execution time: 3-5 seconds
- Lines of code: ~500 TypeScript, ~60 YAML
- Lines of documentation: ~900

TECHNICAL DECISIONS
-------------------
1. Manual Migration Verification Required
   Why: Prevents publishing incorrect migration instructions that would
   mislead developers and waste their time debugging.

2. Shows Affected Files Instead of Guessing
   Why: Transparency lets developers verify changes themselves rather than
   trusting potentially incorrect automated suggestions.

3. Links to Commit Diffs
   Why: Developers can review actual code changes to understand impact
   on their implementations.

4. Separate Config for Migration Guides
   Why: Makes it easy for maintainers to add verified guides without
   touching generator logic.

USAGE
-----
For Developers:
  View changelog at /build/bots/changelog in documentation
  Update dependencies: bunx towns-bot update

For Maintainers:
  Generate manually: bun run changelog
  Add verified migration guide: Edit scripts/changelog-migration-guides.ts

NEXT STEPS
----------
After merge:
1. Monitor first GitHub Actions run
2. Verify auto-commit works correctly
3. Begin adding verified migration guides for breaking changes
4. Communicate new changelog location to bot developers

BREAKING CHANGES
----------------
None. This is a new feature that adds documentation capabilities.
Does not modify any existing bot SDK APIs or behavior.
@vercel

vercel Bot commented Dec 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
river-sample-app Ready Ready Preview, Comment Dec 15, 2025 5:08pm

@cursor

cursor Bot commented Dec 15, 2025

Copy link
Copy Markdown

PR Summary

Introduces an automated Bot SDK changelog system with a generator script, CI workflow to auto-update docs, and related documentation/navigation updates.

  • Changelog System:
    • scripts/generate-bot-sdk-changelog.ts: Generate MDX changelog from git history; categorizes features/fixes/deprecations/breaking; safe migration-guide extraction.
    • scripts/changelog-migration-guides.ts: Store verified migration guides.
    • scripts/CHANGELOG_MAINTAINER_GUIDE.md and BOT_SDK_CHANGELOG_README.md: Maintainer/developer docs.
  • Automation (CI):
    • .github/workflows/bot-sdk-changelog.yml: Runs on bot/SDK changes; handles exit codes; detects untracked changes; auto-commits packages/docs/build/bots/changelog.mdx.
  • Docs Output & Navigation:
    • Adds generated packages/docs/build/bots/changelog.mdx and links it in packages/docs/docs.json under Bots.
    • Adds DOCS_CHANGELOG.md; updates miniapps intro to be framework-agnostic.
  • Tooling:
    • package.json: Adds changelog script and simple-git dev dependency.
    • bun.lock: Locks simple-git.

Written by Cursor Bugbot for commit 91507e4. This will update automatically on new commits. Configure here.

Comment thread scripts/generate-bot-sdk-changelog.ts Outdated
Comment thread .github/workflows/bot-sdk-changelog.yml Outdated
Comment thread BOT_SDK_CHANGELOG_README.md Outdated
Comment thread .github/workflows/bot-sdk-changelog.yml Outdated
@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds an automated Bot SDK changelog system: generator and migration-guide registry, maintainer docs, a GitHub Actions workflow to generate and commit changelogs, a generated MDX changelog, and related docs/config updates.

Changes

Cohort / File(s) Summary
Workflow
​.github/workflows/bot-sdk-changelog.yml
New GitHub Actions workflow to generate and commit the Bot SDK changelog on main pushes for targeted package paths and via manual dispatch; checks out full history, installs Bun, runs the changelog script, handles exit codes, and commits/pushes changes if produced.
Generator & Migration Registry
scripts/generate-bot-sdk-changelog.ts, scripts/changelog-migration-guides.ts
New TypeScript generator that scans git history, filters commits touching bot/SDK packages, categorizes changes (breaking, feature, fix, docs, deprecation), groups by version, writes MDX output, and exits non‑zero on breaking changes; migration guides exported as a MIGRATION_GUIDES record (initially empty/commented).
Maintainer & System Docs
BOT_SDK_CHANGELOG_README.md, scripts/CHANGELOG_MAINTAINER_GUIDE.md, DOCS_CHANGELOG.md
New documentation: system README, maintainer guide for writing/verifying migration guides, and a documentation changelog summarizing doc-related actions and priorities.
Generated Output
packages/docs/build/bots/changelog.mdx
New generated changelog MDX (versioned, dated) containing Breaking Changes, Deprecations, New Features, Fixes, Documentation entries, commit links, affected files, and update instructions.
Repo Config & Dependencies
package.json, bun.lock
Added changelog script (runs generator) and added/locked simple-git dependency (pin in bun.lock).
Docs Navigation & Minor Edits
packages/docs/docs.json, packages/docs/build/miniapps/introduction.mdx
Added changelog page to Bots navigation; minor spacing/formatting adjustment in miniapps introduction.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus review on:
    • Commit filtering and path-scoping logic in scripts/generate-bot-sdk-changelog.ts
    • Categorization heuristics (breaking vs. feature vs. fix) and exit-code semantics used by CI/workflow
    • Interaction with scripts/changelog-migration-guides.ts to ensure migration guidance is surfaced only when intended
    • Workflow commit/push steps, runner permissions, and handling of exit codes in .github/workflows/bot-sdk-changelog.yml

Suggested reviewers

  • miguel-nascimento
  • sergekh2
  • texuf

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Title 'feat: implement automated Bot SDK changelog system' clearly and specifically describes the main change—introducing an automated changelog system for the Bot SDK. It directly aligns with the changeset's core objective.
Description check ✅ Passed Description provides comprehensive, well-structured documentation covering problem statement, solution details, files added/modified, testing, statistics, and usage. It is directly related to the changeset and conveys meaningful information about the Bot SDK changelog system.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/bot-sdk-changelog-system

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (5)
.github/workflows/bot-sdk-changelog.yml (1)

27-29: Consider pinning the Bun version.

Using bun-version: latest can lead to unpredictable CI behavior if a new Bun version introduces breaking changes.

           - name: Setup Bun
             uses: oven-sh/setup-bun@v1
             with:
-                bun-version: latest
+                bun-version: 1.1.x
BOT_SDK_CHANGELOG_README.md (1)

29-29: Add language identifier to fenced code block.

Specify a language for the ASCII diagram (e.g., text or plaintext).

-```
+```text
 Developer Push (bot/SDK changes)
scripts/generate-bot-sdk-changelog.ts (2)

112-112: Consider using proper types for git parameter.

Using any loses type safety. Import SimpleGit type from simple-git.

+import simpleGit, { SimpleGit } from 'simple-git'
 ...
-async function filterBotSDKCommits(git: any, commits: any[]): Promise<CommitInfo[]> {
+async function filterBotSDKCommits(git: SimpleGit, commits: any[]): Promise<CommitInfo[]> {

296-297: Unused variable now.

now is declared but never used.

 function generateChangelog(grouped: VersionChanges[]): string {
-    const now = new Date().toISOString().split('T')[0]
-
     let md = `---
CHANGES_SUMMARY.md (1)

76-76: Hyphenate compound adjective.

"Developer Friendly" should be "Developer-friendly" when used as a compound adjective modifying the noun phrase that follows.

-### Developer Friendly
+### Developer-friendly
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 84bc120 and 91decc4.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock, !bun.lock
  • package.json is excluded by !package.json
📒 Files selected for processing (10)
  • .github/workflows/bot-sdk-changelog.yml (1 hunks)
  • BOT_SDK_CHANGELOG_README.md (1 hunks)
  • CHANGES_SUMMARY.md (1 hunks)
  • DOCS_CHANGELOG.md (1 hunks)
  • packages/docs/build/bots/changelog.mdx (1 hunks)
  • packages/docs/build/miniapps/introduction.mdx (0 hunks)
  • packages/docs/docs.json (1 hunks)
  • scripts/CHANGELOG_MAINTAINER_GUIDE.md (1 hunks)
  • scripts/changelog-migration-guides.ts (1 hunks)
  • scripts/generate-bot-sdk-changelog.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/docs/build/miniapps/introduction.mdx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx,yaml,yml,sol,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

All non-Go files (TypeScript, JavaScript, YAML, Solidity) must pass Prettier formatting by running bun run prettier:fix

Files:

  • scripts/CHANGELOG_MAINTAINER_GUIDE.md
  • DOCS_CHANGELOG.md
  • scripts/generate-bot-sdk-changelog.ts
  • packages/docs/docs.json
  • BOT_SDK_CHANGELOG_README.md
  • scripts/changelog-migration-guides.ts
  • CHANGES_SUMMARY.md
🧠 Learnings (6)
📚 Learning: 2025-11-25T08:44:36.255Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: packages/contracts/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:44:36.255Z
Learning: Applies to packages/contracts/**/AGENTS.md : Maintain AGENTS.md file with agent documentation and guidelines

Applied to files:

  • scripts/CHANGELOG_MAINTAINER_GUIDE.md
📚 Learning: 2025-12-06T01:22:08.487Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T01:22:08.487Z
Learning: Do NOT mention AI assistants or automated generation in git commit messages

Applied to files:

  • scripts/CHANGELOG_MAINTAINER_GUIDE.md
📚 Learning: 2025-11-25T08:48:39.130Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: packages/bot/AGENTS.md:0-0
Timestamp: 2025-11-25T08:48:39.130Z
Learning: Applies to packages/bot/**/*.{ts,tsx} : Pass the commands array to `makeTownsBot()` initialization in TypeScript bot setup files

Applied to files:

  • packages/docs/build/bots/changelog.mdx
  • scripts/generate-bot-sdk-changelog.ts
📚 Learning: 2025-11-25T08:48:39.130Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: packages/bot/AGENTS.md:0-0
Timestamp: 2025-11-25T08:48:39.130Z
Learning: Applies to packages/bot/**/*.{ts,tsx} : Call `bot.start()` to obtain JWT middleware and handler for setting up the Towns webhook endpoint in Hono/Express TypeScript server files

Applied to files:

  • packages/docs/build/bots/changelog.mdx
📚 Learning: 2025-12-08T20:20:53.994Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: packages/examples/bot-quickstart/AGENTS.md:0-0
Timestamp: 2025-12-08T20:20:53.994Z
Learning: Applies to packages/examples/bot-quickstart/**/*.{ts,tsx} : Store required credentials (APP_PRIVATE_DATA and JWT_SECRET) as environment variables and pass them to makeTownsBot().

Applied to files:

  • packages/docs/build/bots/changelog.mdx
📚 Learning: 2025-11-25T08:48:39.130Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: packages/bot/AGENTS.md:0-0
Timestamp: 2025-11-25T08:48:39.130Z
Learning: Applies to packages/bot/**/*.{ts,tsx} : Import types `BotHandler`, `BasePayload`, and `MessageOpts` from `towns-protocol/bot` package when building abstractions and helper functions for bot handlers

Applied to files:

  • packages/docs/build/bots/changelog.mdx
🪛 LanguageTool
DOCS_CHANGELOG.md

[grammar] ~44-~44: Ensure spelling is correct
Context: ...ply Handling** (e273ed8) - SDK uses onchain free supply instead of hardcoding - ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

BOT_SDK_CHANGELOG_README.md

[grammar] ~21-~21: Use a hyphen to join words.
Context: ...*: Scans git history to find all bot/SDK related commits 2. Categorization: C...

(QB_NEW_EN_HYPHEN)


[uncategorized] ~67-~67: The official name of this software platform is spelled with a capital “H”.
Context: ...mplate and examples ### Automation .github/workflows/bot-sdk-changelog.yml - Tri...

(GITHUB)

CHANGES_SUMMARY.md

[uncategorized] ~15-~15: The official name of this software platform is spelled with a capital “H”.
Context: ...ce guide - Testing procedures 2. .github/workflows/bot-sdk-changelog.yml - ...

(GITHUB)


[uncategorized] ~76-~76: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...ry - No manual intervention needed ### Developer Friendly - Clear categorization (Breaking, Featu...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

🪛 markdownlint-cli2 (0.18.1)
BOT_SDK_CHANGELOG_README.md

29-29: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


49-49: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


55-55: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


60-60: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


67-67: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


74-74: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


149-149: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


156-156: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


163-163: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


169-169: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (9)
packages/docs/docs.json (1)

153-153: LGTM!

Changelog placed logically in the Bots navigation.

DOCS_CHANGELOG.md (1)

1-159: LGTM!

Well-structured tracking document for pending documentation updates. The "onchain" spelling (line 44) is acceptable industry terminology.

scripts/changelog-migration-guides.ts (1)

33-37: LGTM!

Empty-by-default design ensures no auto-generated migration content. Safe approach.

scripts/CHANGELOG_MAINTAINER_GUIDE.md (1)

1-301: LGTM!

Comprehensive maintainer guide with clear templates and safety emphasis.

packages/docs/build/bots/changelog.mdx (1)

1-190: LGTM!

Generated changelog follows safe patterns—no fabricated code examples, proper placeholders for migration guides.

scripts/generate-bot-sdk-changelog.ts (2)

162-173: Breaking change detection may produce false positives.

The keywords 'removed' and 'deprecated' in breakingKeywords may match commits that aren't actually breaking (e.g., "removed unused import"). Consider requiring BREAKING CHANGE: in body or stricter patterns.


56-110: LGTM!

Main function flow is clear: version detection → commit filtering → categorization → grouping → generation → output.

CHANGES_SUMMARY.md (2)

1-125: Verify Prettier formatting compliance.

Per the coding guidelines, Markdown files must pass Prettier formatting by running bun run prettier:fix. Please verify this file complies with Prettier standards.


1-125: Well-structured summary document.

The file provides a clear, comprehensive overview of the Bot SDK Changelog System changes. The organization into sections (New Files, Modified Files, Key Features, Statistics, Testing, Usage, Next Steps) is logical and easy to follow. Content aligns with the PR objectives and accurately reflects the scope of changes. Safety-first philosophy is well-communicated.

Comment thread .github/workflows/bot-sdk-changelog.yml Outdated
Comment thread BOT_SDK_CHANGELOG_README.md
ISSUES FIXED
------------

1. Deprecation Misclassification
   - Removed 'deprecated' from breakingKeywords array
   - Deprecation commits now properly categorized as DEPRECATION
   - Before: 6 breaking changes (1 was actually deprecation)
   - After: 5 breaking changes (correct)
   - File: scripts/generate-bot-sdk-changelog.ts

2. Workflow First-Run Failure
   - Changed from 'git diff --quiet' to 'git status --porcelain'
   - Now detects newly generated untracked files
   - Changelog will be committed on first workflow run
   - File: .github/workflows/bot-sdk-changelog.yml

3. Workflow Error Masking
   - Replaced '|| true' with proper exit code checking
   - Only accepts exit code 1 (breaking changes) as non-error
   - Real errors now properly fail the workflow
   - Better debugging when genuine failures occur
   - File: .github/workflows/bot-sdk-changelog.yml

4. Hardcoded Local Path
   - Removed '/Users/crisvond/Towns-protocol/towns' from docs
   - Documentation now portable for all contributors
   - Uses 'from repository root' instructions
   - File: BOT_SDK_CHANGELOG_README.md

TECHNICAL DETAILS
-----------------

Script Changes (generate-bot-sdk-changelog.ts):
  - Line 13: Removed 'deprecated' from breakingKeywords
  - Deprecation check at lines 175-178 now runs correctly
  - Commits with 'deprecated' reach DEPRECATION classification

Workflow Changes (bot-sdk-changelog.yml):
  - Lines 34-45: Proper exit code handling (0, 1, or error)
  - Lines 47-53: Use 'git status --porcelain' for change detection
  - Detects both modified tracked and new untracked files
  - Fails fast on genuine errors with correct exit codes

Documentation Changes:
  - BOT_SDK_CHANGELOG_README.md: Generic path instructions
  - CHANGES_SUMMARY.md: Added bug fixes section with details

TESTING
-------
- Regenerated changelog: Now shows 5 breaking (was 6)
- Exit code 1 for breaking changes (expected)
- All files formatted with prettier
- Ready for workflow testing on merge

IMPACT
------
- More accurate commit categorization
- Reliable first-run workflow execution
- Better error reporting and debugging
- Portable documentation for all devs
Comment thread scripts/generate-bot-sdk-changelog.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (5)
scripts/generate-bot-sdk-changelog.ts (2)

68-75: Make the no-tag fallback robust for short histories.

Using HEAD~${CONFIG.defaultCommitLimit} when there are no tags can fail if the repo has fewer than that many commits. Consider falling back to “last N commits” via git.log({ maxCount: CONFIG.defaultCommitLimit }) instead of constructing a potentially invalid revision:

-    const tags = await git.tags()
-    const lastTag = tags.latest || `HEAD~${CONFIG.defaultCommitLimit}`
-    console.log(`Last tag: ${lastTag}`)
-
-    // 3. Get commits since last tag
-    const log = await git.log({ from: lastTag, to: 'HEAD' })
+    const tags = await git.tags()
+    let log
+    if (tags.latest) {
+        console.log(`Last tag: ${tags.latest}`)
+        log = await git.log({ from: tags.latest, to: 'HEAD' })
+    } else {
+        console.log(`No tags found, using last ${CONFIG.defaultCommitLimit} commits`)
+        log = await git.log({ maxCount: CONFIG.defaultCommitLimit })
+    }

297-303: Remove unused now variable from generateChangelog.

now is computed but never used; dropping it will keep the function clean and avoid unused-variable noise.

-    const now = new Date().toISOString().split('T')[0]
-
     let md = `---
BOT_SDK_CHANGELOG_README.md (3)

211-225: Clarify how to key MIGRATION_GUIDES so lookups actually match.

extractMigrationGuide indexes MIGRATION_GUIDES by the cleaned message used as the changelog heading (after stripping feat:/fix: prefixes and PR numbers), not the raw commit subject. The example here says "Exact commit message", which can be misleading.

Suggest rephrasing to something like “Exact changelog heading (copy from the Breaking Changes section)” and updating the placeholder accordingly, so maintainers copy the value that the script will actually use as the key.


30-45: Optional: add a language to the architecture code block for markdown linters.

The ASCII architecture block has a bare ``` fence; if you care about markdownlint/MD040, you can tag it as text (or similar):

-```
+```text
 Developer Push (bot/SDK changes)

288-295: Keep stats consistent with the single source of truth.

The stats here (1,567 commits, 6 breaking, etc.) differ slightly from CHANGES_SUMMARY.md (1,568 commits, 5 breaking). Consider picking one file as authoritative and updating the other to match to avoid confusion later.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91decc4 and b33ea97.

📒 Files selected for processing (5)
  • .github/workflows/bot-sdk-changelog.yml (1 hunks)
  • BOT_SDK_CHANGELOG_README.md (1 hunks)
  • CHANGES_SUMMARY.md (1 hunks)
  • packages/docs/build/bots/changelog.mdx (1 hunks)
  • scripts/generate-bot-sdk-changelog.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/docs/build/bots/changelog.mdx
  • .github/workflows/bot-sdk-changelog.yml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx,yaml,yml,sol,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

All non-Go files (TypeScript, JavaScript, YAML, Solidity) must pass Prettier formatting by running bun run prettier:fix

Files:

  • scripts/generate-bot-sdk-changelog.ts
  • BOT_SDK_CHANGELOG_README.md
  • CHANGES_SUMMARY.md
🧬 Code graph analysis (1)
scripts/generate-bot-sdk-changelog.ts (1)
scripts/changelog-migration-guides.ts (1)
  • MIGRATION_GUIDES (33-37)
🪛 LanguageTool
BOT_SDK_CHANGELOG_README.md

[grammar] ~22-~22: Use a hyphen to join words.
Context: ...*: Scans git history to find all bot/SDK related commits 2. Categorization: C...

(QB_NEW_EN_HYPHEN)


[uncategorized] ~71-~71: The official name of this software platform is spelled with a capital “H”.
Context: ...mplate and examples ### Automation .github/workflows/bot-sdk-changelog.yml - Tr...

(GITHUB)

CHANGES_SUMMARY.md

[uncategorized] ~15-~15: The official name of this software platform is spelled with a capital “H”.
Context: ...ce guide - Testing procedures 2. .github/workflows/bot-sdk-changelog.yml - ...

(GITHUB)

🪛 markdownlint-cli2 (0.18.1)
BOT_SDK_CHANGELOG_README.md

30-30: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


50-50: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


57-57: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


63-63: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


71-71: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


79-79: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


163-163: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


172-172: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


181-181: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


189-189: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Common_CI
  • GitHub Check: Multinode
  • GitHub Check: Go_Tests
  • GitHub Check: Multinode_Ent
  • GitHub Check: Multinode_Ent_Legacy
  • GitHub Check: Cursor Bugbot
  • GitHub Check: XChain_Integration
🔇 Additional comments (1)
CHANGES_SUMMARY.md (1)

3-61: Summary matches the implemented system.

The description of new/modified files and bug fixes (deprecation classification, workflow handling, hardcoded path) matches the current script and docs; nothing blocking here.

Comment thread BOT_SDK_CHANGELOG_README.md
Comment thread scripts/generate-bot-sdk-changelog.ts
…codes

CRITICAL ISSUES FIXED
---------------------

1. Incorrect Repository URL
   - Changed from 'river-build/river' to 'towns-protocol/towns'
   - All commit links in changelog now point to correct repository
   - Previously all 'View commit' links were broken
   - File: scripts/generate-bot-sdk-changelog.ts:11

2. Exit Code Collision
   - Changed error exit code from 1 to 2
   - Exit code 1 reserved for breaking changes (expected)
   - Exit code 2 for real errors (git failures, missing files, etc.)
   - Workflow can now distinguish errors from breaking changes
   - Files: scripts/generate-bot-sdk-changelog.ts:402

3. Documentation Mismatch
   - Updated to reflect actual classification logic
   - 'removed' keyword is BREAKING, not deprecation
   - Added exit code documentation
   - File: BOT_SDK_CHANGELOG_README.md

IMPACT
------

Before:
- All commit links pointed to wrong repository (404 errors)
- Errors silently treated as breaking changes in CI
- Documentation didn't match actual behavior

After:
- All commit links work correctly
- Errors properly fail the workflow
- Documentation accurate and complete

TESTING
-------

Regenerated changelog:
- Verified commit links point to towns-protocol/towns
- Exit code 1 for breaking changes (expected)
- 640 commits documented correctly

Exit Code Behavior:
- 0 = Success, no breaking changes
- 1 = Success with breaking changes (workflow continues)
- 2 = Error (workflow fails)

FILES CHANGED
-------------
- scripts/generate-bot-sdk-changelog.ts: Fixed repoUrl and exit code
- BOT_SDK_CHANGELOG_README.md: Updated docs to match implementation
- packages/docs/build/bots/changelog.mdx: Regenerated with correct links

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
BOT_SDK_CHANGELOG_README.md (1)

30-44: Tighten markdown to satisfy markdownlint (MD040/MD036).

  • The architecture diagram fence at Lines 30–44 has no language; to satisfy MD040, consider ```text (or ```bash / ```md where appropriate).
  • Several bold “headings” (e.g., file names around Lines 50–79 and test labels around Lines 174–200) trigger MD036; consider turning these into real headings (e.g., #### scripts/generate-bot-sdk-changelog.ts, #### Test 1: Generate Changelog) to keep markdownlint happy while preserving structure.

Also applies to: 50-79, 174-200

scripts/generate-bot-sdk-changelog.ts (1)

67-75: Use maxCount instead of brittle HEAD~N fallback for small repositories.

When no tags exist, the code uses HEAD~${CONFIG.defaultCommitLimit} as the from ref (line 69), which fails on repositories with fewer commits than the limit. For instance, HEAD~100..HEAD will error on a repo with fewer than 100 commits. Prefer a maxCount-based approach: git.log({ to: 'HEAD', maxCount: CONFIG.defaultCommitLimit }) when !tags.latest to safely limit history regardless of commit depth.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b33ea97 and 91507e4.

📒 Files selected for processing (3)
  • BOT_SDK_CHANGELOG_README.md (1 hunks)
  • packages/docs/build/bots/changelog.mdx (1 hunks)
  • scripts/generate-bot-sdk-changelog.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/docs/build/bots/changelog.mdx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx,yaml,yml,sol,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

All non-Go files (TypeScript, JavaScript, YAML, Solidity) must pass Prettier formatting by running bun run prettier:fix

Files:

  • scripts/generate-bot-sdk-changelog.ts
  • BOT_SDK_CHANGELOG_README.md
🧠 Learnings (2)
📚 Learning: 2025-11-25T08:44:29.555Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: packages/bot/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:44:29.555Z
Learning: Applies to packages/bot/**/AGENTS.md : All agent configurations and specifications should be documented in AGENTS.md

Applied to files:

  • BOT_SDK_CHANGELOG_README.md
📚 Learning: 2025-11-25T08:44:41.031Z
Learnt from: CR
Repo: towns-protocol/towns PR: 0
File: packages/examples/bot-quickstart/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:44:41.031Z
Learning: Applies to packages/examples/bot-quickstart/**/AGENTS.md : Document agent configurations and behaviors in AGENTS.md

Applied to files:

  • BOT_SDK_CHANGELOG_README.md
🧬 Code graph analysis (1)
scripts/generate-bot-sdk-changelog.ts (1)
scripts/changelog-migration-guides.ts (1)
  • MIGRATION_GUIDES (33-37)
🪛 LanguageTool
BOT_SDK_CHANGELOG_README.md

[grammar] ~22-~22: Use a hyphen to join words.
Context: ...*: Scans git history to find all bot/SDK related commits 2. Categorization: C...

(QB_NEW_EN_HYPHEN)


[uncategorized] ~71-~71: The official name of this software platform is spelled with a capital “H”.
Context: ...mplate and examples ### Automation .github/workflows/bot-sdk-changelog.yml - Tr...

(GITHUB)

🪛 markdownlint-cli2 (0.18.1)
BOT_SDK_CHANGELOG_README.md

30-30: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


50-50: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


57-57: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


63-63: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


71-71: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


79-79: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


174-174: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


183-183: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


192-192: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


200-200: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Go_Tests
  • GitHub Check: Multinode_Ent
  • GitHub Check: Multinode_Ent_Legacy
  • GitHub Check: Common_CI
  • GitHub Check: Multinode
  • GitHub Check: Cursor Bugbot
  • GitHub Check: XChain_Integration
🔇 Additional comments (2)
BOT_SDK_CHANGELOG_README.md (1)

149-168: Change‑detection docs now align with implementation.

The “Change Detection” bullets correctly describe the current detectChangeType logic (breaking/deprecation keywords and conventional prefixes), which keeps expectations in sync with the generator script.

scripts/generate-bot-sdk-changelog.ts (1)

96-109: Changelog generation + exit-code contract look solid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant