feat: add version:info command and PR title validation#3548
Open
feat: add version:info command and PR title validation#3548
Conversation
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.
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.
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.
- 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
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
version:infocommand 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)
Key Features
version:infocommand: Display changelog for current or specific versionPost-update hook: Automatically displays "What's New" after CLI updates
version:infocommand after successful updatesHIDE_HEROKU_RELEASE_NOTES=trueto suppress outputCI enhancement: Added PR title check workflow for Conventional Commits
Implementation Details
markedandmarked-terminalfor professional terminal markdown renderingTesting
Steps:
heroku version:infoto see the most recent changelog entryheroku version:info 10.17.0to see a specific version's changelogRelated Issues
N/A - New feature