Skip to content

Commit

Permalink
Merge pull request #100 from andrewnicols/correctUpgradeNotesChanges
Browse files Browse the repository at this point in the history
Get next version instead of bumping it
  • Loading branch information
junpataleta authored Oct 11, 2024
2 parents 2a32f89 + 3f359a1 commit 82054d0
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion prerelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ generate_upgrade_notes() {
output " ${R}Error running npm ci. Details:${N} $(<"${tmpfile}")"
output " - Generating upgrade notes"

local release=`php ${mydir}/bumpversions.php -b "$branch" -t "$type" -p "$pwd" -r "$rc" -d "$date" -i "$isdevbranch"`
local release=`php ${mydir}/get_next_version_number.php -b "$branch" -t "$type" -p "$pwd" -r "$rc" -d "$date" -i "$isdevbranch"`

if [ $type == "major" ] || [ $type == "minor" ]; then
.grunt/upgradenotes.mjs release -d "${release}" > "${tmpfile}" 2>&1 || \
Expand Down
57 changes: 57 additions & 0 deletions tests/unit/VersionInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class VersionInfoTest extends TestCase
#[DataProvider('nextVersionFromWeeklyProvider')]
#[DataProvider('nextVersionFromDevelopmentProvider')]
#[DataProvider('nextVersionFromBetaProvider')]
#[DataProvider('nextVersionFromRCProvider')]
public function testGetNextVersion(
array $currentVersionArgs,
array $nextVersionArgs,
Expand Down Expand Up @@ -545,6 +546,62 @@ public static function nextVersionFromBetaProvider(): array
];
}

public static function nextVersionFromRCProvider(): array
{
$version = [
'integerversion' => 2024092301,
'decimalversion' => 0,
'comment' => '// 20240923 = branching date YYYYMMDD - do not modify!',
'release' => '5.0rc1',
'build' => '20240921',
'branch' => '500',
'maturity' => 'MATURITY_RC',
'branchquote' => "'",
'releasequote' => "'",
];

return [
'RC version from RC' => [
$version,
[
'branch' => 'MOODLE_500_STABLE',
'type' => 'rc',
'rc' => '2',
'date' => '20240923',
'isdevbranch' => true,
],
[
'integerversion' => date('Ymd') * 100,
'decimalversion' => '00',
'release' => '5.0rc2',
'build' => '20240923',
'branchquote' => "'",
'releasequote' => "'",
'maturity' => 'MATURITY_RC',
],
],
'Major version from RC' => [
$version,
[
'branch' => 'MOODLE_500_STABLE',
'type' => 'major',
'rc' => '',
'date' => '20240923',
'isdevbranch' => true,
],
[
'integerversion' => 2024092300,
'decimalversion' => '00',
'release' => '5.0',
'build' => '20240923',
'branchquote' => "'",
'releasequote' => "'",
'maturity' => 'MATURITY_STABLE',
],
],
];
}

#[DataProvider('invalidNextVersionMigrationsProvider')]
public function testGetNextVersionInvalidTransition(
array $currentVersionArgs,
Expand Down

0 comments on commit 82054d0

Please sign in to comment.