Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Dec 27, 2025

Problem

When generating changelog preview for a PR, the "Suggested version bump" was incorrectly showing the bump type from ALL commits since the last tag instead of just the current PR.

For example, if the changelog history contained a feat: commit (minor) but the current PR was chore: (patch), the preview would incorrectly show "minor" instead of "patch".

This was observed in PRs like #675 where the bump type didn't match the PR's change type.

Solution

  • Calculate the bump type for the specific PR using getBumpTypeForPR() instead of using the aggregated stats from all commits
  • This is now consistent with the behavior when a PR is skipped (which was already correct)
  • Updated workflow wording from "Suggested Version Bump" to "Semver Impact of This PR" to clarify the meaning

Changes

  • src/utils/changelog.ts: Use PR-specific bump type in generateChangelogWithHighlight()
  • .github/workflows/changelog-preview.yml: Update section heading wording

@github-actions
Copy link
Contributor

github-actions bot commented Dec 27, 2025

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Changelog

  • Strip commit patterns from changelog entries by @BYK in #674
  • Add support for custom changelog entries from PR descriptions by @szokeasaurusrex in #648
  • And with support for multiple entries by @szokeasaurusrex in #648
    • and nested items
  • Add changelog preview action and CLI command by @BYK in #669

Other

  • (actions) Make release workflow reusable for external repos by @BYK in #672

Bug Fixes 🐛

  • (changelog) Use PR-specific bump type in preview by @BYK in #676

Documentation 📚

  • New documentation site! by @BYK in #668

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

PR Preview Action v1.7.1

🚀 View preview at
https://getsentry.github.io/craft/pr-preview/pr-676/

Built to branch gh-pages at 2025-12-27 16:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

When generating changelog preview for a PR, the bump type was incorrectly
calculated from ALL commits since the last tag instead of just the current PR.
This caused PRs with patch-level changes (e.g., chore:, ref:) to show 'minor'
if any feature commits existed in the changelog history.

Now we use getBumpTypeForPR() to calculate the bump type for the specific PR
being previewed, consistent with the behavior when the PR is skipped.

Also updates the workflow wording from 'Suggested Version Bump' to
'Semver Impact of This PR' to clarify the meaning.
@BYK BYK force-pushed the byk/fix/wrong-bump branch from dd9a01a to 96ee673 Compare December 28, 2025 10:01
@BYK BYK marked this pull request as ready for review December 28, 2025 10:05
…ghlight

The function was returning hardcoded statistics (totalCommits: 1,
matchedCommitsWithSemver: 0 or 1) while the changelog itself was
generated from all commits. This caused misleading CLI output and
incorrect log messages in the auto-versioning process.

Now uses the stats from categorizeCommits which reflect all commits
processed for the changelog, while keeping the bumpType PR-specific.
@BYK BYK enabled auto-merge (squash) December 28, 2025 12:39
@BYK BYK merged commit f26fd44 into master Dec 28, 2025
14 checks passed
@BYK BYK deleted the byk/fix/wrong-bump branch December 28, 2025 18:10
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.

3 participants