Improve release changelog and fix MCP port

Generate structured changelogs from completed stories instead of raw
commit messages. Group by features, bug fixes, and refactors. Filter
out story-kit automation commits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-03-17 16:42:48 +00:00
parent 8defd5c671
commit e74c370c7e
3 changed files with 81 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
"mcpServers": {
"story-kit": {
"type": "http",
"url": "http://localhost:3010/mcp"
"url": "http://localhost:3001/mcp"
}
}
}

2
Cargo.lock generated
View File

@@ -3997,7 +3997,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
[[package]]
name = "story-kit"
version = "0.1.0"
version = "0.2.0"
dependencies = [
"async-stream",
"async-trait",

View File

@@ -71,20 +71,93 @@ ls -lh "${DIST}"/
echo "==> Generating changelog..."
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
CHANGELOG=$(git log "${PREV_TAG}..HEAD" --pretty=format:"- %s" --no-merges)
LOG_RANGE="${PREV_TAG}..HEAD"
RANGE="${PREV_TAG}...${TAG}"
else
CHANGELOG=$(git log --pretty=format:"- %s" --no-merges)
LOG_RANGE=""
RANGE="initial...${TAG}"
fi
if [ -z "$CHANGELOG" ]; then
CHANGELOG="- No changes since last release"
# Extract completed stories/bugs/refactors from "story-kit: merge <id>" commits.
# Deduplicate (a story may have been merged more than once after reverts).
if [ -n "$LOG_RANGE" ]; then
MERGED_RAW=$(git log "$LOG_RANGE" --pretty=format:"%s" --no-merges \
| grep "^story-kit: merge " | sed 's/^story-kit: merge //' | sort -u)
else
MERGED_RAW=$(git log --pretty=format:"%s" --no-merges \
| grep "^story-kit: merge " | sed 's/^story-kit: merge //' | sort -u)
fi
RELEASE_BODY="## What's Changed
# Categorise merged work items and format names.
FEATURES=""
FIXES=""
REFACTORS=""
while IFS= read -r item; do
[ -z "$item" ] && continue
# Strip the numeric prefix and type to get the human name.
name=$(echo "$item" | sed -E 's/^[0-9]+_(story|bug|refactor|spike)_//' | tr '_' ' ')
# Capitalise first letter.
name="$(echo "${name:0:1}" | tr '[:lower:]' '[:upper:]')${name:1}"
case "$item" in
*_bug_*) FIXES="${FIXES}- ${name}\n" ;;
*_refactor_*) REFACTORS="${REFACTORS}- ${name}\n" ;;
*) FEATURES="${FEATURES}- ${name}\n" ;;
esac
done <<< "$MERGED_RAW"
${CHANGELOG}
# Collect non-automation manual commits (direct fixes, version bumps, etc).
if [ -n "$LOG_RANGE" ]; then
MANUAL=$(git log "$LOG_RANGE" --pretty=format:"%s" --no-merges \
| grep -v "^story-kit: " \
| grep -v "^Revert \"story-kit: " \
| grep -v "^Bump version" \
| sed 's/^/- /')
else
MANUAL=$(git log --pretty=format:"%s" --no-merges \
| grep -v "^story-kit: " \
| grep -v "^Revert \"story-kit: " \
| grep -v "^Bump version" \
| sed 's/^/- /')
fi
# Assemble the release body.
RELEASE_BODY="## What's Changed"
if [ -n "$FEATURES" ]; then
RELEASE_BODY="${RELEASE_BODY}
### Features
$(echo -e "$FEATURES")"
fi
if [ -n "$FIXES" ]; then
RELEASE_BODY="${RELEASE_BODY}
### Bug Fixes
$(echo -e "$FIXES")"
fi
if [ -n "$REFACTORS" ]; then
RELEASE_BODY="${RELEASE_BODY}
### Refactors
$(echo -e "$REFACTORS")"
fi
if [ -n "$MANUAL" ]; then
RELEASE_BODY="${RELEASE_BODY}
### Other Changes
${MANUAL}"
fi
if [ -z "$FEATURES" ] && [ -z "$FIXES" ] && [ -z "$REFACTORS" ] && [ -z "$MANUAL" ]; then
RELEASE_BODY="${RELEASE_BODY}
- No changes since last release"
fi
RELEASE_BODY="${RELEASE_BODY}
**Full diff:** ${GITEA_URL}/${REPO}/compare/${RANGE}"