Skip to content

Fix #279: Add link to upgrade notes to news text #324

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/App/Command/Release/MakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,20 @@ private function displayReleaseSummary(Package $package, ComposerConfig $compose

$changes = implode("\n", $changes);

$upgradeNotesLink = '';
$upgradePath = $package->getPath() . '/UPGRADE.md';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs for major releases only.

if (file_exists($upgradePath)) {
Copy link
Preview

Copilot AI Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using is_file() instead of file_exists() to ensure the path points to a regular file rather than a directory.

Suggested change
if (file_exists($upgradePath)) {
if (is_file($upgradePath)) {

Copilot uses AI. Check for mistakes.

$upgradeNotesLink = "\n\nSee [UPGRADE.md](https://github.com/yiisoft/$packageName/blob/$versionToRelease/UPGRADE.md) for upgrade notes.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if we link to exact notes with anchor. For example:

Suggested change
$upgradeNotesLink = "\n\nSee [UPGRADE.md](https://github.com/yiisoft/$packageName/blob/$versionToRelease/UPGRADE.md) for upgrade notes.";
$upgradeNotesLink = "\n\nSee [UPGRADE.md](https://github.com/yiisoft/$packageName/blob/$versionToRelease/UPGRADE.md#1-0) for upgrade notes.";

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tricky since header in these notes is created manually and doesn't correspond to version being released.

}

$text = <<<TEXT
[$description](https://github.com/$packageName) version $versionToRelease was released.
In this version:

$changes
$upgradeNotesLink
TEXT;

$io->info($text . "\n");
$io->info(trim($text) . "\n");
}
}
Loading