Skip to content

feat: add version:info command and PR title validation#3548

Open
eablack wants to merge 8 commits intov11.0.0from
eb/add-version-info
Open

feat: add version:info command and PR title validation#3548
eablack wants to merge 8 commits intov11.0.0from
eb/add-version-info

Conversation

@eablack
Copy link
Contributor

@eablack eablack commented Feb 28, 2026

Summary

Adds a new version:info command that displays changelog entries from CHANGELOG.md, and a post-update hook that automatically shows release notes after CLI updates.

This provides users with an easy way to see what's new in each release.

We also add a github check to require conventional commit in the header.

Type of Change

Feature Additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Key Features

  • version:info command: Display changelog for current or specific version

    • Optional version argument (defaults to most recent entry)
    • Shows Summary section if available, otherwise Bug Fixes + Features
    • Falls back to "Miscellaneous improvements" if no sections found
    • Uses marked-terminal for proper terminal markdown rendering
  • Post-update hook: Automatically displays "What's New" after CLI updates

    • Runs version:info command after successful updates
    • Supports HIDE_HEROKU_RELEASE_NOTES=true to suppress output
    • Includes error handling to avoid blocking updates
  • CI enhancement: Added PR title check workflow for Conventional Commits

Implementation Details

  • Uses marked and marked-terminal for professional terminal markdown rendering
  • Parses CHANGELOG.md to extract version entries dynamically
  • Follows patterns from Salesforce CLI's release notes implementation
  • Includes comprehensive unit tests

Testing

Steps:

  1. Run heroku version:info to see the most recent changelog entry
  2. Run heroku version:info 10.17.0 to see a specific version's changelog

Related Issues

N/A - New feature

Add new version:info command that displays changelog information for
specific CLI versions or the most recent version.

Features:
- Takes an optional version argument (e.g., '11.0.0', '10.17.0')
- When no version is provided, displays the most recent changelog entry
- Smart summary extraction: if the version entry has a Summary section
  as the first content, only shows the summary with a link to the full
  changelog
- Handles both ## and # markdown headers for version entries
- Provides helpful error messages for non-existent versions

Examples:
  heroku version:info              # Show most recent version
  heroku version:info 11.0.0       # Show specific version
  heroku version:info 10.17.0      # Show older version

Includes comprehensive unit tests (10 tests) covering:
- Summary extraction logic
- Most recent entry extraction
- Specific version lookup
- Edge cases (missing versions, empty changelog, etc.)
Add GitHub workflow that validates PR titles follow conventional commit
format since we squash PRs and use the title as the commit message.

The check validates:
- PR title follows format: type(scope)?: description
- Allowed types: feat, fix, chore, docs, style, refactor, perf, test,
  build, ci, revert, deps
- Breaking changes can be indicated with '!' (e.g., feat!: breaking change)
- Subject should start with lowercase
- Scope is optional

This ensures consistent commit history and proper semantic versioning
when PRs are squashed and merged.
@eablack eablack requested a review from a team as a code owner February 28, 2026 02:12
Update version:info command to intelligently display changelog content:

1. If version has Summary section → show only summary
2. Else if version has Bug Fixes or Features → show only those sections
3. Else → show 'Miscellaneous improvements' message

Always includes link to full changelog at the end.

This provides a concise view of changes while directing users to the
full changelog for complete details.
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:11 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:11 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:11 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:11 — with GitHub Actions Inactive
Add stripMarkdown method to convert markdown to plain text for better
readability in terminal output.

Removes:
- Links: [text](url) -> text
- Bold/italic: **text** or *text* -> text
- Code blocks: `code` -> code
- Headers: ### Header -> Header
- Extra asterisks

The output is now clean, readable plain text while still maintaining
the structure and information hierarchy.
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:17 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:17 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:17 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:17 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:38 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:38 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:38 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 17:38 — with GitHub Actions Inactive
- Add marked and marked-terminal dependencies
- Replace custom stripMarkdown with marked for proper terminal rendering
- Add show-version-info update hook to display changelog after updates
- Support HIDE_HEROKU_RELEASE_NOTES env var to skip release notes
- Hook includes error handling to avoid blocking updates
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 18:23 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 18:23 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 18:23 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 18:23 — with GitHub Actions Inactive
- Use markedTerminal() function with marked.use() instead of deprecated setOptions
- Replace @ts-expect-error with proper type assertion
- Add explanatory comment about @types/marked-terminal having incorrect types
- The actual markedTerminal() implementation returns a proper MarkedExtension
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 18:28 — with GitHub Actions Inactive
@eablack eablack requested a deployment to AcceptanceTests March 2, 2026 18:28 — with GitHub Actions In progress
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 18:28 — with GitHub Actions Inactive
@eablack eablack requested a deployment to AcceptanceTests March 2, 2026 18:28 — with GitHub Actions In progress
@eablack eablack temporarily deployed to AcceptanceTests March 2, 2026 18:29 — with GitHub Actions Inactive
@eablack eablack requested a deployment to AcceptanceTests March 2, 2026 18:29 — with GitHub Actions In progress
@eablack eablack requested a deployment to AcceptanceTests March 2, 2026 18:29 — with GitHub Actions In progress
@eablack eablack deployed to AcceptanceTests March 2, 2026 18:29 — with GitHub Actions Active
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