-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add automated changelog generation with git-cliff #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
cd227b6
c2a9438
e6dd7d8
57ed99a
3872bd4
b886701
1e550d6
e9cca99
192e814
4cce595
f5c5000
dcd9d89
336b19b
efd500f
0297c98
685a7db
a9d317a
4f93f8c
6351412
caf5468
ea78b0a
d373b6b
8d48903
cea4005
018b354
4ecec83
de2fb71
d0856aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # SPDX-FileCopyrightText: 2025 Knitli Inc. | ||
| # SPDX-FileContributor: Adam Poulemanos <[email protected]> | ||
| # | ||
| # SPDX-License-Identifier: MIT OR Apache-2.0 | ||
|
|
||
| name: Generate Changelog | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: 'Generate changelog for specific tag (e.g., v0.1.0). Leave empty for unreleased changes.' | ||
| required: false | ||
| type: string | ||
| commit: | ||
| description: 'Commit and push the generated CHANGELOG.md' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| generate-changelog: | ||
| name: Generate Changelog | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | ||
| with: | ||
| fetch-depth: 0 # Fetch all history for changelog generation | ||
|
|
||
| - name: Install git-cliff | ||
| uses: taiki-e/install-action@331a600f1b10a3fed8dc56f925012bede91ae51f | ||
| with: | ||
| tool: [email protected] | ||
|
|
||
| - name: Generate changelog | ||
| id: changelog | ||
| run: | | ||
| if [ -n "${{ github.event.inputs.tag }}" ]; then | ||
| echo "Generating changelog for tag ${{ github.event.inputs.tag }}" | ||
| git-cliff --tag "${{ github.event.inputs.tag }}" --output CHANGELOG.md | ||
| else | ||
| echo "Generating changelog for unreleased changes" | ||
| git-cliff --unreleased --output CHANGELOG.md --prepend | ||
| fi | ||
sourcery-ai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Display changelog | ||
| run: | | ||
| echo "Generated CHANGELOG.md:" | ||
| cat CHANGELOG.md | ||
|
|
||
| - name: Commit and push | ||
| if: github.event.inputs.commit == 'true' | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add CHANGELOG.md | ||
| if git diff --staged --quiet; then | ||
| echo "No changes to commit" | ||
| else | ||
| git commit -m "docs: update CHANGELOG.md" | ||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| git push | ||
| fi | ||
|
|
||
| - name: Upload changelog artifact | ||
| uses: actions/upload-artifact@4b540d30404c5374296eb0061f5d53f85b8f4cc2 | ||
| with: | ||
| name: changelog | ||
| path: CHANGELOG.md | ||
| retention-days: 7 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,9 +81,82 @@ jobs: | |
| fi | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "tag=v$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install git-cliff | ||
| uses: taiki-e/install-action@331a600f1b10a3fed8dc56f925012bede91ae51f | ||
| with: | ||
| tool: [email protected] | ||
|
|
||
| - name: Generate release notes | ||
| id: release_notes | ||
| run: "# Get the latest release tag (before current)\nPREVIOUS_TAG=\"$(git tag --sort=-version:refname | grep -E '^v[0-9]+\\.[0-9]+\\.[0-9]+' | head -2 | tail -1 || echo \"\")\"\nCURRENT_TAG=\"${{ steps.version.outputs.tag }}\"\n\necho \"Previous tag: $PREVIOUS_TAG\"\necho \"Current tag: $CURRENT_TAG\"\n\n# Generate changelog\ncat > release_notes.md << 'EOF'\n## What's Changed\n\nEOF\n\nif [ -n \"$PREVIOUS_TAG\" ] && [ \"$PREVIOUS_TAG\" != \"$CURRENT_TAG\" ]; then\n # Get commits since last release\n git log --pretty=format:\"- %s (%h)\" --no-merges \"$PREVIOUS_TAG..$CURRENT_TAG\" >> release_notes.md\nelse\n echo \"- Initial alpha release\" >> release_notes.md\nfi\n\ncat >> release_notes.md << 'EOF'\n\n## Installation\n\nEOF\n\n# Add pre-release specific installation instructions\nVERSION=\"${{ steps.version.outputs.version }}\"\nif [[ \"$VERSION\" == *\"a\"* ]] || [[ \"$VERSION\" == *\"b\"* ]] || [[ \"$VERSION\" == *\"rc\"* ]]; then\n cat >> release_notes.md << 'EOF'\n**This is a pre-release version.** Install with:\n```bash\npip install --pre codeweaver\n# Or specific version:\npip install code-weaver==${{ steps.version.outputs.version }}\n```\nEOF\nelse\n cat >> release_notes.md << 'EOF'\nInstall from PyPI:\n```bash\npip install code-weaver\n```\nEOF\nfi\n\ncat >> release_notes.md << 'EOF'\n\nOr download the wheel/source distribution from the assets below.\n\n## Verification\n\nAll release artifacts are built from source and include:\n- \U0001F4E6 Wheel distribution (.whl)\n- \U0001F4E6 Source distribution (.tar.gz)\n\nEOF\n\nif [ -n \"$PREVIOUS_TAG\" ]; then\n echo \"**Full Changelog**: https://github.com/knitli/codeweaver/compare/$PREVIOUS_TAG...$CURRENT_TAG\" >> release_notes.md\nelse\n echo \"**Full Changelog**: https://github.com/knitli/codeweaver/commits/$CURRENT_TAG\" >> release_notes.md\nfi\n" | ||
| run: | | ||
| # Get the latest release tag (before current) | ||
| PREVIOUS_TAG="$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -2 | tail -1 || echo "")" | ||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CURRENT_TAG="${{ steps.version.outputs.tag }}" | ||
| VERSION="${{ steps.version.outputs.version }}" | ||
|
|
||
| echo "Previous tag: $PREVIOUS_TAG" | ||
| echo "Current tag: $CURRENT_TAG" | ||
|
|
||
| # Generate changelog using git-cliff | ||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if [ -n "$PREVIOUS_TAG" ] && [ "$PREVIOUS_TAG" != "$CURRENT_TAG" ]; then | ||
| # Generate changelog for the range between previous and current tag | ||
| git-cliff --strip all --tag "$CURRENT_TAG" "$PREVIOUS_TAG..$CURRENT_TAG" > changelog_section.md | ||
| else | ||
| # First release - get all commits | ||
| git-cliff --strip all --tag "$CURRENT_TAG" > changelog_section.md | ||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| fi | ||
|
|
||
| # Build complete release notes with installation instructions | ||
| cat > release_notes.md << 'EOF' | ||
| ## What's Changed | ||
|
|
||
| EOF | ||
|
|
||
| cat changelog_section.md >> release_notes.md | ||
|
|
||
| cat >> release_notes.md << 'EOF' | ||
|
|
||
| ## Installation | ||
|
|
||
| EOF | ||
|
|
||
| # Add pre-release specific installation instructions | ||
| if [[ "$VERSION" == *"a"* ]] || [[ "$VERSION" == *"b"* ]] || [[ "$VERSION" == *"rc"* ]]; then | ||
| cat >> release_notes.md << EOF | ||
| **This is a pre-release version.** Install with: | ||
| \`\`\`bash | ||
| pip install --pre code-weaver | ||
|
||
| # Or specific version: | ||
| pip install code-weaver==$VERSION | ||
| \`\`\` | ||
| EOF | ||
bashandbone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| else | ||
| cat >> release_notes.md << 'EOF' | ||
| Install from PyPI: | ||
| ```bash | ||
| pip install code-weaver | ||
| ``` | ||
| EOF | ||
| fi | ||
|
|
||
| cat >> release_notes.md << 'EOF' | ||
|
|
||
| Or download the wheel/source distribution from the assets below. | ||
|
|
||
| ## Verification | ||
|
|
||
| All release artifacts are built from source and include: | ||
| - 📦 Wheel distribution (.whl) | ||
| - 📦 Source distribution (.tar.gz) | ||
|
|
||
| EOF | ||
|
|
||
| if [ -n "$PREVIOUS_TAG" ]; then | ||
| echo "**Full Changelog**: https://github.com/knitli/codeweaver/compare/$PREVIOUS_TAG...$CURRENT_TAG" >> release_notes.md | ||
| else | ||
| echo "**Full Changelog**: https://github.com/knitli/codeweaver/commits/$CURRENT_TAG" >> release_notes.md | ||
| fi | ||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe | ||
| with: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to CodeWeaver will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Bug Fixes | ||
| - Verify sparse-only vector search fix (ISSUE-001) ([#176](https://github.com/knitli/codeweaver/pull/176)) | ||
| - Fix Docker Compose CI test failures - correct Qdrant health endpoint ([#178](https://github.com/knitli/codeweaver/pull/178)) | ||
| - chore: Add plans for server separation of services refactor to enable… ([#179](https://github.com/knitli/codeweaver/pull/179)) | ||
|
||
| - Add REUSE.toml for third-party licensing, fix mislabeled vendored files ([#171](https://github.com/knitli/codeweaver/pull/171)) | ||
| - Fix multiple failing actions due to reusable files recognition ([#167](https://github.com/knitli/codeweaver/pull/167)) | ||
| - Fix Docker build failures by respecting CODEWEAVER_PROJECT_PATH environment variable ([#165](https://github.com/knitli/codeweaver/pull/165)) | ||
| - Fix release workflow test exclusions to match CI workflow ([#164](https://github.com/knitli/codeweaver/pull/164)) | ||
| - fix: Remove corrupted standalone variable names from copilot-setup-steps.yml ([#163](https://github.com/knitli/codeweaver/pull/163)) | ||
| - Fix: Respect CODEWEAVER_PROJECT_PATH in settings _defaults() ([#162](https://github.com/knitli/codeweaver/pull/162)) | ||
| - Fix test collection namespace collision and apply consistent pytest marks ([#35](https://github.com/knitli/codeweaver/pull/35)) | ||
| - Fix undefined names and circular imports in vector stores ([#29](https://github.com/knitli/codeweaver/pull/29)) | ||
| - Fix CI lint/build job failures: install zsh and correct mise.toml shebangs ([#34](https://github.com/knitli/codeweaver/pull/34)) | ||
|
|
||
| ### Features | ||
| - Refactor server architecture to separate concerns and enable stdio transport ([#172](https://github.com/knitli/codeweaver/pull/172)) | ||
|
|
||
| ### Other Changes | ||
| - Implement semantic and delimiter chunking systems, add vector store implementations, general code improvements. ([#28](https://github.com/knitli/codeweaver/pull/28)) | ||
|
|
||
| ### Performance | ||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - feat: implement modular workflows with efficiency optimizations ([#166](https://github.com/knitli/codeweaver/pull/166)) | ||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <!-- generated by git-cliff --> | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,126 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # SPDX-FileCopyrightText: 2025 Knitli Inc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # SPDX-FileContributor: Adam Poulemanos <[email protected]> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # SPDX-License-Identifier: MIT OR Apache-2.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # git-cliff configuration for automated changelog generation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # See: https://git-cliff.org/docs/configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [changelog] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Template for the changelog header | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| header = """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Changelog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| All notable changes to CodeWeaver will be documented in this file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Template for the changelog body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Available variables: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - version: Version number | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - message: Commit message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - date: Commit date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - commits: List of commits for this version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body = """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% if version -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% else -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## [Unreleased] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% endif -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% for group, commits in commits | group_by(attribute="group") %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### {{ group | striptags | trim | upper_first }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- for commit in commits -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- if commit.message is starting_with("Merge pull request") -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- set_global pr_num = commit.message | replace(from="Merge pull request #", to="") | split(pat=" ") | first -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- if commit.message is containing(" | ") -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- set_global pr_desc = commit.message | split(pat=" | ") | last -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- else -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- set_global pr_desc = "No description" -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- endif %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - {{ pr_desc }} ([#{{ pr_num }}](https://github.com/knitli/codeweaver/pull/{{ pr_num }})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- else %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - {{ commit.message | upper_first }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- endif -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- if commit.breaking %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **BREAKING**: {{ commit.breaking_description }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {%- endif -%} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% endfor %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% endfor %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Template for the changelog footer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| footer = """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- generated by git-cliff --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Remove the leading and trailing whitespace from the templates | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| trim = true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Postprocessors to apply after rendering the changelog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| postprocessors = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Replace issue/PR numbers with links | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { pattern = '\(#([0-9]+)\)', replace = "([#${1}](https://github.com/knitli/codeweaver/pull/${1}))" }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Replace issue/PR numbers with links | |
| { pattern = '\(#([0-9]+)\)', replace = "([#${1}](https://github.com/knitli/codeweaver/pull/${1}))" }, | |
| # No postprocessors needed; PR links are already generated in the template |
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment on line 73 states "THIS IS KEY for PR-based changelog" but the actual setting split_commits = false is on line 74. The comment seems to indicate this is an important setting, but the description could be clearer about what split_commits does and why false is the correct value for PR-based changelogs.
Consider expanding the comment to explain: "Set to false to treat merge commits as single entries (important for PR-based changelogs)" for better maintainability.
| # Process merge commits - THIS IS KEY for PR-based changelog | |
| # Set to false to treat merge commits (such as PR merges) as single entries in the changelog. | |
| # This is important for PR-based changelogs, as it ensures each PR appears as one changelog entry. |
sourcery-ai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern in the commit preprocessor may not handle PR descriptions correctly if they contain newlines within the description. The pattern \n+(.+) will only capture text up to the first newline within the PR description, truncating multi-paragraph PR descriptions to just the first line.
Consider using (.+) with the DOTALL flag or ([\s\S]+) to capture the full PR description including newlines.
| { pattern = 'Merge pull request (#[0-9]+) from ([^\n]+)\n+(.+)', replace = "Merge pull request ${1} from ${2} | ${3}" }, | |
| { pattern = 'Merge pull request (#[0-9]+) from ([^\n]+)\n+([\s\S]+)', replace = "Merge pull request ${1} from ${2} | ${3}" }, |
Outdated
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit preprocessor regex pattern uses \n+(.+) to capture the PR description, but the . metacharacter doesn't match newline characters by default. This means only the first line of multi-line PR descriptions will be captured. Consider using (.+) with a multiline flag or ([\s\S]+) to capture the full PR description including any newlines in the body.
| { pattern = 'Merge pull request (#[0-9]+) from ([^\n]+)\n+(.+)', replace = "Merge pull request ${1} from ${2} | ${3}" }, | |
| { pattern = 'Merge pull request (#[0-9]+) from ([^\n]+)\n+([\s\S]+)', replace = "Merge pull request ${1} from ${2} | ${3}" }, |
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The branch pattern matching uses partial matches (e.g., /feat, /feature) which will also match branches like /feature-xyz or /feats. While this might be intentional for flexibility, it could lead to unexpected categorization. Consider using more explicit patterns like /feat/ or /feature/ if branches are expected to follow a strict type/description format, or document that partial matching is intentional.
| { message = "^Merge pull request #[0-9]+ from .*/feat", group = "Features" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/feature", group = "Features" }, | |
| # Fixes - multiple patterns for fix-related branches | |
| { message = "^Merge pull request #[0-9]+ from .*/fix", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/bugfix", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/hotfix", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/issue-", group = "Bug Fixes" }, | |
| # Documentation | |
| { message = "^Merge pull request #[0-9]+ from .*/docs", group = "Documentation" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/doc", group = "Documentation" }, | |
| # Performance | |
| { message = "^Merge pull request #[0-9]+ from .*/perf", group = "Performance" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/optimize", group = "Performance" }, | |
| # Refactoring | |
| { message = "^Merge pull request #[0-9]+ from .*/refactor", group = "Refactoring" }, | |
| # Testing | |
| { message = "^Merge pull request #[0-9]+ from .*/test", group = "Testing" }, | |
| # CI/CD and tooling | |
| { message = "^Merge pull request #[0-9]+ from .*/ci", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/workflow", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/build", group = "Build System" }, | |
| # Chores and maintenance | |
| { message = "^Merge pull request #[0-9]+ from .*/chore", group = "Maintenance" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/feat/", group = "Features" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/feature/", group = "Features" }, | |
| # Fixes - multiple patterns for fix-related branches | |
| { message = "^Merge pull request #[0-9]+ from .*/fix/", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/bugfix/", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/hotfix/", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/issue-", group = "Bug Fixes" }, | |
| # Documentation | |
| { message = "^Merge pull request #[0-9]+ from .*/docs/", group = "Documentation" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/doc/", group = "Documentation" }, | |
| # Performance | |
| { message = "^Merge pull request #[0-9]+ from .*/perf/", group = "Performance" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/optimize/", group = "Performance" }, | |
| # Refactoring | |
| { message = "^Merge pull request #[0-9]+ from .*/refactor/", group = "Refactoring" }, | |
| # Testing | |
| { message = "^Merge pull request #[0-9]+ from .*/test/", group = "Testing" }, | |
| # CI/CD and tooling | |
| { message = "^Merge pull request #[0-9]+ from .*/ci/", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/workflow/", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/build/", group = "Build System" }, | |
| # Chores and maintenance | |
| { message = "^Merge pull request #[0-9]+ from .*/chore/", group = "Maintenance" }, |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit parser patterns use from .*/feat (and similar) which will only match branch names that have feat at the end of the path. However, according to the documentation (line 221), branches like feat/my-feature should be matched. The current pattern would only match something/feat, not feat/something. The patterns should be from .*feat/ or from .*feat to match branches that start with or contain the prefix followed by a slash.
| { message = "^Merge pull request #[0-9]+ from .*/feat", group = "Features" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/feature", group = "Features" }, | |
| # Fixes - multiple patterns for fix-related branches | |
| { message = "^Merge pull request #[0-9]+ from .*/fix", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/bugfix", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/hotfix", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/issue-", group = "Bug Fixes" }, | |
| # Documentation | |
| { message = "^Merge pull request #[0-9]+ from .*/docs", group = "Documentation" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/doc", group = "Documentation" }, | |
| # Performance | |
| { message = "^Merge pull request #[0-9]+ from .*/perf", group = "Performance" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/optimize", group = "Performance" }, | |
| # Refactoring | |
| { message = "^Merge pull request #[0-9]+ from .*/refactor", group = "Refactoring" }, | |
| # Testing | |
| { message = "^Merge pull request #[0-9]+ from .*/test", group = "Testing" }, | |
| # CI/CD and tooling | |
| { message = "^Merge pull request #[0-9]+ from .*/ci", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/workflow", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*/build", group = "Build System" }, | |
| # Chores and maintenance | |
| { message = "^Merge pull request #[0-9]+ from .*/chore", group = "Maintenance" }, | |
| { message = "^Merge pull request #[0-9]+ from .*feat/", group = "Features" }, | |
| { message = "^Merge pull request #[0-9]+ from .*feature/", group = "Features" }, | |
| # Fixes - multiple patterns for fix-related branches | |
| { message = "^Merge pull request #[0-9]+ from .*fix/", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*bugfix/", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*hotfix/", group = "Bug Fixes" }, | |
| { message = "^Merge pull request #[0-9]+ from .*issue-/", group = "Bug Fixes" }, | |
| # Documentation | |
| { message = "^Merge pull request #[0-9]+ from .*docs/", group = "Documentation" }, | |
| { message = "^Merge pull request #[0-9]+ from .*doc/", group = "Documentation" }, | |
| # Performance | |
| { message = "^Merge pull request #[0-9]+ from .*perf/", group = "Performance" }, | |
| { message = "^Merge pull request #[0-9]+ from .*optimize/", group = "Performance" }, | |
| # Refactoring | |
| { message = "^Merge pull request #[0-9]+ from .*refactor/", group = "Refactoring" }, | |
| # Testing | |
| { message = "^Merge pull request #[0-9]+ from .*test/", group = "Testing" }, | |
| # CI/CD and tooling | |
| { message = "^Merge pull request #[0-9]+ from .*ci/", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*workflow/", group = "CI/CD" }, | |
| { message = "^Merge pull request #[0-9]+ from .*build/", group = "Build System" }, | |
| # Chores and maintenance | |
| { message = "^Merge pull request #[0-9]+ from .*chore/", group = "Maintenance" }, |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit parser patterns rely solely on branch names for categorization, which can lead to incorrect categorization when PR descriptions contain conventional commit prefixes (e.g., "feat:", "chore:", "fix:") that conflict with the branch name pattern. This is evidenced in the generated CHANGELOG.md where entries like "chore: Add plans..." appear under "Bug Fixes" and "feat: implement..." appears under "Performance".
Consider enhancing the commit_preprocessors to extract and use conventional commit prefixes from PR descriptions for categorization, or document that branch naming conventions should take precedence over commit message conventions to avoid confusion.
Outdated
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag pattern tag_pattern = "v[0-9].*" is overly permissive and could match unintended tags. It will match any tag starting with 'v' followed by a single digit and anything else (e.g., v1xyz, v2-random-tag).
Based on the release workflow's tag pattern on line 94 ('^v[0-9]+\.[0-9]+\.[0-9]+([ab]|rc|-alpha|-beta)?[0-9]*(\.[0-9]+)?$'), consider using a more restrictive pattern that matches semantic versioning:
tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+"This ensures only properly formatted version tags are included in the changelog.
| tag_pattern = "v[0-9].*" | |
| tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+" |
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -210,19 +210,63 @@ pip install --pre --upgrade codeweaver | |||||
|
|
||||||
| By default, `pip install code-weaver` will **not** install pre-releases. | ||||||
|
|
||||||
| ## Integration with Changesets | ||||||
| ## Changelog Management | ||||||
|
|
||||||
| This project uses changesets for changelog management. The version workflow integrates with changesets: | ||||||
| This project uses **git-cliff** for automated changelog generation. Changelogs are generated from pull request merge commits, filtering out individual commit noise. | ||||||
|
|
||||||
| 1. Create changeset for your changes: | ||||||
| ```bash | ||||||
| changeset add | ||||||
| ``` | ||||||
| ### How It Works | ||||||
|
|
||||||
| - **PR-focused**: Only merge commits from pull requests are included in changelogs | ||||||
| - **Automatic categorization**: PRs are grouped by branch name patterns: | ||||||
| - `feat/` or `feature/` → Features | ||||||
| - `fix/`, `bugfix/`, `hotfix/`, `issue-` → Bug Fixes | ||||||
| - `optimize/`, `perf/` → Performance | ||||||
|
||||||
| - `docs/`, `doc/` → Documentation | ||||||
| - `refactor/` → Refactoring | ||||||
bashandbone marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| - `ci/`, `workflow/` → CI/CD | ||||||
| - `test/` → Testing | ||||||
bashandbone marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| - Everything else → Other Changes | ||||||
| - **Clean output**: Extracts PR descriptions instead of showing "Merge pull request..." messages | ||||||
| - **Manual triggers**: Generate changelogs on-demand via mise tasks or GitHub workflows | ||||||
|
|
||||||
| ### Local Usage | ||||||
|
|
||||||
| Generate and view changelog: | ||||||
| ```bash | ||||||
| # View full changelog (stdout) | ||||||
| mise run changelog | ||||||
|
|
||||||
| # View unreleased changes only (stdout) | ||||||
| mise run changelog-unreleased | ||||||
|
|
||||||
| # Update CHANGELOG.md with unreleased changes | ||||||
| mise run changelog-update | ||||||
|
|
||||||
| # Generate changelog for specific tag | ||||||
| mise run changelog-tag v0.1.0 | ||||||
|
||||||
| mise run changelog-tag v0.1.0 | |
| mise run changelog-tag -- --usage_tag=v0.1.0 |
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
bashandbone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation states "Squash vs Merge: The setup works with both squash commits and merge commits, but focuses on the final PR merge." However, the cliff.toml configuration (line 35) explicitly looks for messages starting with "Merge pull request", which suggests it only works with merge commits, not squash commits. Squashed commits typically have a different message format. This documentation should be clarified or the configuration should be updated to handle both commit types.
| 4. **Squash vs Merge**: The setup works with both squash commits and merge commits, but focuses on the final PR merge | |
| 4. **Squash vs Merge**: The setup primarily works with merge commits (i.e., "Merge pull request" messages). Squashed commits are not automatically included in the changelog unless their commit messages follow the expected pattern. For best results, use merge commits or ensure squash commit messages are formatted for changelog inclusion. |
Uh oh!
There was an error while loading. Please reload this page.